1. 17 2月, 2016 5 次提交
    • D
      nbd: implement TLS support in the protocol negotiation · f95910fe
      Daniel P. Berrange 提交于
      This extends the NBD protocol handling code so that it is capable
      of negotiating TLS support during the connection setup. This involves
      requesting the STARTTLS protocol option before any other NBD options.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1455129674-17255-14-git-send-email-berrange@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      f95910fe
    • D
      nbd: use "" as a default export name if none provided · 69b49502
      Daniel P. Berrange 提交于
      If the user does not provide an export name and the server
      is running the new style protocol, where export names are
      mandatory, use "" as the default export name if the user
      has not specified any. "" is defined in the NBD protocol
      as the default name to use in such scenarios.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1455129674-17255-13-git-send-email-berrange@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      69b49502
    • D
      nbd: always query export list in fixed new style protocol · 9344e5f5
      Daniel P. Berrange 提交于
      With the new style protocol, the NBD client will currenetly
      send NBD_OPT_EXPORT_NAME as the first (and indeed only)
      option it wants. The problem is that the NBD protocol spec
      does not allow for returning an error message with the
      NBD_OPT_EXPORT_NAME option. So if the server mandates use
      of TLS, the client will simply see an immediate connection
      close after issuing NBD_OPT_EXPORT_NAME which is not user
      friendly.
      
      To improve this situation, if we have the fixed new style
      protocol, we can sent NBD_OPT_LIST as the first option
      to query the list of server exports. We can check for our
      named export in this list and raise an error if it is not
      found, instead of going ahead and sending NBD_OPT_EXPORT_NAME
      with a name that we know will be rejected.
      
      This improves the error reporting both in the case that the
      server required TLS, and in the case that the client requested
      export name does not exist on the server.
      
      If the server does not support NBD_OPT_LIST, we just ignore
      that and carry on with NBD_OPT_EXPORT_NAME as before.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1455129674-17255-12-git-send-email-berrange@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      9344e5f5
    • D
      nbd: make server compliant with fixed newstyle spec · 26afa868
      Daniel P. Berrange 提交于
      If the client does not request the fixed new style protocol,
      then we should only accept NBD_OPT_EXPORT_NAME. All other
      options are only valid when fixed new style has been activated.
      
      The qemu-nbd client doesn't currently request fixed new style
      protocol, but this change won't break qemu-nbd, because it
      fortunately only ever uses NBD_OPT_EXPORT_NAME, so was never
      triggering the non-compliant server behaviour.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1455129674-17255-9-git-send-email-berrange@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      26afa868
    • D
      nbd: convert to using I/O channels for actual socket I/O · 1c778ef7
      Daniel P. Berrange 提交于
      Now that all callers are converted to use I/O channels for
      initial connection setup, it is possible to switch the core
      NBD protocol handling core over to use QIOChannel APIs for
      actual sockets I/O.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1455129674-17255-7-git-send-email-berrange@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      1c778ef7
  2. 09 2月, 2016 1 次提交
  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 2 次提交
  5. 26 1月, 2016 1 次提交
  6. 20 1月, 2016 1 次提交
    • K
      block: Rename BDRV_O_INCOMING to BDRV_O_INACTIVE · 04c01a5c
      Kevin Wolf 提交于
      Instead of covering only the state of images on the migration
      destination before the migration is completed, the flag will also cover
      the state of images on the migration source after completion. This
      common state implies that the image is technically still open, but no
      writes will happen and any cached contents will be reloaded from disk if
      and when the image leaves this state.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      04c01a5c
  7. 16 1月, 2016 5 次提交
  8. 24 10月, 2015 2 次提交
  9. 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
  10. 13 10月, 2015 1 次提交
  11. 16 9月, 2015 1 次提交
  12. 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
  13. 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
  14. 18 3月, 2015 7 次提交
  15. 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
  16. 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
  17. 10 12月, 2014 2 次提交
  18. 14 10月, 2014 1 次提交
  19. 29 8月, 2014 3 次提交
  20. 30 6月, 2014 2 次提交