search for: libnbd_cmd_flag_req_on

Displaying 19 results from an estimated 19 matches for "libnbd_cmd_flag_req_on".

2019 May 28
0
[libnbd PATCH 2/4] api: Rearrange flags argument to block_status
...} - if (nbd_block_status (nbd, exportsize, 0, 0, NULL, cb) == -1) { + if (nbd_block_status (nbd, exportsize, 0, NULL, cb, 0) == -1) { fprintf (stderr, "%s\n", nbd_get_error ()); exit (EXIT_FAILURE); } assert (calls == 0x11); - if (nbd_block_status (nbd, exportsize, 0, LIBNBD_CMD_FLAG_REQ_ONE, - &exportsize, cb) == -1) { + if (nbd_block_status (nbd, exportsize, 0, &exportsize, cb, + LIBNBD_CMD_FLAG_REQ_ONE) == -1) { fprintf (stderr, "%s\n", nbd_get_error ()); exit (EXIT_FAILURE); } diff --git a/lib/rw.c b/lib...
2020 Sep 04
0
[libnbd PATCH 1/2] api: Add nbd_set_strict_mode
...== NULL) { + set_error (ENOTSUP, "did not negotiate any metadata contexts, " + "either you did not call nbd_add_meta_context before " + "connecting or the server does not support it"); + return -1; + } - if ((flags & ~LIBNBD_CMD_FLAG_REQ_ONE) != 0) { - set_error (EINVAL, "invalid flag: %" PRIu32, flags); - return -1; + if ((flags & ~LIBNBD_CMD_FLAG_REQ_ONE) != 0) { + set_error (EINVAL, "invalid flag: %" PRIu32, flags); + return -1; + } } if (count == 0) { /* NBD protocol...
2019 Jul 16
1
[libnbd PATCH] generator: Prefer closure opaque after function pointer in C
...rror ()); exit (EXIT_FAILURE); } assert (data.seen_base && data.seen_dirty); data = (struct data) { .req_one = true, .count = 2, }; - if (nbd_block_status (nbd, exportsize, 0, &data, cb, + if (nbd_block_status (nbd, exportsize, 0, cb, &data, LIBNBD_CMD_FLAG_REQ_ONE) == -1) { fprintf (stderr, "%s\n", nbd_get_error ()); exit (EXIT_FAILURE); @@ -153,7 +153,7 @@ main (int argc, char *argv[]) /* Trigger a failed callback, to prove connection stays up. */ data = (struct data) { .count = 2, .fail = true, }; - if (nbd_block_status (nbd, e...
2019 May 28
6
[RFC libnbd PATCH 0/4] Add CMD_FLAG_DF support
RFC because this is an API break, but we haven't declared stable API yet. If we like it, I'm working on using libnbd to implement the nbdkit-nbd plugin; knowing whether it is API version 0.1 or 0.2 will be useful. I also dabbled with allowing optional parameters in python, although my OCaml is weak enough that there may be cleaner ways to approach that. Eric Blake (4): api: Add flags
2019 Jun 04
0
[libnbd PATCH 2/2] api: Recover from block status callback failure
...; } - assert (calls == 0x11); - if (nbd_block_status (nbd, exportsize, 0, &exportsize, cb, + assert (data.seen_base && data.seen_dirty); + + data = (struct data) { .req_one = true, .count = 2, }; + if (nbd_block_status (nbd, exportsize, 0, &data, cb, LIBNBD_CMD_FLAG_REQ_ONE) == -1) { fprintf (stderr, "%s\n", nbd_get_error ()); exit (EXIT_FAILURE); } - assert (calls == 0x22); + assert (data.seen_base && data.seen_dirty); + + /* Trigger a failed callback, to prove connection stays up. No way + * to know which context will respond fir...
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
2019 Aug 15
3
[nbdkit PATCH] nbd: Another libnbd version bump
...ies % 2 == 0); while (nr_entries) { /* We rely on the fact that NBDKIT_EXTENT_* match NBD_STATE_* */ @@ -797,14 +791,12 @@ nbdplug_extents (void *handle, uint32_t count, uint64_t offset, struct handle *h = handle; struct transaction s; uint32_t f = flags & NBDKIT_FLAG_REQ_ONE ? LIBNBD_CMD_FLAG_REQ_ONE : 0; + nbd_extent_callback extcb = { nbdplug_extent, extents }; assert (!(flags & ~NBDKIT_FLAG_REQ_ONE)); nbdplug_prepare (&s); - s.extents = extents; - nbdplug_register (h, &s, nbd_aio_block_status_callback (h->nbd, count, offset, -...
2019 Jun 04
3
[libnbd PATCH 0/2] Better handling of failed block_status callback
Rather than moving the connection to DEAD, we can just ignore further contexts to the existing command handle, and fail the overall command with the same errno as the failed callback. Eric Blake (2): states: Track cmd->error as errno, not wire value api: Recover from block status callback failure generator/generator | 5 ++- generator/states-reply-simple.c | 2 +-
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 Aug 13
0
[PATCH libnbd 1/4] api: Combine callback and user_data into a single struct.
...data.seen_dirty); data = (struct data) { .req_one = true, .count = 2, }; - if (nbd_block_status (nbd, exportsize, 0, cb, &data, + if (nbd_block_status (nbd, exportsize, 0, + (nbd_extent_callback) { .callback = cb, .user_data = &data }, LIBNBD_CMD_FLAG_REQ_ONE) == -1) { fprintf (stderr, "%s\n", nbd_get_error ()); exit (EXIT_FAILURE); @@ -156,7 +159,9 @@ main (int argc, char *argv[]) /* Trigger a failed callback, to prove connection stays up. */ data = (struct data) { .count = 2, .fail = true, }; - if (nbd_block_status (nbd,...
2020 Sep 11
0
[libnbd PATCH v2 2/5] generator: Refactor filtering of accepted OFlags
...-1; - } - if ((flags & LIBNBD_CMD_FLAG_FUA) != 0 && nbd_unlocked_can_fua (h) != 1) { set_error (EINVAL, "server does not support the FUA flag"); @@ -504,11 +464,6 @@ nbd_unlocked_aio_block_status (struct nbd_handle *h, return -1; } - if ((flags & ~LIBNBD_CMD_FLAG_REQ_ONE) != 0) { - set_error (EINVAL, "invalid flag: %" PRIu32, flags); - return -1; - } - if (count == 0) { /* NBD protocol forbids this. */ set_error (EINVAL, "count cannot be 0"); return -1; -- 2.28.0
2020 Sep 11
0
[libnbd PATCH v2 3/5] api: Add nbd_set_strict_mode
...nk "is_read_only"; + Link "can_fast_zero"; Link "aio_zero"; + Link "set_strict_mode"]; }; "block_status", { @@ -1792,9 +1869,10 @@ The C<flags> parameter may be C<0> for no flags, or may contain C<LIBNBD_CMD_FLAG_REQ_ONE> meaning that the server should return only one extent per metadata context where that extent does not exceed C<count> bytes; however, libnbd does not -validate that the server obeyed the flag."; +validate that the server obeyed the flag." +^ strict_call_description; see_...
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 May 30
0
[nbdkit PATCH 3/4] nbd: Use libnbd 0.1
...2_t count, uint64_t offset, @@ -1311,12 +712,20 @@ nbdplug_extents (void *handle, uint32_t count, uint64_t offset, { struct handle *h = handle; struct transaction *s; - uint32_t f = flags & NBDKIT_FLAG_REQ_ONE ? NBD_CMD_FLAG_REQ_ONE : 0; + uint32_t f = flags & NBDKIT_FLAG_REQ_ONE ? LIBNBD_CMD_FLAG_REQ_ONE : 0; + struct nbdplug_extent_data data = { extents, 0 }; + int r; - assert (!(flags & ~NBDKIT_FLAG_REQ_ONE) && h->extents); - s = nbdplug_request_full (h, f, NBD_CMD_BLOCK_STATUS, offset, count, NULL, - NULL, extents); - return nbdplug_reply (h, s);...
2019 Jun 12
0
[nbdkit PATCH v3 3/5] nbd: Use libnbd 0.1.3+
...2_t count, uint64_t offset, @@ -1316,11 +692,11 @@ nbdplug_extents (void *handle, uint32_t count, uint64_t offset, { struct handle *h = handle; struct transaction *s; - uint32_t f = flags & NBDKIT_FLAG_REQ_ONE ? NBD_CMD_FLAG_REQ_ONE : 0; + uint32_t f = flags & NBDKIT_FLAG_REQ_ONE ? LIBNBD_CMD_FLAG_REQ_ONE : 0; - assert (!(flags & ~NBDKIT_FLAG_REQ_ONE) && h->extents); - s = nbdplug_request_full (h, f, NBD_CMD_BLOCK_STATUS, offset, count, NULL, - NULL, extents); + assert (!(flags & ~NBDKIT_FLAG_REQ_ONE)); + s = nbdplug_register (h, nbd_aio_block_stat...
2019 Aug 13
8
[PATCH libnbd 0/4] Add free function to callbacks.
Patches 1 & 2 are rather complex, but the end result is that we pass closures + user_data + free function in single struct parameters as I described previously in this email: https://www.redhat.com/archives/libguestfs/2019-August/msg00210.html Patch 3 adds a convenient FREE_CALLBACK macro which seems a worthwhile simplification if you buy into 1 & 2. Patch 4 adds another macro which is
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