1. 30 3月, 2016 1 次提交
    • K
      nbd: Support BDRV_REQ_FUA · 2b556518
      Kevin Wolf 提交于
      The NBD server already used to send a FUA flag when the writethrough
      mode was set. This code was a remnant from the times where protocol
      drivers actually had to implement writethrough modes. Since nowadays the
      block layer sends flushes in writethrough mode and non-root nodes are
      always writeback, this was mostly dead code - only mostly because if NBD
      was configured to be used without a format, we sent _both_ FUA and an
      explicit flush afterwards, which makes the code not technically dead,
      but useless overhead.
      
      This patch changes the code so that the block layer's FUA flag is
      recognised and translated into a NBD FUA flag. The additional flush is
      avoided now.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      2b556518
  2. 17 2月, 2016 2 次提交
    • D
      nbd: enable use of TLS with NBD block driver · 75822a12
      Daniel P. Berrange 提交于
      This modifies the NBD driver so that it is possible to request
      use of TLS. This is done by providing the 'tls-creds' parameter
      with the ID of a previously created QCryptoTLSCreds object.
      
      For example
      
        $QEMU -object tls-creds-x509,id=tls0,endpoint=client,\
                      dir=/home/berrange/security/qemutls \
              -drive driver=nbd,host=localhost,port=9000,tls-creds=tls0
      
      The client will drop the connection if the NBD server does not
      provide TLS.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1455129674-17255-15-git-send-email-berrange@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      75822a12
    • D
      nbd: convert block client to use I/O channels for connection setup · 064097d9
      Daniel P. Berrange 提交于
      This converts the NBD block driver client to use the QIOChannelSocket
      class for initial connection setup. The NbdClientSession struct has
      two pointers, one to the master QIOChannelSocket providing the raw
      data channel, and one to a QIOChannel which is the current channel
      used for I/O. Initially the two point to the same object, but when
      TLS support is added, they will point to different objects.
      
      The qemu-img & qemu-io tools now need to use MODULE_INIT_QOM to
      ensure the QIOChannel object classes are registered. The qemu-nbd
      tool already did this.
      
      In this initial conversion though, all I/O is still actually done
      using the raw POSIX sockets APIs.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1455129674-17255-4-git-send-email-berrange@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      064097d9
  3. 18 3月, 2015 1 次提交
  4. 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
  5. 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
  6. 04 6月, 2014 1 次提交
  7. 16 12月, 2013 2 次提交