qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCHv2 2/2] Correct definition of NBD_CMD_FLAG_FUA


From: Alex Bligh
Subject: [Qemu-devel] [PATCHv2 2/2] Correct definition of NBD_CMD_FLAG_FUA
Date: Fri, 1 Apr 2016 11:46:30 +0100

NBD_CMD_FLAG_FUA is defined as 1<<0 in the documentation, but
1<<16 in nbd.h.

The code currently treats the command as a 32 bit quantity
and masks this off. This is confusing. Until such time as the
code is fixed up, make it obvious this isn't really bit 16.

Signed-off-by: Alex Bligh <address@hidden>
---
 nbd.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/nbd.h b/nbd.h
index f2a32dd..732c605 100644
--- a/nbd.h
+++ b/nbd.h
@@ -38,7 +38,8 @@ enum {
 };
 
 #define NBD_CMD_MASK_COMMAND 0x0000ffff
-#define NBD_CMD_FLAG_FUA (1<<16)
+#define NBD_CMD_SHIFT (16)
+#define NBD_CMD_FLAG_FUA ((1 << 0) << NBD_CMD_SHIFT)
 
 /* values for flags field */
 #define NBD_FLAG_HAS_FLAGS     (1 << 0)        /* Flags are there */
-- 
1.9.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]