1. 06 9月, 2016 2 次提交
    • K
      nbd-server: Allow node name for nbd-server-add · 094138d0
      Kevin Wolf 提交于
      There is no reason why an NBD server couldn't be started for any node,
      even if it's not on the top level. This converts nbd-server-add to
      accept a node-name.
      
      Note that there is a semantic difference between using a BlockBackend
      name and the node name of its root: In the former case, the NBD server
      is closed on eject; in the latter case, the NBD server doesn't drop its
      reference and keeps the image file open this way.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      094138d0
    • K
      nbd-server: Use a separate BlockBackend · cd7fca95
      Kevin Wolf 提交于
      The builtin NBD server uses its own BlockBackend now instead of reusing
      the monitor/guest device one.
      
      This means that it has its own writethrough setting now. The builtin
      NBD server always uses writeback caching now regardless of whether the
      guest device has WCE enabled. qemu-nbd respects the cache mode given on
      the command line.
      
      We still need to keep a reference to the monitor BB because we put an
      eject notifier on it, but we don't use it for any I/O.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      cd7fca95
  2. 17 2月, 2016 4 次提交
  3. 05 2月, 2016 1 次提交
    • P
      all: Clean up includes · d38ea87a
      Peter Maydell 提交于
      Clean up includes so that osdep.h is included first and headers
      which it implies are not included manually.
      
      This commit was created with scripts/clean-includes.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1454089805-5470-16-git-send-email-peter.maydell@linaro.org
      d38ea87a
  4. 03 2月, 2016 1 次提交
  5. 16 1月, 2016 1 次提交
    • F
      nbd: Always call "close_fn" in nbd_client_new · ee7d7aab
      Fam Zheng 提交于
      Rename the parameter "close" to "close_fn" to disambiguous with
      close(2).
      
      This unifies error handling paths of NBDClient allocation:
      nbd_client_new will shutdown the socket and call the "close_fn" callback
      if negotiation failed, so the caller don't need a different path than
      the normal close.
      
      The returned pointer is never used, make it void in preparation for the
      next patch.
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Message-Id: <1452760863-25350-2-git-send-email-famz@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      ee7d7aab
  6. 23 6月, 2015 3 次提交
  7. 12 6月, 2015 1 次提交
  8. 25 3月, 2015 1 次提交
  9. 18 3月, 2015 1 次提交
  10. 10 12月, 2014 1 次提交
  11. 20 8月, 2014 1 次提交
    • M
      block: Use g_new() & friends where that makes obvious sense · 5839e53b
      Markus Armbruster 提交于
      g_new(T, n) is neater than g_malloc(sizeof(T) * n).  It's also safer,
      for two reasons.  One, it catches multiplication overflowing size_t.
      Two, it returns T * rather than void *, which lets the compiler catch
      more type errors.
      
      Patch created with Coccinelle, with two manual changes on top:
      
      * Add const to bdrv_iterate_format() to keep the types straight
      
      * Convert the allocation in bdrv_drop_intermediate(), which Coccinelle
        inexplicably misses
      
      Coccinelle semantic patch:
      
          @@
          type T;
          @@
          -g_malloc(sizeof(T))
          +g_new(T, 1)
          @@
          type T;
          @@
          -g_try_malloc(sizeof(T))
          +g_try_new(T, 1)
          @@
          type T;
          @@
          -g_malloc0(sizeof(T))
          +g_new0(T, 1)
          @@
          type T;
          @@
          -g_try_malloc0(sizeof(T))
          +g_try_new0(T, 1)
          @@
          type T;
          expression n;
          @@
          -g_malloc(sizeof(T) * (n))
          +g_new(T, n)
          @@
          type T;
          expression n;
          @@
          -g_try_malloc(sizeof(T) * (n))
          +g_try_new(T, n)
          @@
          type T;
          expression n;
          @@
          -g_malloc0(sizeof(T) * (n))
          +g_new0(T, n)
          @@
          type T;
          expression n;
          @@
          -g_try_malloc0(sizeof(T) * (n))
          +g_try_new0(T, n)
          @@
          type T;
          expression p, n;
          @@
          -g_realloc(p, sizeof(T) * (n))
          +g_renew(T, p, n)
          @@
          type T;
          expression p, n;
          @@
          -g_try_realloc(p, sizeof(T) * (n))
          +g_try_renew(T, p, n)
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      5839e53b
  12. 30 6月, 2014 1 次提交
  13. 27 6月, 2014 1 次提交
    • H
      nbd: Don't export a block device with no medium. · 60fe4fac
      Hani Benhabiles 提交于
      The device is exported with erroneous values and can't be read.
      
      Before the patch:
      $ sudo nbd-client localhost -p 10809 /dev/nbd0 -name floppy0
      Negotiation: ..size = 17592186044415MB
      bs=1024, sz=18446744073709547520 bytes
      
      $ sudo mount /dev/nbd0 /mnt/tmp/
      mount: block device /dev/nbd0 is write-protected, mounting read-only
      mount: /dev/nbd0: can't read superblock
      
      After the patch:
      (qemu) nbd_server_add ide0-hd0
      (qemu) nbd_server_add floppy0
      Device 'floppy0' has no medium
      Signed-off-by: NHani Benhabiles <kroosec@gmail.com>
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      60fe4fac
  14. 24 5月, 2014 1 次提交
  15. 06 9月, 2013 1 次提交
  16. 09 4月, 2013 1 次提交
    • P
      hw: move headers to include/ · 0d09e41a
      Paolo Bonzini 提交于
      Many of these should be cleaned up with proper qdev-/QOM-ification.
      Right now there are many catch-all headers in include/hw/ARCH depending
      on cpu.h, and this makes it necessary to compile these files per-target.
      However, fixing this does not belong in these patches.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      0d09e41a
  17. 19 12月, 2012 5 次提交
  18. 28 11月, 2012 1 次提交
  19. 12 11月, 2012 3 次提交
  20. 24 10月, 2012 1 次提交