diff options
author | Max Reitz <mreitz@redhat.com> | 2016-01-25 19:41:08 +0100 |
---|---|---|
committer | Timothy Pearson <tpearson@raptorengineering.com> | 2019-11-29 19:30:22 -0600 |
commit | bc6e8255c60ee8283919a3c87722cfb9e59de08f (patch) | |
tree | c1cd7abfc5ae2cf02582430301bee00e0f426486 /nbd/server.c | |
parent | 58493fc6667b0de71ba90be6c790346ab18a7daa (diff) | |
download | hqemu-bc6e8255c60ee8283919a3c87722cfb9e59de08f.zip hqemu-bc6e8255c60ee8283919a3c87722cfb9e59de08f.tar.gz |
nbd: client_close on error in nbd_co_client_start
Use client_close() if an error in nbd_co_client_start() occurs instead
of manually inlining parts of it. This fixes an assertion error on the
server side if nbd_negotiate() fails.
Signed-off-by: Max Reitz <mreitz@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'nbd/server.c')
-rw-r--r-- | nbd/server.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/nbd/server.c b/nbd/server.c index 256feaf..7fa7f53 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -1082,8 +1082,7 @@ static coroutine_fn void nbd_co_client_start(void *opaque) nbd_export_get(exp); } if (nbd_negotiate(data)) { - shutdown(client->sock, 2); - client->close(client); + client_close(client); goto out; } qemu_co_mutex_init(&client->send_lock); |