[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH 06/25] nbd: Pass return value from nbd_handle_list()
From: |
Max Reitz |
Subject: |
[Qemu-block] [PATCH 06/25] nbd: Pass return value from nbd_handle_list() |
Date: |
Wed, 25 Feb 2015 13:08:19 -0500 |
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 <address@hidden>
---
nbd.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/nbd.c b/nbd.c
index d2eb1c5..77d1158 100644
--- a/nbd.c
+++ b/nbd.c
@@ -352,7 +352,7 @@ fail:
static int nbd_receive_options(NBDClient *client)
{
while (1) {
- int csock = client->sock;
+ int csock = client->sock, ret;
uint32_t tmp, length;
uint64_t magic;
@@ -399,8 +399,9 @@ static int nbd_receive_options(NBDClient *client)
TRACE("Checking option");
switch (be32_to_cpu(tmp)) {
case NBD_OPT_LIST:
- if (nbd_handle_list(client, length) < 0) {
- return 1;
+ ret = nbd_handle_list(client, length);
+ if (ret < 0) {
+ return ret;
}
break;
--
2.1.0
- [Qemu-block] [PATCH 00/25] nbd: Several fixes, Max Reitz, 2015/02/25
- [Qemu-block] [PATCH 03/25] nbd: Fix nbd_establish_connection()'s return value, Max Reitz, 2015/02/25
- [Qemu-block] [PATCH 02/25] qemu-nbd: Detect unused partitions by system == 0, Max Reitz, 2015/02/25
- [Qemu-block] [PATCH 05/25] nbd: Avoid generic -EINVAL, Max Reitz, 2015/02/25
- [Qemu-block] [PATCH 09/25] qemu-nbd: fork() can fail, Max Reitz, 2015/02/25
- [Qemu-block] [PATCH 06/25] nbd: Pass return value from nbd_handle_list(),
Max Reitz <=
- [Qemu-block] [PATCH 08/25] nbd: Handle blk_getlength() failure, Max Reitz, 2015/02/25
- [Qemu-block] [PATCH 04/25] nbd: Fix response to invalid requests, Max Reitz, 2015/02/25
- [Qemu-block] [PATCH 10/25] nbd: Fix potential signed overflow issues, Max Reitz, 2015/02/25
- [Qemu-block] [PATCH 01/25] util/uri: Add overflow check to rfc3986_parse_port, Max Reitz, 2015/02/25
- [Qemu-block] [PATCH 14/25] coroutine: Add co_yield_timeout(), Max Reitz, 2015/02/25
- [Qemu-block] [PATCH 15/25] coroutine-io: Return -errno in case of error, Max Reitz, 2015/02/25
- [Qemu-block] [PATCH 07/25] nbd: Add "failed to open export" error message, Max Reitz, 2015/02/25
- [Qemu-block] [PATCH 13/25] nbd: Enforce sector alignment, Max Reitz, 2015/02/25
- [Qemu-block] [PATCH 12/25] nbd: Set block size to BDRV_SECTOR_SIZE, Max Reitz, 2015/02/25
- [Qemu-block] [PATCH 11/25] qemu-nbd: Fix and improve input verification, Max Reitz, 2015/02/25