mirror of https://github.com/proxmox/mirror_qemu
nbd: Pass return value from nbd_handle_list()
While it does not make a difference in practice, nbd_receive_options() generally returns -errno, so it should do that here as well; and the easiest way to achieve this is by passing on the value returned by nbd_handle_list(). Signed-off-by: Max Reitz <mreitz@redhat.com> Message-Id: <1424887718-10800-7-git-send-email-mreitz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>master
parent
2b1f13b996
commit
892f5a5270
7
nbd.c
7
nbd.c
|
@ -351,7 +351,7 @@ fail:
|
||||||
static int nbd_receive_options(NBDClient *client)
|
static int nbd_receive_options(NBDClient *client)
|
||||||
{
|
{
|
||||||
while (1) {
|
while (1) {
|
||||||
int csock = client->sock;
|
int csock = client->sock, ret;
|
||||||
uint32_t tmp, length;
|
uint32_t tmp, length;
|
||||||
uint64_t magic;
|
uint64_t magic;
|
||||||
|
|
||||||
|
@ -398,8 +398,9 @@ static int nbd_receive_options(NBDClient *client)
|
||||||
TRACE("Checking option");
|
TRACE("Checking option");
|
||||||
switch (be32_to_cpu(tmp)) {
|
switch (be32_to_cpu(tmp)) {
|
||||||
case NBD_OPT_LIST:
|
case NBD_OPT_LIST:
|
||||||
if (nbd_handle_list(client, length) < 0) {
|
ret = nbd_handle_list(client, length);
|
||||||
return 1;
|
if (ret < 0) {
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue