diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2019-05-08 16:10:24 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2019-05-08 16:10:25 +0100 |
commit | df06df4f412a67341de0fbb075e74c4dde3c8972 (patch) | |
tree | d34483d7fad038f66ea36533e6f8945548c5f12a /include | |
parent | 629d166994725773dea9cef843fcb0ae5f3585fe (diff) | |
parent | 8fabb8be37775ebb32b0d78bc7be815a29b8a107 (diff) | |
download | qemu-df06df4f412a67341de0fbb075e74c4dde3c8972.zip qemu-df06df4f412a67341de0fbb075e74c4dde3c8972.tar.gz qemu-df06df4f412a67341de0fbb075e74c4dde3c8972.tar.bz2 |
Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2019-05-07' into staging
nbd patches for 2019-05-07
- iotest improvements
# gpg: Signature made Tue 07 May 2019 16:00:18 BST
# gpg: using RSA key A7A16B4A2527436A
# gpg: Good signature from "Eric Blake <eblake@redhat.com>" [full]
# gpg: aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>" [full]
# gpg: aka "[jpeg image of size 6874]" [full]
# Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2 F3AA A7A1 6B4A 2527 436A
* remotes/ericb/tags/pull-nbd-2019-05-07:
iotests: Make 182 do without device_add
iotests: Tweak 221 sizing for different hole granularities
tests/qemu-iotests: Fix more reference output files due to recent qemu-io change
iotests: Fix 233 for ports other than 10809
qemu-nbd: Look up flag names in array
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/block/nbd.h | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/include/block/nbd.h b/include/block/nbd.h index 6d05983..bb9f5bc 100644 --- a/include/block/nbd.h +++ b/include/block/nbd.h @@ -127,18 +127,32 @@ typedef struct NBDExtent { /* Transmission (export) flags: sent from server to client during handshake, but describe what will happen during transmission */ -#define NBD_FLAG_HAS_FLAGS (1 << 0) /* Flags are there */ -#define NBD_FLAG_READ_ONLY (1 << 1) /* Device is read-only */ -#define NBD_FLAG_SEND_FLUSH (1 << 2) /* Send FLUSH */ -#define NBD_FLAG_SEND_FUA (1 << 3) /* Send FUA (Force Unit Access) */ -#define NBD_FLAG_ROTATIONAL (1 << 4) /* Use elevator algorithm - - rotational media */ -#define NBD_FLAG_SEND_TRIM (1 << 5) /* Send TRIM (discard) */ -#define NBD_FLAG_SEND_WRITE_ZEROES (1 << 6) /* Send WRITE_ZEROES */ -#define NBD_FLAG_SEND_DF (1 << 7) /* Send DF (Do not Fragment) */ -#define NBD_FLAG_CAN_MULTI_CONN (1 << 8) /* Multi-client cache consistent */ -#define NBD_FLAG_SEND_RESIZE (1 << 9) /* Send resize */ -#define NBD_FLAG_SEND_CACHE (1 << 10) /* Send CACHE (prefetch) */ +enum { + NBD_FLAG_HAS_FLAGS_BIT = 0, /* Flags are there */ + NBD_FLAG_READ_ONLY_BIT = 1, /* Device is read-only */ + NBD_FLAG_SEND_FLUSH_BIT = 2, /* Send FLUSH */ + NBD_FLAG_SEND_FUA_BIT = 3, /* Send FUA (Force Unit Access) */ + NBD_FLAG_ROTATIONAL_BIT = 4, /* Use elevator algorithm - + rotational media */ + NBD_FLAG_SEND_TRIM_BIT = 5, /* Send TRIM (discard) */ + NBD_FLAG_SEND_WRITE_ZEROES_BIT = 6, /* Send WRITE_ZEROES */ + NBD_FLAG_SEND_DF_BIT = 7, /* Send DF (Do not Fragment) */ + NBD_FLAG_CAN_MULTI_CONN_BIT = 8, /* Multi-client cache consistent */ + NBD_FLAG_SEND_RESIZE_BIT = 9, /* Send resize */ + NBD_FLAG_SEND_CACHE_BIT = 10, /* Send CACHE (prefetch) */ +}; + +#define NBD_FLAG_HAS_FLAGS (1 << NBD_FLAG_HAS_FLAGS_BIT) +#define NBD_FLAG_READ_ONLY (1 << NBD_FLAG_READ_ONLY_BIT) +#define NBD_FLAG_SEND_FLUSH (1 << NBD_FLAG_SEND_FLUSH_BIT) +#define NBD_FLAG_SEND_FUA (1 << NBD_FLAG_SEND_FUA_BIT) +#define NBD_FLAG_ROTATIONAL (1 << NBD_FLAG_ROTATIONAL_BIT) +#define NBD_FLAG_SEND_TRIM (1 << NBD_FLAG_SEND_TRIM_BIT) +#define NBD_FLAG_SEND_WRITE_ZEROES (1 << NBD_FLAG_SEND_WRITE_ZEROES_BIT) +#define NBD_FLAG_SEND_DF (1 << NBD_FLAG_SEND_DF_BIT) +#define NBD_FLAG_CAN_MULTI_CONN (1 << NBD_FLAG_CAN_MULTI_CONN_BIT) +#define NBD_FLAG_SEND_RESIZE (1 << NBD_FLAG_SEND_RESIZE_BIT) +#define NBD_FLAG_SEND_CACHE (1 << NBD_FLAG_SEND_CACHE_BIT) /* New-style handshake (global) flags, sent from server to client, and control what will happen during handshake phase. */ |