diff options
author | Eric Blake <eblake@redhat.com> | 2016-10-14 13:33:03 -0500 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-11-02 09:28:55 +0100 |
commit | b1a75b3348010820cc324943f09e090ea1fc524f (patch) | |
tree | 9d2cbc6c435e638dca9a05d0df62bd8ecd528c0f /nbd/nbd-internal.h | |
parent | 1775f111eaf7f49efcec30152db44a184c1e2222 (diff) |
nbd: Add qemu-nbd -D for human-readable description
The NBD protocol allows servers to advertise a human-readable
description alongside an export name during NBD_OPT_LIST. Add
an option to pass through the user's string to the NBD client.
Doing this also makes it easier to test commit 200650d4, which
is the client counterpart of receiving the description.
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1476469998-28592-2-git-send-email-eblake@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'nbd/nbd-internal.h')
-rw-r--r-- | nbd/nbd-internal.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/nbd/nbd-internal.h b/nbd/nbd-internal.h index 93a6ca8549..7e78064021 100644 --- a/nbd/nbd-internal.h +++ b/nbd/nbd-internal.h @@ -104,9 +104,10 @@ static inline ssize_t read_sync(QIOChannel *ioc, void *buffer, size_t size) return nbd_wr_syncv(ioc, &iov, 1, size, true); } -static inline ssize_t write_sync(QIOChannel *ioc, void *buffer, size_t size) +static inline ssize_t write_sync(QIOChannel *ioc, const void *buffer, + size_t size) { - struct iovec iov = { .iov_base = buffer, .iov_len = size }; + struct iovec iov = { .iov_base = (void *) buffer, .iov_len = size }; return nbd_wr_syncv(ioc, &iov, 1, size, false); } |