Commit cdc88453 authored by Kevin Wolf's avatar Kevin Wolf
Browse files

Merge remote-tracking branch 'mreitz/tags/pull-block-for-kevin-2016-04-15' into queue-block



Block patches for 2.6.0-rc3.

# gpg: Signature made Fri Apr 15 17:57:30 2016 CEST using RSA key ID E838ACAD
# gpg: Good signature from "Max Reitz <mreitz@redhat.com>"

* mreitz/tags/pull-block-for-kevin-2016-04-15:
  nbd: Don't kill server on client that doesn't request TLS
  nbd: fix assert() on qemu-nbd stop
  nbd: Don't fail handshake on NBD_OPT_LIST descriptions
  qemu-iotests: 041: More robust assertion on quorum node
  qemu-iotests: place valgrind log file in scratch dir
  qemu-iotests: tests: do not set unused tmp variable
  qemu-iotests: common.rc: drop unused _do()
  qemu-iotests: drop unused _within_tolerance() filter

Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
parents 90c647db d1129a8a
Loading
Loading
Loading
Loading
+21 −2
Original line number Diff line number Diff line
@@ -192,13 +192,18 @@ static int nbd_receive_list(QIOChannel *ioc, char **name, Error **errp)
            return -1;
        }
    } else if (type == NBD_REP_SERVER) {
        if (len < sizeof(namelen) || len > NBD_MAX_BUFFER_SIZE) {
            error_setg(errp, "incorrect option length");
            return -1;
        }
        if (read_sync(ioc, &namelen, sizeof(namelen)) != sizeof(namelen)) {
            error_setg(errp, "failed to read option name length");
            return -1;
        }
        namelen = be32_to_cpu(namelen);
        if (len != (namelen + sizeof(namelen))) {
            error_setg(errp, "incorrect option mame length");
        len -= sizeof(namelen);
        if (len < namelen) {
            error_setg(errp, "incorrect option name length");
            return -1;
        }
        if (namelen > 255) {
@@ -214,6 +219,20 @@ static int nbd_receive_list(QIOChannel *ioc, char **name, Error **errp)
            return -1;
        }
        (*name)[namelen] = '\0';
        len -= namelen;
        if (len) {
            char *buf = g_malloc(len + 1);
            if (read_sync(ioc, buf, len) != len) {
                error_setg(errp, "failed to read export description");
                g_free(*name);
                g_free(buf);
                *name = NULL;
                return -1;
            }
            buf[len] = '\0';
            TRACE("Ignoring export description: %s", buf);
            g_free(buf);
        }
    } else {
        error_setg(errp, "Unexpected reply type %x expected %x",
                   type, NBD_REP_SERVER);
+13 −2
Original line number Diff line number Diff line
@@ -449,11 +449,19 @@ static int nbd_negotiate_options(NBDClient *client)
                client->ioc = QIO_CHANNEL(tioc);
                break;

            case NBD_OPT_EXPORT_NAME:
                /* No way to return an error to client, so drop connection */
                TRACE("Option 0x%x not permitted before TLS", clientflags);
                return -EINVAL;

            default:
                TRACE("Option 0x%x not permitted before TLS", clientflags);
                if (nbd_negotiate_drop_sync(client->ioc, length) != length) {
                    return -EIO;
                }
                nbd_negotiate_send_rep(client->ioc, NBD_REP_ERR_TLS_REQD,
                                       clientflags);
                return -EINVAL;
                break;
            }
        } else if (fixedNewstyle) {
            switch (clientflags) {
@@ -471,6 +479,9 @@ static int nbd_negotiate_options(NBDClient *client)
                return nbd_negotiate_handle_export_name(client, length);

            case NBD_OPT_STARTTLS:
                if (nbd_negotiate_drop_sync(client->ioc, length) != length) {
                    return -EIO;
                }
                if (client->tlscreds) {
                    TRACE("TLS already enabled");
                    nbd_negotiate_send_rep(client->ioc, NBD_REP_ERR_INVALID,
@@ -480,7 +491,7 @@ static int nbd_negotiate_options(NBDClient *client)
                    nbd_negotiate_send_rep(client->ioc, NBD_REP_ERR_POLICY,
                                           clientflags);
                }
                return -EINVAL;
                break;
            default:
                TRACE("Unsupported option 0x%x", clientflags);
                if (nbd_negotiate_drop_sync(client->ioc, length) != length) {
+1 −1
Original line number Diff line number Diff line
@@ -215,7 +215,7 @@ static int find_partition(BlockBackend *blk, int partition,

static void termsig_handler(int signum)
{
    state = TERMINATE;
    atomic_cmpxchg(&state, RUNNING, TERMINATE);
    qemu_notify_event();
}

+0 −1
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"

here=`pwd`
tmp=/tmp/$$
status=1	# failure is the default!

_cleanup()
+0 −1
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"

here=`pwd`
tmp=/tmp/$$
status=1	# failure is the default!

_cleanup()
Loading