summaryrefslogtreecommitdiffstats
path: root/include/block/nbd.h
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy2017-10-12 11:53:10 +0200
committerEric Blake2017-10-12 23:53:15 +0200
commitcaad53845af2ee607913d844ce6c08a5dbbeceef (patch)
treeb7e8230edf1029d62bda91c16ff68e56998ab5b4 /include/block/nbd.h
parentnbd: rename some simple-request related objects to be _simple_ (diff)
downloadqemu-caad53845af2ee607913d844ce6c08a5dbbeceef.tar.gz
qemu-caad53845af2ee607913d844ce6c08a5dbbeceef.tar.xz
qemu-caad53845af2ee607913d844ce6c08a5dbbeceef.zip
nbd/server: structurize simple reply header sending
Use packed structure instead of pointer arithmetics. Also, merge two redundant traces into one. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <20171012095319.136610-5-vsementsov@virtuozzo.com> [eblake: tweak and mention impact on traces, fix errp usage] Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'include/block/nbd.h')
-rw-r--r--include/block/nbd.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/block/nbd.h b/include/block/nbd.h
index 707fd37575..49008980f4 100644
--- a/include/block/nbd.h
+++ b/include/block/nbd.h
@@ -63,6 +63,12 @@ struct NBDReply {
};
typedef struct NBDReply NBDReply;
+typedef struct NBDSimpleReply {
+ uint32_t magic; /* NBD_SIMPLE_REPLY_MAGIC */
+ uint32_t error;
+ uint64_t handle;
+} QEMU_PACKED NBDSimpleReply;
+
/* 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 */