Commit 393aac16 authored by Peter Maydell's avatar Peter Maydell
Browse files

Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2018-11-19' into staging



nbd patches for 2018-11-19

Add iotest coverage for NBD connections using TLS, including
a couple of code fixes that it pointed out

- Mao Zhongyi: 0/3 Do some cleaning work in qemu-iotests
- Daniel P. Berrangé: io: return 0 for EOF in TLS session read after shutdown
- Daniel P. Berrangé: 0/6 Misc fixes to NBD
- Eric Blake: iotests: Drop use of bash keyword 'function'

# gpg: Signature made Mon 19 Nov 2018 17:43:32 GMT
# gpg:                using RSA key A7A16B4A2527436A
# gpg: Good signature from "Eric Blake <eblake@redhat.com>"
# gpg:                 aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>"
# gpg:                 aka "[jpeg image of size 6874]"
# Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2  F3AA A7A1 6B4A 2527 436A

* remotes/ericb/tags/pull-nbd-2018-11-19:
  iotests: Drop use of bash keyword 'function'
  iotests: Also test I/O over NBD TLS
  tests: exercise NBD server in TLS mode
  tests: add iotests helpers for dealing with TLS certificates
  tests: check if qemu-nbd is still alive before waiting
  tests: pull qemu-nbd iotest helpers into common.nbd file
  io: return 0 for EOF in TLS session read after shutdown
  nbd/server: Ignore write errors when replying to NBD_OPT_ABORT
  nbd: fix whitespace in server error message
  qemu-iotests: Modern shell scripting (use $() instead of ``)
  qemu-iotests: convert `pwd` and $(pwd) to $PWD
  qemu-iotests: remove unused variable 'here'

Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parents d304cf01 8cedcffd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -878,7 +878,7 @@ Linux)
  vhost_crypto="yes"
  vhost_scsi="yes"
  vhost_vsock="yes"
  QEMU_INCLUDES="-I\$(SRC_PATH)/linux-headers -I$(pwd)/linux-headers $QEMU_INCLUDES"
  QEMU_INCLUDES="-I\$(SRC_PATH)/linux-headers -I$PWD/linux-headers $QEMU_INCLUDES"
  supported_os="yes"
  libudev="yes"
;;
+3 −0
Original line number Diff line number Diff line
@@ -473,6 +473,9 @@ qcrypto_tls_session_read(QCryptoTLSSession *session,
        case GNUTLS_E_INTERRUPTED:
            errno = EINTR;
            break;
        case GNUTLS_E_PREMATURE_TERMINATION:
            errno = ECONNABORTED;
            break;
        default:
            errno = EIO;
            break;
+1 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ struct QIOChannelTLS {
    QIOChannel parent;
    QIOChannel *master;
    QCryptoTLSSession *session;
    QIOChannelShutdown shutdown;
};

/**
+3 −3
Original line number Diff line number Diff line
@@ -51,9 +51,9 @@ enum QIOChannelFeature {
typedef enum QIOChannelShutdown QIOChannelShutdown;

enum QIOChannelShutdown {
    QIO_CHANNEL_SHUTDOWN_BOTH,
    QIO_CHANNEL_SHUTDOWN_READ,
    QIO_CHANNEL_SHUTDOWN_WRITE,
    QIO_CHANNEL_SHUTDOWN_READ = 1,
    QIO_CHANNEL_SHUTDOWN_WRITE = 2,
    QIO_CHANNEL_SHUTDOWN_BOTH = 3,
};

typedef gboolean (*QIOChannelFunc)(QIOChannel *ioc,
+5 −0
Original line number Diff line number Diff line
@@ -275,6 +275,9 @@ static ssize_t qio_channel_tls_readv(QIOChannel *ioc,
                } else {
                    return QIO_CHANNEL_ERR_BLOCK;
                }
            } else if (errno == ECONNABORTED &&
                       (tioc->shutdown & QIO_CHANNEL_SHUTDOWN_READ)) {
                return 0;
            }

            error_setg_errno(errp, errno,
@@ -357,6 +360,8 @@ static int qio_channel_tls_shutdown(QIOChannel *ioc,
{
    QIOChannelTLS *tioc = QIO_CHANNEL_TLS(ioc);

    tioc->shutdown |= how;

    return qio_channel_shutdown(tioc->master, how, errp);
}

Loading