search for: libnbd_cmd_flag_fua

Displaying 20 results from an estimated 22 matches for "libnbd_cmd_flag_fua".

2020 Sep 04
0
[libnbd PATCH 1/2] api: Add nbd_set_strict_mode
...uot;server does not support write operations"); - return -1; - } + if (h->strict & LIBNBD_STRICT_COMMANDS) { + if (nbd_unlocked_is_read_only (h) == 1) { + set_error (EPERM, "server does not support write operations"); + return -1; + } - if ((flags & ~LIBNBD_CMD_FLAG_FUA) != 0) { - set_error (EINVAL, "invalid flag: %" PRIu32, flags); - return -1; - } + if ((flags & ~LIBNBD_CMD_FLAG_FUA) != 0) { + set_error (EINVAL, "invalid flag: %" PRIu32, flags); + return -1; + } - if ((flags & LIBNBD_CMD_FLAG_FUA) != 0 &&a...
2020 Sep 11
0
[libnbd PATCH v2 3/5] api: Add nbd_set_strict_mode
...luding zero or more of the +following strictness flags: + +=over 4 + +=item C<LIBNBD_STRICT_COMMANDS> = 1 + +If set, this flag rejects client requests that do not comply with the +set of advertised server flags (for example, attempting a write on +a read-only server, or attempting to use C<LIBNBD_CMD_FLAG_FUA> when +L<nbd_can_fua(3)> returned false). If clear, this flag relies on the +server to reject unexpected commands. + +=back + +For convenience, the constant C<LIBNBD_STRICT_MASK> is available to +describe all strictness flags supported by this build of libnbd. +Future versions of li...
2020 Sep 04
4
[RFC libnbd PATCH 0/2] Add knobs for client- vs. server-side validation
We have been inconsistent on how much we reject client-side without even consulting the server, vs. how much we depend on the server to detect failure (even if our request can be deemed undefined per NBD protocol). I'd like to change it so that by default, we reject as much as we can client-side for less traffic, but where the user can also change things on the fly for server-side integration
2020 Sep 11
0
[libnbd PATCH v2 2/5] generator: Refactor filtering of accepted OFlags
...- if ((flags & LIBNBD_CMD_FLAG_DF) != 0 && nbd_unlocked_can_df (h) != 1) { set_error (EINVAL, "server does not support the DF flag"); @@ -334,11 +320,6 @@ nbd_unlocked_aio_pwrite (struct nbd_handle *h, const void *buf, return -1; } - if ((flags & ~LIBNBD_CMD_FLAG_FUA) != 0) { - set_error (EINVAL, "invalid flag: %" PRIu32, flags); - return -1; - } - if ((flags & LIBNBD_CMD_FLAG_FUA) != 0 && nbd_unlocked_can_fua (h) != 1) { set_error (EINVAL, "server does not support the FUA flag"); @@ -362,11 +343,6 @@ nbd_un...
2020 Sep 11
10
[libnbd PATCH v2 0/5] Add knobs for client- vs. server-side validation
In v2: - now based on my proposal to add LIBNBD_SHUTDOWN_IMMEDIATE - four flags instead of two: STRICT_FLAGS is new (patch 4), and STRICT_BOUNDS is separate from STRICT_ZERO_SIZE (patch 5) - various refactorings for more shared code and less duplication Eric Blake (5): api: Add xxx_MASK constant for each Flags type generator: Refactor filtering of accepted OFlags api: Add
2019 Aug 23
1
[libnbd PATCH 1/1] api: Add support for FAST_ZERO flag
...C<nbd_aio_zero>). Returns false if +the server does not." +^ non_blocking_test_call_description; + }; + "can_df", { default_call with args = []; ret = RBool; @@ -1668,9 +1682,12 @@ The C<flags> parameter may be C<0> for no flags, or may contain C<LIBNBD_CMD_FLAG_FUA> meaning that the server should not return until the data has been committed to permanent storage (if that is supported - some servers cannot do this, see -L<nbd_can_fua(3)>), and/or C<LIBNBD_CMD_FLAG_NO_HOLE> meaning that +L<nbd_can_fua(3)>), C<LIBNBD_CMD_FLAG_NO_HOLE>...
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
2020 Sep 11
0
[libnbd PATCH v2 4/5] api: Add STRICT_FLAGS to set_strict_mode
...1 lsl 0; "UNIX", 1 lsl 1; @@ -196,6 +202,7 @@ let allow_transport_flags = { } let shutdown_flags = { flag_prefix = "SHUTDOWN"; + guard = None; flags = [ "IMMEDIATE", 1 lsl 1; ] @@ -749,6 +756,22 @@ a read-only server, or attempting to use C<LIBNBD_CMD_FLAG_FUA> when L<nbd_can_fua(3)> returned false). If clear, this flag relies on the server to reject unexpected commands. +=item C<LIBNBD_STRICT_FLAGS> = 2 + +If set, this flag rejects client requests that attempt to set a +command flag not recognized by libnbd (those outside of +C<LIB...
2019 Jul 17
0
[nbdkit PATCH 2/2] nbd: Another libnbd API bump
...&s, nbdplug_notify, f)); + nbdplug_notify, &s, f)); return nbdplug_reply (h, &s); } @@ -709,7 +709,7 @@ nbdplug_zero (void *handle, uint32_t count, uint64_t offset, uint32_t flags) f |= LIBNBD_CMD_FLAG_FUA; nbdplug_prepare (&s); nbdplug_register (h, &s, nbd_aio_zero_callback (h->nbd, count, offset, - &s, nbdplug_notify, f)); + nbdplug_notify, &s, f)); return nbdplug_reply (h,...
2020 Sep 17
2
Re: [libnbd PATCH v2 4/5] api: Add STRICT_FLAGS to set_strict_mode
...> @@ -196,6 +202,7 @@ let allow_transport_flags = { > } > let shutdown_flags = { > flag_prefix = "SHUTDOWN"; > + guard = None; > flags = [ > "IMMEDIATE", 1 lsl 1; > ] > @@ -749,6 +756,22 @@ a read-only server, or attempting to use C<LIBNBD_CMD_FLAG_FUA> when > L<nbd_can_fua(3)> returned false). If clear, this flag relies on the > server to reject unexpected commands. > > +=item C<LIBNBD_STRICT_FLAGS> = 2 > + > +If set, this flag rejects client requests that attempt to set a > +command flag not recognized by...
2019 Jul 01
0
[nbdkit PATCH 2/2] nbd: Use nbdkit aio_*_notify variants
...ify (h->nbd, buf, count, offset, + &s, nbdplug_notify, f)); return nbdplug_reply (h, &s); } @@ -751,7 +708,8 @@ nbdplug_zero (void *handle, uint32_t count, uint64_t offset, uint32_t flags) if (flags & NBDKIT_FLAG_FUA) f |= LIBNBD_CMD_FLAG_FUA; nbdplug_prepare (&s); - nbdplug_register (h, &s, nbd_aio_zero (h->nbd, count, offset, f)); + nbdplug_register (h, &s, nbd_aio_zero_notify (h->nbd, count, offset, + &s, nbdplug_notify, f)); return nbdplug_reply (h, &s)...
2019 May 30
0
[nbdkit PATCH 3/4] nbd: Use libnbd 0.1
...d_aio_pread (h->nbd, buf, count, offset /* , 0 */)); return nbdplug_reply (h, s); } @@ -1253,10 +629,10 @@ nbdplug_pwrite (void *handle, const void *buf, uint32_t count, uint64_t offset, { struct handle *h = handle; struct transaction *s; + uint32_t f = flags & NBDKIT_FLAG_FUA ? LIBNBD_CMD_FLAG_FUA : 0; assert (!(flags & ~NBDKIT_FLAG_FUA)); - s = nbdplug_request_full (h, flags & NBDKIT_FLAG_FUA ? NBD_CMD_FLAG_FUA : 0, - NBD_CMD_WRITE, offset, count, buf, NULL, NULL); + s = nbdplug_register (h, nbd_aio_pwrite (h->nbd, buf, count, offset, f)); retu...
2019 Jun 12
0
[nbdkit PATCH v3 3/5] nbd: Use libnbd 0.1.3+
...(h, nbd_aio_pread (h->nbd, buf, count, offset, 0)); return nbdplug_reply (h, s); } @@ -1258,10 +616,10 @@ nbdplug_pwrite (void *handle, const void *buf, uint32_t count, uint64_t offset, { struct handle *h = handle; struct transaction *s; + uint32_t f = flags & NBDKIT_FLAG_FUA ? LIBNBD_CMD_FLAG_FUA : 0; assert (!(flags & ~NBDKIT_FLAG_FUA)); - s = nbdplug_request_full (h, flags & NBDKIT_FLAG_FUA ? NBD_CMD_FLAG_FUA : 0, - NBD_CMD_WRITE, offset, count, buf, NULL, NULL); + s = nbdplug_register (h, nbd_aio_pwrite (h->nbd, buf, count, offset, f)); retu...
2019 Aug 15
3
[nbdkit PATCH] nbd: Another libnbd version bump
...r (h, &s, nbd_aio_pwrite (h->nbd, buf, count, offset, + s.cb, f)); return nbdplug_reply (h, &s); } @@ -729,8 +731,7 @@ nbdplug_zero (void *handle, uint32_t count, uint64_t offset, uint32_t flags) if (flags & NBDKIT_FLAG_FUA) f |= LIBNBD_CMD_FLAG_FUA; nbdplug_prepare (&s); - nbdplug_register (h, &s, nbd_aio_zero_callback (h->nbd, count, offset, - nbdplug_notify, &s, f)); + nbdplug_register (h, &s, nbd_aio_zero (h->nbd, count, offset, s.cb, f)); return nbdplug_reply (...
2019 May 23
2
[PATCH libnbd] api: Get rid of nbd_connection.
This isn't quite finished because not all of the tests or examples have been updated, but it demonstrates an idea: Should we forget about the concept of having multiple connections managed under a single handle? In this patch there is a single ‘struct nbd_handle *’ which manages a single state machine and connection (and therefore no nbd_connection). To connect to a multi-conn server you must
2019 Aug 23
2
[nbdkit PATCH 3/3] plugins: Add .can_fast_zero hook
...flags & ~(NBDKIT_FLAG_FUA | NBDKIT_FLAG_MAY_TRIM))); + assert (!(flags & ~(NBDKIT_FLAG_FUA | NBDKIT_FLAG_MAY_TRIM | + NBDKIT_FLAG_FAST_ZERO))); if (!(flags & NBDKIT_FLAG_MAY_TRIM)) f |= LIBNBD_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)); retu...
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
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: