Commit 264ac41c authored by Anthony Liguori's avatar Anthony Liguori
Browse files

Merge remote-tracking branch 'bonzini/nbd-next' into staging



* bonzini/nbd-next:
  nbd-server-add: Fix the default for 'writable'
  nbd: fix use of two uninitialized bytes when connecting to a named export

Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
parents e6451fd3 f3313d23
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -99,7 +99,7 @@ void qmp_nbd_server_add(const char *device, bool has_writable, bool writable,
    }

    if (!has_writable) {
        writable = true;
        writable = false;
    }
    if (bdrv_is_read_only(bs)) {
        writable = false;
+1 −1
Original line number Diff line number Diff line
@@ -397,6 +397,7 @@ static int nbd_send_negotiate(NBDClient *client)
    rc = -EINVAL;

    TRACE("Beginning negotiation.");
    memset(buf, 0, sizeof(buf));
    memcpy(buf, "NBDMAGIC", 8);
    if (client->exp) {
        assert ((client->exp->nbdflags & ~65535) == 0);
@@ -406,7 +407,6 @@ static int nbd_send_negotiate(NBDClient *client)
    } else {
        cpu_to_be64w((uint64_t*)(buf + 8), NBD_OPTS_MAGIC);
    }
    memset(buf + 28, 0, 124);

    if (client->exp) {
        if (write_sync(csock, buf, sizeof(buf)) != sizeof(buf)) {