[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH 19/25] nbd: Fix interpretation of the export flags
From: |
Max Reitz |
Subject: |
[Qemu-block] [PATCH 19/25] nbd: Fix interpretation of the export flags |
Date: |
Wed, 25 Feb 2015 13:08:32 -0500 |
The export flags are a 16 bit value, so be16_to_cpu() has to be used to
interpret them correctly. This makes discard and flush actually work
for named NBD exports (they did not work before, because the client
always assumed them to be unsupported because of the bug fixed by this
patch).
Signed-off-by: Max Reitz <address@hidden>
---
nbd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/nbd.c b/nbd.c
index d94cd88..aa0925a 100644
--- a/nbd.c
+++ b/nbd.c
@@ -636,7 +636,7 @@ int nbd_receive_negotiate(int csock, const char *name,
uint32_t *flags,
error_setg(errp, "Failed to read export flags");
goto fail;
}
- *flags |= be32_to_cpu(tmp);
+ *flags |= be16_to_cpu(tmp);
}
if (read_sync(csock, &buf, 124) != 124) {
error_setg(errp, "Failed to read reserved block");
--
2.1.0
- [Qemu-block] [PATCH 07/25] nbd: Add "failed to open export" error message, (continued)
- [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
- [Qemu-block] [PATCH 22/25] iotests: Add _timeout function, Max Reitz, 2015/02/25
- [Qemu-block] [PATCH 20/25] block/nbd: Comment on discard/flush silently failing, Max Reitz, 2015/02/25
- [Qemu-block] [PATCH 16/25] coroutine-io: Add I/O functions with timeout, Max Reitz, 2015/02/25
- [Qemu-block] [PATCH 23/25] iotests: Add test for invalid qemu-nbd parameters, Max Reitz, 2015/02/25
- [Qemu-block] [PATCH 21/25] nbd: Drop unexpected data for NBD_OPT_LIST, Max Reitz, 2015/02/25
- [Qemu-block] [PATCH 25/25] iotests: Add test for a non-existing NBD export, Max Reitz, 2015/02/25
- [Qemu-block] [PATCH 19/25] nbd: Fix interpretation of the export flags,
Max Reitz <=
- [Qemu-block] [PATCH 18/25] nbd: Fix nbd_receive_options(), Max Reitz, 2015/02/25
- [Qemu-block] [PATCH 17/25] nbd: Employ timeouts, Max Reitz, 2015/02/25
- Re: [Qemu-block] [PATCH 00/25] nbd: Several fixes, Max Reitz, 2015/02/25
- [Qemu-block] [PATCH 24/25] iotests: Add test for issuing discard over NBD, Max Reitz, 2015/02/25