aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2023-06-08 08:56:34 -0500
committerEric Blake <eblake@redhat.com>2023-07-19 15:25:30 -0500
commit22efd81104f07f7dbe571a923cc43ed625560551 (patch)
treef106507332fae71e8035ae259c24cbc95b1cd505 /include
parent66d4f4fe2f1c282a34a429f61aa4283e60336500 (diff)
downloadqemu-22efd81104f07f7dbe571a923cc43ed625560551.zip
qemu-22efd81104f07f7dbe571a923cc43ed625560551.tar.gz
qemu-22efd81104f07f7dbe571a923cc43ed625560551.tar.bz2
nbd: s/handle/cookie/ to match NBD spec
Externally, libnbd exposed the 64-bit opaque marker for each client NBD packet as the "cookie", because it was less confusing when contrasted with 'struct nbd_handle *' holding all libnbd state. It also avoids confusion between the noun 'handle' as a way to identify a packet and the verb 'handle' for reacting to things like signals. Upstream NBD changed their spec to favor the name "cookie" based on libnbd's recommendations[1], so we can do likewise. [1] https://github.com/NetworkBlockDevice/nbd/commit/ca4392eb2b Signed-off-by: Eric Blake <eblake@redhat.com> Message-ID: <20230608135653.2918540-6-eblake@redhat.com> [eblake: typo fix] Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Diffstat (limited to 'include')
-rw-r--r--include/block/nbd.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/include/block/nbd.h b/include/block/nbd.h
index ee71af0..fb935d5 100644
--- a/include/block/nbd.h
+++ b/include/block/nbd.h
@@ -59,7 +59,7 @@ typedef struct NBDOptionReplyMetaContext {
* request and reply!
*/
typedef struct NBDRequest {
- uint64_t handle;
+ uint64_t cookie;
uint64_t from;
uint32_t len;
uint16_t flags; /* NBD_CMD_FLAG_* */
@@ -69,7 +69,7 @@ typedef struct NBDRequest {
typedef struct NBDSimpleReply {
uint32_t magic; /* NBD_SIMPLE_REPLY_MAGIC */
uint32_t error;
- uint64_t handle;
+ uint64_t cookie;
} QEMU_PACKED NBDSimpleReply;
/* Header of all structured replies */
@@ -77,7 +77,7 @@ typedef struct NBDStructuredReplyChunk {
uint32_t magic; /* NBD_STRUCTURED_REPLY_MAGIC */
uint16_t flags; /* combination of NBD_REPLY_FLAG_* */
uint16_t type; /* NBD_REPLY_TYPE_* */
- uint64_t handle; /* request handle */
+ uint64_t cookie; /* request handle */
uint32_t length; /* length of payload */
} QEMU_PACKED NBDStructuredReplyChunk;
@@ -85,13 +85,14 @@ typedef union NBDReply {
NBDSimpleReply simple;
NBDStructuredReplyChunk structured;
struct {
- /* @magic and @handle fields have the same offset and size both in
+ /*
+ * @magic and @cookie fields have the same offset and size both in
* simple reply and structured reply chunk, so let them be accessible
* without ".simple." or ".structured." specification
*/
uint32_t magic;
uint32_t _skip;
- uint64_t handle;
+ uint64_t cookie;
} QEMU_PACKED;
} NBDReply;