Displaying 12 results from an estimated 12 matches for "reset_b_conn_handl".
Did you mean:
reset_b_conn_handle
2019 Sep 19
0
[PATCH nbdkit v2 1/4] server: Replace another memset with a call to reset_b_conn_handle.
...ver/backend.c
index 64dbf7d..6c102f9 100644
--- a/server/backend.c
+++ b/server/backend.c
@@ -209,8 +209,7 @@ backend_close (struct backend *b, struct connection *conn)
debug ("%s: close", b->name);
b->close (b, conn);
- memset (h, -1, sizeof *h);
- h->handle = NULL;
+ reset_b_conn_handle (h);
}
void
--
2.23.0
2019 Sep 19
1
[PATCH nbdkit] server: Remove tricksy initialization of struct b_conn_handle.
...c
@@ -269,9 +269,8 @@ new_connection (int sockin, int sockout, int nworkers)
goto error;
}
conn->nr_handles = backend->i + 1;
- memset (conn->handles, -1, conn->nr_handles * sizeof *conn->handles);
for_each_backend (b)
- conn->handles[b->i].handle = NULL;
+ reset_b_conn_handle (&conn->handles[b->i]);
conn->status = 1;
conn->nworkers = nworkers;
diff --git a/server/internal.h b/server/internal.h
index c31bb34..604dd89 100644
--- a/server/internal.h
+++ b/server/internal.h
@@ -168,6 +168,23 @@ struct b_conn_handle {
int can_cache;
};
+static...
2020 Feb 12
0
[PATCH nbdkit 2/3] server: Rename ‘struct b_conn_handle’ to plain ‘struct handle’.
...uct handle {
+ void *handle; /* Plugin or filter handle. */
- unsigned char state; /* Bitmask of HANDLE_* values */
+ unsigned char state; /* Bitmask of HANDLE_* values */
uint64_t exportsize;
int can_write;
@@ -195,7 +203,7 @@ struct b_conn_handle {
};
static inline void
-reset_b_conn_handle (struct b_conn_handle *h)
+reset_handle (struct handle *h)
{
h->handle = NULL;
h->state = 0;
@@ -222,7 +230,7 @@ struct connection {
void *crypto_session;
int nworkers;
- struct b_conn_handle *handles;
+ struct handle *handles; /* One per plugin and filter. */
size_...
2019 Oct 07
0
[nbdkit PATCH 5/5] server: Ensure .finalize and .close are called as needed
...are passed, so .finalize is needed */
+ HANDLE_FAILED = 4, /* Set if .finalize failed */
+};
+
struct b_conn_handle {
void *handle;
+ unsigned char state; /* Bitmask of HANDLE_* values */
+
uint64_t exportsize;
int can_write;
int can_flush;
@@ -173,6 +181,7 @@ static inline void
reset_b_conn_handle (struct b_conn_handle *h)
{
h->handle = NULL;
+ h->state = 0;
h->exportsize = -1;
h->can_write = -1;
h->can_flush = -1;
diff --git a/server/backend.c b/server/backend.c
index 702c9b96..bdc5bbfd 100644
--- a/server/backend.c
+++ b/server/backend.c
@@ -176,6 +176,7 @@ ba...
2019 Oct 07
6
[nbdkit PATCH 0/5] More retry fixes
I think this is my last round of patches for issues I identified with
the retry filter. With this in place, it should be safe to interject
another filter in between retry and the plugin.
Eric Blake (5):
retry: Don't call into closed plugin
tests: Refactor test-retry-reopen-fail.sh
tests: Enhance retry test to cover failed reopen
server: Move prepare/finalize/close recursion to
2020 Feb 12
5
[PATCH nbdkit 1/3] server: Rename global backend pointer to "top".
...eof *conn->handles);
+ conn->handles = calloc (top->i + 1, sizeof *conn->handles);
if (conn->handles == NULL) {
perror ("malloc");
goto error;
}
- conn->nr_handles = backend->i + 1;
+ conn->nr_handles = top->i + 1;
for_each_backend (b)
reset_b_conn_handle (&conn->handles[b->i]);
@@ -277,7 +277,7 @@ new_connection (int sockin, int sockout, int nworkers)
* we aren't accepting until the plugin is not running, making
* non-atomicity okay.
*/
- assert (backend->thread_model (backend) <=
+ assert (top->thr...
2019 Sep 19
7
[PATCH nbdkit v2 0/4] Add new retry filter.
v1 was here:
https://www.redhat.com/archives/libguestfs/2019-September/msg00199.html
v2:
- Adds a fairly simple yet comprehensive test using sh plugin.
- Rebase and retest.
Patch 1 is a misc patch not really related to the series.
Rich.
2019 Oct 04
6
[nbdkit PATCH 0/5] Another round of retry fixes
I still don't have .prepare/.finalize working cleanly across reopen,
but did find a nasty bug where a botched assertion means we failed to
notice reads beyond EOF in both the xz and retry filter.
Refactoring backend.c will make .finalize work easier.
Eric Blake (5):
xz: Avoid reading beyond EOF
retry: Check size before transactions
tests: Test retry when get_size values change
2020 Feb 11
0
[PATCH nbdkit 3/3] server: Remove explicit connection parameter, use TLS instead.
...en */
@@ -243,19 +247,19 @@ backend_close (struct backend *b, struct connection *conn)
if (h->handle) {
assert (h->state & HANDLE_OPEN);
- b->close (b, conn, h->handle);
+ b->close (b, h->handle);
}
else
assert (! (h->state & HANDLE_OPEN));
reset_b_conn_handle (h);
if (b->i)
- backend_close (b->next, conn);
+ backend_close (b->next);
}
bool
-backend_valid_range (struct backend *b, struct connection *conn,
- uint64_t offset, uint32_t count)
+backend_valid_range (struct backend *b, uint64_t offset, uint32_t count)...
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.
2020 Feb 10
17
Cross-project NBD extension proposal: NBD_INFO_INIT_STATE
I will be following up to this email with four separate threads each
addressed to the appropriate single list, with proposed changes to:
- the NBD protocol
- qemu: both server and client
- libnbd: client
- nbdkit: server
The feature in question adds a new optional NBD_INFO_ packet to the
NBD_OPT_GO portion of handshake, adding up to 16 bits of information
that the server can advertise to the