1. 28 2月, 2015 1 次提交
  2. 18 2月, 2015 2 次提交
    • M
      hmp: Name HMP command handler functions hmp_COMMAND() · 3e5a50d6
      Markus Armbruster 提交于
      Some are called do_COMMAND() (old ones, usually), some hmp_COMMAND(),
      and sometimes COMMAND pointlessly differs in spelling.
      
      Normalize to hmp_COMMAND(), where COMMAND is exactly the command name
      with '-' replaced by '_'.
      
      Exceptions:
      
      * do_device_add() and client_migrate_info() *not* renamed to
        hmp_device_add(), hmp_client_migrate_info(), because they're also
        QMP handlers.  They still need to be converted to QAPI.
      
      * do_memory_dump(), do_physical_memory_dump(), do_ioport_read(),
        do_ioport_write() renamed do hmp_* instead of hmp_x(), hmp_xp(),
        hmp_i(), hmp_o(), because those names are too cryptic for my taste.
      
      * do_info_help() renamed to hmp_info_help() instead of hmp_info(),
        because it only covers help.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      3e5a50d6
    • M
      error: Use error_report_err() where appropriate · 565f65d2
      Markus Armbruster 提交于
      Coccinelle semantic patch:
      
          @@
          expression E;
          @@
          -    error_report("%s", error_get_pretty(E));
          -    error_free(E);
          +    error_report_err(E);
          @@
          expression E, S;
          @@
          -    error_report("%s", error_get_pretty(E));
          +    error_report_err(E);
          (
               exit(S);
          |
               abort();
          )
      
      Trivial manual touch-ups in block/sheepdog.c.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      565f65d2
  3. 16 2月, 2015 8 次提交
    • M
      block: Remove "growable" from BDS · c0191e76
      Max Reitz 提交于
      Now that request clamping is done in the BlockBackend, the "growable"
      field can be removed from the BlockDriverState. All BDSs are now treated
      as being "growable" (that is, they are allowed to grow; they are not
      necessarily actually able to).
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-id: 1423162705-32065-16-git-send-email-mreitz@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      c0191e76
    • M
      block: Clamp BlockBackend requests · e7f7d676
      Max Reitz 提交于
      BlockBackend is used as the interface between the block layer and guest
      devices. It should therefore assure that all requests are clamped to the
      image size.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NKevin Wolf <kwolf@redhat.com>
      Message-id: 1423162705-32065-15-git-send-email-mreitz@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      e7f7d676
    • M
      block: Add Error parameter to bdrv_find_protocol() · b65a5e12
      Max Reitz 提交于
      The argument given to bdrv_find_protocol() is just a file name, which
      makes it difficult for the caller to reconstruct what protocol
      bdrv_find_protocol() was hoping to find. This patch adds an Error
      parameter to that function to solve this issue.
      Suggested-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-id: 1423162705-32065-4-git-send-email-mreitz@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      b65a5e12
    • M
      block: Add blk_new_open() · ca49a4fd
      Max Reitz 提交于
      blk_new_with_bs() creates a BlockBackend with an empty BlockDriverState
      attached to it. Empty BDSs are not nice, therefore add an alternative
      function which combines blk_new_with_bs() with bdrv_open().
      
      Note: In contrast to bdrv_open() which takes a BlockDriver parameter,
      blk_new_open() does not take such a parameter. This is because
      bdrv_open() opens a BlockDriverState, therefore it is natural to be able
      to set the BlockDriver for that BDS. The fact that bdrv_open() can open
      more than a single BDS is merely some form of a byproduct.
      
      blk_new_open() on the other hand is intended to be used to create a
      whole tree of BlockDriverStates. Therefore, setting a single BlockDriver
      does not make much sense. Instead, the drivers to be used for each of
      the nodes must be configured through the "options" QDict; including the
      driver of the root BDS.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NKevin Wolf <kwolf@redhat.com>
      Message-id: 1423162705-32065-3-git-send-email-mreitz@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      ca49a4fd
    • M
      block: Lift some BDS functions to the BlockBackend · 1ef01253
      Max Reitz 提交于
      Create the blk_* counterparts for the following bdrv_* functions (which
      make sense to call on the BlockBackend level):
      - bdrv_co_write_zeroes()
      - bdrv_write_compressed()
      - bdrv_truncate()
      - bdrv_nb_sectors()
      - bdrv_discard()
      - bdrv_load_vmstate()
      - bdrv_save_vmstate()
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-id: 1423162705-32065-2-git-send-email-mreitz@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      1ef01253
    • J
      block: vmdk - fixed sizeof() error · a7be17be
      Jeff Cody 提交于
      The size compared should be PATH_MAX, rather than sizeof(char *).
      Reported-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 46d873261433f4527e88885582f96942d61758d6.1423592487.git.jcody@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      a7be17be
    • B
      nbd: fix the co_queue multi-adding bug · 141cabe6
      Bin Wu 提交于
      When we tested the VM migartion between different hosts with NBD
      devices, we found if we sent a cancel command after the drive_mirror
      was just started, a coroutine re-enter error would occur. The stack
      was as follow:
      
      (gdb) bt
      00)  0x00007fdfc744d885 in raise () from /lib64/libc.so.6
      01)  0x00007fdfc744ee61 in abort () from /lib64/libc.so.6
      02)  0x00007fdfca467cc5 in qemu_coroutine_enter (co=0x7fdfcaedb400, opaque=0x0)
      at qemu-coroutine.c:118
      03)  0x00007fdfca467f6c in qemu_co_queue_run_restart (co=0x7fdfcaedb400) at
      qemu-coroutine-lock.c:59
      04)  0x00007fdfca467be5 in coroutine_swap (from=0x7fdfcaf3c4e8,
      to=0x7fdfcaedb400) at qemu-coroutine.c:96
      05)  0x00007fdfca467cea in qemu_coroutine_enter (co=0x7fdfcaedb400, opaque=0x0)
      at qemu-coroutine.c:123
      06)  0x00007fdfca467f6c in qemu_co_queue_run_restart (co=0x7fdfcaedbdc0) at
      qemu-coroutine-lock.c:59
      07)  0x00007fdfca467be5 in coroutine_swap (from=0x7fdfcaf3c4e8,
      to=0x7fdfcaedbdc0) at qemu-coroutine.c:96
      08)  0x00007fdfca467cea in qemu_coroutine_enter (co=0x7fdfcaedbdc0, opaque=0x0)
      at qemu-coroutine.c:123
      09)  0x00007fdfca4a1fa4 in nbd_recv_coroutines_enter_all (s=0x7fdfcaef7dd0) at
      block/nbd-client.c:41
      10) 0x00007fdfca4a1ff9 in nbd_teardown_connection (client=0x7fdfcaef7dd0) at
      block/nbd-client.c:50
      11) 0x00007fdfca4a20f0 in nbd_reply_ready (opaque=0x7fdfcaef7dd0) at
      block/nbd-client.c:92
      12) 0x00007fdfca45ed80 in aio_dispatch (ctx=0x7fdfcae15e90) at aio-posix.c:144
      13) 0x00007fdfca45ef1b in aio_poll (ctx=0x7fdfcae15e90, blocking=false) at
      aio-posix.c:222
      14) 0x00007fdfca448c34 in aio_ctx_dispatch (source=0x7fdfcae15e90, callback=0x0,
      user_data=0x0) at async.c:212
      15) 0x00007fdfc8f2f69a in g_main_context_dispatch () from
      /usr/lib64/libglib-2.0.so.0
      16) 0x00007fdfca45c391 in glib_pollfds_poll () at main-loop.c:190
      17) 0x00007fdfca45c489 in os_host_main_loop_wait (timeout=1483677098) at
      main-loop.c:235
      18) 0x00007fdfca45c57b in main_loop_wait (nonblocking=0) at main-loop.c:484
      19) 0x00007fdfca25f403 in main_loop () at vl.c:2249
      20) 0x00007fdfca266fc2 in main (argc=42, argv=0x7ffff517d638,
      envp=0x7ffff517d790) at vl.c:4814
      
      We find the nbd_recv_coroutines_enter_all function (triggered by a cancel
      command or a network connection breaking down) will enter a coroutine which
      is waiting for the sending lock. If the lock is still held by another coroutine,
      the entering coroutine will be added into the co_queue again. Latter, when the
      lock is released, a coroutine re-enter error will occur.
      
      This bug can be fixed simply by delaying the setting of recv_coroutine as
      suggested by paolo. After applying this patch, we have tested the cancel
      operation in mirror phase looply for more than 5 hous and everything is fine.
      Without this patch, a coroutine re-enter error will occur in 5 minutes.
      Signed-off-by: NBn Wu <wu.wubin@huawei.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 1423552846-3896-1-git-send-email-wu.wubin@huawei.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      141cabe6
    • M
      nbd: Drop BDS backpointer · f53a829b
      Max Reitz 提交于
      Before this patch, the "opaque" pointer in an NBD BDS points to a
      BDRVNBDState, which contains an NbdClientSession object, which in turn
      contains a pointer to the BDS. This pointer may become invalid due to
      bdrv_swap(), so drop it, and instead pass the BDS directly to the
      nbd-client.c functions which then retrieve the NbdClientSession object
      from there.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 1423256778-3340-2-git-send-email-mreitz@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      f53a829b
  4. 07 2月, 2015 29 次提交