search for: nbdplug_register

Displaying 15 results from an estimated 15 matches for "nbdplug_register".

2019 Jul 01
3
[nbdkit PATCH 0/2] Use new libnbd _notify functions
I'm not observing any noticeable performance differences, but I'm liking the diffstat. I can't push this patch until we release a new libnbd version with the _notify API addition, but am posting it now for playing with things. Eric Blake (2): nbd: Move transaction info from heap to stack nbd: Use nbdkit aio_*_notify variants plugins/nbd/nbd.c | 217
2019 Jul 17
3
[nbdkit PATCH 0/2] Another libnbd API bump
libnbd 0.1.7 was released today, which breaks compilation of nbdkit-nbd-plugin. We could work around it by using #ifdef LIBNBD_HAVE_XXX to learn about the renamed functions, but supporting older versions is not all that important when we don't yet have API stability. So patch 1 copes by just bumping the minimum version instead, except that we have yet another pending libnbd patch with an API
2019 Jul 01
0
[nbdkit PATCH 2/2] nbd: Use nbdkit aio_*_notify variants
We no longer have to track a linked list of in-flight transactions that are pending resolution, but rely instead on libnbd 0.1.6+ doing it on our behalf. Normally, we will get to call nbdplug_register() prior to the notify callback being reached, but under a heavily-loaded system, it is conceivable that the libnbd state machine can manage to fire off our request and receive a server reply all before returning to the thread waiting on the semaphore, in which case the notify callback could set the...
2019 Aug 15
3
[nbdkit PATCH] nbd: Another libnbd version bump
...fy (unsigned valid_flag, void *opaque, int *error) +nbdplug_notify (void *opaque, int *error) { struct transaction *trans = opaque; - if (!(valid_flag & LIBNBD_CALLBACK_VALID)) - return 0; - /* There's a possible race here where trans->cookie has not yet been * updated by nbdplug_register, but it's only an informational * message. @@ -376,6 +367,17 @@ nbdplug_notify (unsigned valid_flag, void *opaque, int *error) return 1; } +/* Prepare for a transaction. */ +static void +nbdplug_prepare (struct transaction *trans) +{ + memset (trans, 0, sizeof *trans); + if (sem_init...
2019 Jul 17
0
[nbdkit PATCH 2/2] nbd: Another libnbd API bump
...ot; != "x"]) diff --git a/plugins/nbd/nbd.c b/plugins/nbd/nbd.c index 48873d09..83a30583 100644 --- a/plugins/nbd/nbd.c +++ b/plugins/nbd/nbd.c @@ -673,7 +673,7 @@ nbdplug_pread (void *handle, void *buf, uint32_t count, uint64_t offset, assert (!flags); nbdplug_prepare (&s); nbdplug_register (h, &s, nbd_aio_pread_callback (h->nbd, buf, count, offset, - &s, nbdplug_notify, 0)); + nbdplug_notify, &s, 0)); return nbdplug_reply (h, &s); } @@ -689,7 +689,7 @@ nbdplug_p...
2019 Jul 30
1
[PATCH nbdkit] nbd: Update for libnbd 0.9.6.
...int64_t cookie, int *error) +nbdplug_notify (unsigned valid_flag, void *opaque, int *error) { struct transaction *trans = opaque; if (!(valid_flag & LIBNBD_CALLBACK_VALID)) return 0; + /* There's a possible race here where trans->cookie has not yet been + * updated by nbdplug_register, but it's only an informational + * message. + */ nbdkit_debug ("cookie %" PRId64 " completed state machine, status %d", - cookie, *error); + trans->cookie, *error); trans->err = *error; if (sem_post (&trans->sem)) {...
2019 May 30
0
[nbdkit PATCH 3/4] nbd: Use libnbd 0.1
...WN; if (sem_post (&trans->sem)) { nbdkit_error ("failed to post semaphore: %m"); abort (); } } + nbdkit_debug ("exiting state machine thread"); return NULL; } +/* Register a cookie and return a transaction. */ +static struct transaction * +nbdplug_register (struct handle *h, int64_t cookie) +{ + struct transaction *trans; + char c = 0; + + if (cookie == -1) { + nbdkit_error ("command failed: %s", nbd_get_error ()); + errno = nbd_get_errno (); + return NULL; + } + + nbdkit_debug ("cookie %" PRId64 " started by st...
2019 Jun 12
0
[nbdkit PATCH v3 3/5] nbd: Use libnbd 0.1.3+
...WN; if (sem_post (&trans->sem)) { nbdkit_error ("failed to post semaphore: %m"); abort (); } } + nbdkit_debug ("exiting state machine thread"); return NULL; } +/* Register a cookie and return a transaction. */ +static struct transaction * +nbdplug_register (struct handle *h, int64_t cookie) +{ + struct transaction *trans; + char c = 0; + + if (cookie == -1) { + nbdkit_error ("command failed: %s", nbd_get_error ()); + errno = nbd_get_errno (); + return NULL; + } + + nbdkit_debug ("cookie %" PRId64 " started by st...
2019 Jun 18
0
[nbdkit PATCH] Experiment: nbd: Use ppoll() instead of pipe-to-self
...N && read (h->fds[0], &c, 1) != 1) { - nbdkit_error ("failed to read pipe: %m"); - break; - } - ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&h->trans_lock); trans = h->trans; prev = &h->trans; @@ -400,7 +419,6 @@ static struct transaction * nbdplug_register (struct handle *h, int64_t cookie) { struct transaction *trans; - char c = 0; if (cookie == -1) { nbdkit_error ("command failed: %s", nbd_get_error ()); @@ -417,8 +435,8 @@ nbdplug_register (struct handle *h, int64_t cookie) /* While locked, kick the reader thread and ad...
2019 May 30
5
[nbdkit PATCH 0/4] Play with libnbd for nbdkit-add
Patch 1 played with an early draft of Rich's Fedora 30 libnbd package: https://bugzilla.redhat.com/show_bug.cgi?id=1713767#c17 Note that comment 21 provides a newer package 0.1.1-1 with a different API; and that libnbd has more unreleased API changes in the pipeline (whether that will be called 0.2 or 0.1.2); so we'll have to tweak things based on what is actually available in distros.
2019 Jun 02
5
[nbdkit PATCH v2 0/5] Play with libnbd for nbdkit-nbd
libnbd-0.1.2-1 is now available in Fedora 29/30 updates-testing, although it was not compiled against libxml2 so it lacks uri support (I ended up testing patch 4 with a self-built libnbd). Diffs since v1 - rebase to master, bump from libnbd 0.1 to 0.1.2, add URI support, better timing results Still not done - patch 5 needs associated tests Eric Blake (5): nbd: Check for libnbd nbd:
2019 Jun 12
8
[nbdkit PATCH v3 0/5] Play with libnbd for nbdkit-nbd
libnbd-0.1.4-1 is now available in Fedora 29/30 updates testing. Diffs since v2 - rebase to master, bump from libnbd 0.1.2 to 0.1.3+, add tests to TLS usage which flushed out the need to turn relative pathnames into absolute, doc tweaks Now that the testsuite covers TLS and libnbd has been fixed to provide the things I found lacking when developing v2, I'm leaning towards pushing this on
2019 Jul 23
4
[libnbd PATCH] api: Allow completion callbacks to auto-retire
When using the nbd_aio_FOO_callback commands, there is nothing further to be learned about the command by calling nbd_aio_command_completed() compared to what the callback already had access to. There are still scenarios where manually retiring the command after the fact is useful (whether the return was 0 to keep the status unchanged, or -1 to alter the retirement status to *error), but by
2019 Aug 23
2
[nbdkit PATCH 3/3] plugins: Add .can_fast_zero hook
...NBD_CMD_FLAG_NO_HOLE; if (flags & NBDKIT_FLAG_FUA) f |= LIBNBD_CMD_FLAG_FUA; +#if LIBNBD_HAVE_NBD_CAN_FAST_ZERO + if (flags & NBDKIT_FLAG_FAST_ZERO) + f |= LIBNBD_CMD_FLAG_FAST_ZERO; +#else + assert (!(flags & NBDKIT_FLAG_FAST_ZERO)); +#endif nbdplug_prepare (&s); nbdplug_register (h, &s, nbd_aio_zero (h->nbd, count, offset, s.cb, f)); return nbdplug_reply (h, &s); @@ -831,6 +856,7 @@ static struct nbdkit_plugin plugin = { .is_rotational = nbdplug_is_rotational, .can_trim = nbdplug_can_trim, .can_zero = nbdplug_can_zero, + .ca...
2019 Aug 23
22
cross-project patches: Add NBD Fast Zero support
This is a cover letter to a series of patches being proposed in tandem to four different projects: - nbd: Document a new NBD_CMD_FLAG_FAST_ZERO command flag - qemu: Implement the flag for both clients and server - libnbd: Implement the flag for clients - nbdkit: Implement the flag for servers, including the nbd passthrough client If you want to test the patches together, I've pushed a