search for: nbd_structured_reply

Displaying 11 results from an estimated 11 matches for "nbd_structured_reply".

2019 Sep 24
0
[PATCH nbdkit 3/4] common/protocol: Update nbd-protocol.h so it matches libnbd’s copy.
...{ uint32_t magic; /* NBD_SIMPLE_REPLY_MAGIC. */ uint32_t error; /* NBD_SUCCESS or one of NBD_E*. */ uint64_t handle; /* Opaque handle. */ } __attribute__((packed)); /* Structured reply (server -> client). */ -struct structured_reply { +struct nbd_structured_reply { uint32_t magic; /* NBD_STRUCTURED_REPLY_MAGIC. */ uint16_t flags; /* NBD_REPLY_FLAG_* */ uint16_t type; /* NBD_REPLY_TYPE_* */ @@ -176,15 +189,20 @@ struct structured_reply { uint32_t length; /* Length of payload which follows. *...
2019 Sep 24
0
[PATCH nbdkit 4/4] common/protocol: Install <nbd-protocol.h> as a public header.
...y { uint32_t magic; /* NBD_SIMPLE_REPLY_MAGIC. */ uint32_t error; /* NBD_SUCCESS or one of NBD_E*. */ uint64_t handle; /* Opaque handle. */ -} __attribute__((packed)); +} NBD_ATTRIBUTE_PACKED; /* Structured reply (server -> client). */ struct nbd_structured_reply { @@ -187,23 +193,23 @@ struct nbd_structured_reply { uint16_t type; /* NBD_REPLY_TYPE_* */ uint64_t handle; /* Opaque handle. */ uint32_t length; /* Length of payload which follows. */ -} __attribute__((packed)); +} NBD_ATTRIBUTE_PACKED; struct...
2023 Jun 09
4
[libnbd PATCH v4 0/4] Saner reply header layout
This was v3 patch 2/22, reworked to address the confusion about how a structured reply header is read in two pieces before getting to the payload portion. I'm still working on rebasing the rest of my v3 series (patches 1, 3-22) from other comments given, but this seemed independent enough that it's worth posting now rather than holding it up for the rest of the series. Eric Blake (4):
2019 Sep 24
2
[PATCH libnbd] lib: Copy nbd-protocol.h from nbdkit 1.15.3.
...y { uint32_t magic; /* NBD_SIMPLE_REPLY_MAGIC. */ uint32_t error; /* NBD_SUCCESS or one of NBD_E*. */ uint64_t handle; /* Opaque handle. */ -} __attribute__((packed)); +} NBD_ATTRIBUTE_PACKED; /* Structured reply (server -> client). */ struct nbd_structured_reply { @@ -193,23 +193,23 @@ struct nbd_structured_reply { uint16_t type; /* NBD_REPLY_TYPE_* */ uint64_t handle; /* Opaque handle. */ uint32_t length; /* Length of payload which follows. */ -} __attribute__((packed)); +} NBD_ATTRIBUTE_PACKED; struct...
2023 Jun 20
1
[libnbd PATCH v4 4/4] internal: Refactor layout of replies in sbuf
...0774 100644 > --- a/lib/internal.h > +++ b/lib/internal.h > @@ -237,9 +237,19 @@ struct nbd_handle { > } payload; > } or; > struct nbd_export_name_option_reply export_name_reply; > - struct nbd_simple_reply simple_reply; > struct { > - struct nbd_structured_reply structured_reply; > + union reply_header { > + struct nbd_simple_reply simple; > + struct nbd_structured_reply structured; > + /* The wire formats share magic and cookie at the same offsets; > + * provide aliases for one less level of typing. > +...
2019 Sep 24
11
[PATCH nbdkit 0/4] common/protocol: Unify public <nbd-protocol.h>
We should have only one NBD protocol file. Let's make nbdkit's version the canonical one, and use it in libnbd. Rich.
2019 May 22
12
[libnbd PATCH v3 0/7] Avoid deadlock with in-flight commands
Since v2: - rebase to Rich's new API calls - more refactoring in patch 1 (retitled) - new patches 3 and 4 - fix data corruption in patch 6 (was 4) - more tweaks to the reproducer example (including using new API from 3) Eric Blake (7): lib: Refactor command_common() to do more common work commands: Allow for a command queue commands: Expose FIFO ordering of server completions
2020 Mar 19
1
[nbdkit PATCH] nbd: Drop nbd-standalone fallback
...value) on success, or -1 on read failure. If structured replies - were negotiated, trans_out is set to NULL if there are still more replies - expected. */ -static int -nbd_reply_raw (struct handle *h, struct transaction **trans_out) -{ - union { - struct nbd_simple_reply simple; - struct nbd_structured_reply structured; - } rep; - struct transaction *trans; - void *buf = NULL; - CLEANUP_FREE char *payload = NULL; - uint32_t count; - uint32_t id; - struct nbd_block_descriptor *extents = NULL; - size_t nextents = 0; - int error = NBD_SUCCESS; - bool more = false; - uint32_t len = 0; /* 0 excep...
2020 Feb 11
0
[PATCH nbdkit 3/3] server: Remove explicit connection parameter, use TLS instead.
...uint16_t cmd, uint16_t flags, uint32_t count, uint64_t offset, struct nbdkit_extents *extents) { + struct connection *conn = GET_CONN; ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&conn->write_lock); struct nbd_structured_reply reply; CLEANUP_FREE struct nbd_block_descriptor *blocks = NULL; @@ -542,7 +542,7 @@ send_structured_reply_block_status (struct connection *conn, blocks = extents_to_block_descriptors (extents, flags, count, offset, &nr_blocks); if (blocks == NU...
2020 Feb 11
4
[PATCH nbdkit v2 0/3] server: Remove explicit connection parameter.
v1 was here: https://www.redhat.com/archives/libguestfs/2020-February/msg00081.html v2 replaces struct connection *conn = GET_CONN; with GET_CONN; which sets conn implicitly and asserts that it is non-NULL. If we actually want to test if conn is non-NULL or behave differently, then you must use threadlocal_get_conn() instead, and some existing uses do that. Rich.
2020 Feb 11
5
[PATCH nbdkit 0/3] server: Remove explicit connection parameter.
The third patch is a large but mechanical change which gets rid of passing around struct connection * entirely within the server, preferring instead to reference the connection through thread-local storage. I hope this is a gateway to simplifying other parts of the code. Rich.