diff options
| author | Eric Blake <eblake@redhat.com> | 2017-07-07 15:30:41 -0500 |
|---|---|---|
| committer | Paolo Bonzini <pbonzini@redhat.com> | 2017-07-14 12:04:41 +0200 |
| commit | 004a89fce9b5ec1b027bf4d104d83aa682db7b7a (patch) | |
| tree | 6b1858ce16afdb75b0c96bb118ae79a4cc4d2e40 /qemu-nbd.c | |
| parent | 1221a4746769f70231beab4db8da1c937e60340c (diff) | |
| download | focaccia-qemu-004a89fce9b5ec1b027bf4d104d83aa682db7b7a.tar.gz focaccia-qemu-004a89fce9b5ec1b027bf4d104d83aa682db7b7a.zip | |
nbd: Create struct for tracking export info
The NBD Protocol is introducing some additional information about exports, such as minimum request size and alignment, as well as an advertised maximum request size. It will be easier to feed this information back to the block layer if we gather all the information into a struct, rather than adding yet more pointer parameters during negotiation. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20170707203049.534-2-eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to '')
| -rw-r--r-- | qemu-nbd.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/qemu-nbd.c b/qemu-nbd.c index 4dd3fd4732..c8bd47fe77 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -255,8 +255,7 @@ static void *show_parts(void *arg) static void *nbd_client_thread(void *arg) { char *device = arg; - off_t size; - uint16_t nbdflags; + NBDExportInfo info; QIOChannelSocket *sioc; int fd; int ret; @@ -271,9 +270,8 @@ static void *nbd_client_thread(void *arg) goto out; } - ret = nbd_receive_negotiate(QIO_CHANNEL(sioc), NULL, &nbdflags, - NULL, NULL, NULL, - &size, &local_error); + ret = nbd_receive_negotiate(QIO_CHANNEL(sioc), NULL, + NULL, NULL, NULL, &info, &local_error); if (ret < 0) { if (local_error) { error_report_err(local_error); @@ -288,7 +286,7 @@ static void *nbd_client_thread(void *arg) goto out_socket; } - ret = nbd_init(fd, sioc, nbdflags, size, &local_error); + ret = nbd_init(fd, sioc, &info, &local_error); if (ret < 0) { error_report_err(local_error); goto out_fd; |