Skip to content
Snippets Groups Projects
  1. Apr 03, 2017
  2. Jan 31, 2017
  3. Oct 27, 2016
  4. Sep 05, 2016
    • Kevin Wolf's avatar
      nbd-server: Allow node name for nbd-server-add · 094138d0
      Kevin Wolf authored
      
      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: default avatarKevin Wolf <kwolf@redhat.com>
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      094138d0
    • Kevin Wolf's avatar
      nbd-server: Use a separate BlockBackend · cd7fca95
      Kevin Wolf authored
      
      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: default avatarKevin Wolf <kwolf@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      cd7fca95
  5. Feb 16, 2016
  6. Feb 04, 2016
    • Peter Maydell's avatar
      all: Clean up includes · d38ea87a
      Peter Maydell authored
      
      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: default avatarPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1454089805-5470-16-git-send-email-peter.maydell@linaro.org
      d38ea87a
  7. Feb 02, 2016
  8. Jan 15, 2016
    • Fam Zheng's avatar
      nbd: Always call "close_fn" in nbd_client_new · ee7d7aab
      Fam Zheng authored
      
      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: default avatarFam Zheng <famz@redhat.com>
      Message-Id: <1452760863-25350-2-git-send-email-famz@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      ee7d7aab
  9. Jun 22, 2015
  10. Jun 12, 2015
  11. Mar 25, 2015
  12. Mar 18, 2015
  13. Dec 10, 2014
  14. Aug 20, 2014
    • Markus Armbruster's avatar
      block: Use g_new() & friends where that makes obvious sense · 5839e53b
      Markus Armbruster authored
      
      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: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      Reviewed-by: default avatarJeff Cody <jcody@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      5839e53b
  15. Jun 30, 2014
  16. Jun 27, 2014
    • Hani Benhabiles's avatar
      nbd: Don't export a block device with no medium. · 60fe4fac
      Hani Benhabiles authored
      
      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: default avatarHani Benhabiles <kroosec@gmail.com>
      Cc: qemu-stable@nongnu.org
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      60fe4fac
  17. May 23, 2014
  18. Sep 06, 2013
  19. Apr 08, 2013
    • Paolo Bonzini's avatar
      hw: move headers to include/ · 0d09e41a
      Paolo Bonzini authored
      
      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: default avatarPaolo Bonzini <pbonzini@redhat.com>
      0d09e41a
  20. Dec 19, 2012
  21. Nov 28, 2012
  22. Nov 12, 2012
  23. Oct 23, 2012
Loading