1. 16 1月, 2016 2 次提交
    • F
      nbd: Split nbd.c · 798bfe00
      Fam Zheng 提交于
      We have NBD server code and client code, all mixed in a file. Now split
      them into separate files under nbd/, and update MAINTAINERS.
      
      filter_nbd for iotest 083 is updated to keep the log filtered out.
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Message-Id: <1452760863-25350-3-git-send-email-famz@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      798bfe00
    • 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
  2. 24 10月, 2015 2 次提交
  3. 20 10月, 2015 1 次提交
    • D
      coroutine: move into libqemuutil.a library · 10817bf0
      Daniel P. Berrange 提交于
      The coroutine files are currently referenced by the block-obj-y
      variable. The coroutine functionality though is already used by
      more than just the block code. eg migration code uses coroutine
      yield. In the future the I/O channel code will also use the
      coroutine yield functionality. Since the coroutine code is nicely
      self-contained it can be easily built as part of the libqemuutil.a
      library, making it widely available.
      
      The headers are also moved into include/qemu, instead of the
      include/block directory, since they are now part of the util
      codebase, and the impl was never in the block/ directory
      either.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      10817bf0
  4. 13 10月, 2015 1 次提交
  5. 16 9月, 2015 1 次提交
  6. 08 5月, 2015 1 次提交
    • P
      qemu-nbd: only send a limited number of errno codes on the wire · ca441480
      Paolo Bonzini 提交于
      Right now, NBD includes potentially platform-specific error values in
      the wire protocol.
      
      Luckily, most common error values are more or less universal: in
      particular, of all errno values <= 34 (up to ERANGE), they are all the
      same on supported platforms except for 11 (which is EAGAIN on Windows and
      Linux, but EDEADLK on Darwin and the *BSDs).  So, in order to guarantee
      some portability, only keep a handful of possible error codes and squash
      everything else to EINVAL.
      
      This patch defines a limited set of errno values that are valid for the
      NBD protocol, and specifies recommendations for what error to return
      in specific corner cases.  The set of errno values is roughly based on
      the errors listed in the read(2) and write(2) man pages, with some
      exceptions:
      
      - ENOMEM is added for servers that implement copy-on-write or other
        formats that require dynamic allocation.
      
      - EDQUOT is not part of the universal set of errors; it can be changed
        to ENOSPC on the wire format.
      
      - EFBIG is part of the universal set of errors, but it is also changed
        to ENOSPC because it is pretty similar to ENOSPC or EDQUOT.
      
      Incoming values will in general match system errno values, but not
      on the Hurd which has different errno values (they have a "subsystem
      code" equal to 0x10 in bits 24-31).  The Hurd is probably not something
      to which QEMU has been ported, but still do the right thing and
      reverse-map the NBD errno values to the system errno values.
      
      The corresponding patch to the NBD protocol description can be found at
      http://article.gmane.org/gmane.linux.drivers.nbd.general/3154.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      ca441480
  7. 29 4月, 2015 1 次提交
    • B
      nbd/trivial: fix type cast for ioctl · d064d9f3
      Bogdan Purcareata 提交于
      This fixes ioctl behavior on powerpc e6500 platforms with 64bit kernel and 32bit
      userspace. The current type cast has no effect there and the value passed to the
      kernel is still 0. Probably an issue related to the compiler, since I'm assuming
      the same configuration works on a similar setup on x86.
      
      Also ensure consistency with previous type cast in TRACE message.
      Signed-off-by: NBogdan Purcareata <bogdan.purcareata@freescale.com>
      Message-Id: <1428058914-32050-1-git-send-email-bogdan.purcareata@freescale.com>
      Cc: qemu-stable@nongnu.org
      [Fix parens as noticed by Michael. - Paolo]
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      d064d9f3
  8. 18 3月, 2015 7 次提交
  9. 16 2月, 2015 1 次提交
    • 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
  10. 07 2月, 2015 1 次提交
    • M
      nbd: Improve error messages · 1ce52846
      Max Reitz 提交于
      This patch makes use of the Error object for nbd_receive_negotiate() so
      that errors during negotiation look nicer.
      
      Furthermore, this patch adds an additional error message if the received
      magic was wrong, but would be correct for the other protocol version,
      respectively: So if an export name was specified, but the NBD server
      magic corresponds to an old handshake, this condition is explicitly
      signaled to the user, and vice versa.
      
      As these messages are now part of the "Could not open image" error
      message, additional filtering has to be employed in iotest 083, which
      this patch does as well.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      1ce52846
  11. 10 12月, 2014 2 次提交
  12. 14 10月, 2014 1 次提交
  13. 29 8月, 2014 3 次提交
  14. 30 6月, 2014 2 次提交
  15. 27 6月, 2014 1 次提交
    • H
      nbd: Don't validate from and len in NBD_CMD_DISC. · 8c5d1abb
      Hani Benhabiles 提交于
      These values aren't used in this case.
      
      Currently, the from field in the request sent by the nbd kernel module leading
      to a false error message when ending the connection with the client.
      
      $ qemu-nbd some.img -v
      // After nbd-client -d /dev/nbd0
      nbd.c:nbd_trip():L1031: From: 18446744073709551104, Len: 0, Size: 20971520,
      Offset: 0
      nbd.c:nbd_trip():L1032: requested operation past EOF--bad client?
      nbd.c:nbd_receive_request():L638: read failed
      Signed-off-by: NHani Benhabiles <kroosec@gmail.com>
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      8c5d1abb
  16. 24 5月, 2014 1 次提交
  17. 22 2月, 2014 3 次提交
  18. 16 12月, 2013 1 次提交
  19. 06 9月, 2013 1 次提交
  20. 23 8月, 2013 1 次提交
  21. 03 5月, 2013 2 次提交
    • S
      nbd: support large NBD requests · 2d821488
      Stefan Hajnoczi 提交于
      The Linux nbd driver recently increased the maximum supported request
      size up to 32 MB:
      
        commit 078be02b80359a541928c899c2631f39628f56df
        Author: Michal Belczyk <belczyk@bsd.krakow.pl>
        Date:   Tue Apr 30 15:28:28 2013 -0700
      
            nbd: increase default and max request sizes
      
            Raise the default max request size for nbd to 128KB (from 127KB) to get it
            4KB aligned.  This patch also allows the max request size to be increased
            (via /sys/block/nbd<x>/queue/max_sectors_kb) to 32MB.
      
      QEMU's 1 MB buffers are too small to handle these requests.
      
      This patch allocates data buffers dynamically and allows up to 32 MB per
      request.
      Reported-by: NNick Thomas <nick@bytemark.co.uk>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      2d821488
    • S
      nbd: use g_slice_new() instead of a freelist · e1adb27a
      Stefan Hajnoczi 提交于
      Use GLib's efficient slice allocator instead of open-coding the request
      freelist.  This patch simplifies the NBDRequest code.
      
      Now we qemu_blockalign() the req->data buffer each time but the next
      patch switches from a fixed size buffer to a dynamic size anyway.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      e1adb27a
  22. 02 4月, 2013 1 次提交
  23. 23 3月, 2013 2 次提交
  24. 19 12月, 2012 1 次提交