search for: nbd_unlocked_is_read_on

Displaying 10 results from an estimated 10 matches for "nbd_unlocked_is_read_on".

2019 Aug 06
0
[PATCH libnbd 1/3] api: Change nbd_read_only -> nbd_is_read_only.
...args = []; ret = RBool; permitted_states = [ Connected; Closed ]; diff --git a/lib/flags.c b/lib/flags.c index cdbc28f..2bcacb8 100644 --- a/lib/flags.c +++ b/lib/flags.c @@ -65,7 +65,7 @@ get_flag (struct nbd_handle *h, uint16_t flag) } int -nbd_unlocked_read_only (struct nbd_handle *h) +nbd_unlocked_is_read_only (struct nbd_handle *h) { return get_flag (h, NBD_FLAG_READ_ONLY); } diff --git a/lib/rw.c b/lib/rw.c index bba62be..50ba23d 100644 --- a/lib/rw.c +++ b/lib/rw.c @@ -341,7 +341,7 @@ nbd_unlocked_aio_pwrite_callback (struct nbd_handle *h, const void *buf, { struct command_cb cb = { .comple...
2020 Sep 04
0
[libnbd PATCH 1/2] api: Add nbd_set_strict_mode
...does not support the DF flag"); + return -1; + } } return nbd_internal_command_common (h, flags, NBD_CMD_READ, offset, count, @@ -313,20 +317,22 @@ nbd_unlocked_aio_pwrite (struct nbd_handle *h, const void *buf, { struct command_cb cb = { .completion = completion }; - if (nbd_unlocked_is_read_only (h) == 1) { - set_error (EPERM, "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"); +...
2020 Sep 11
0
[libnbd PATCH v2 3/5] api: Add nbd_set_strict_mode
...1) { + set_error (EINVAL, "server does not support the DF flag"); + return -1; + } } SET_CALLBACK_TO_NULL (*chunk); @@ -315,15 +317,17 @@ nbd_unlocked_aio_pwrite (struct nbd_handle *h, const void *buf, { struct command_cb cb = { .completion = *completion }; - if (nbd_unlocked_is_read_only (h) == 1) { - set_error (EPERM, "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"); +...
2019 Aug 06
5
[PATCH libnbd 0/3] One API and small documentation changes.
One API change, some small documentation changes.
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 13
0
[PATCH libnbd 1/4] api: Combine callback and user_data into a single struct.
...et, nbd_completion_callback completion, - void *user_data, uint32_t flags) { - struct command_cb cb = { .completion = completion, .user_data = user_data, }; + struct command_cb cb = { .completion = completion }; if (nbd_unlocked_is_read_only (h) == 1) { set_error (EINVAL, "server does not support write operations"); @@ -336,10 +336,9 @@ nbd_unlocked_aio_pwrite (struct nbd_handle *h, const void *buf, int64_t nbd_unlocked_aio_flush (struct nbd_handle *h, nbd_completion_callback completion, -...
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
2020 Sep 07
0
[libnbd PATCH 1/2] generator: Refactor handling of closures in unlocked functions
...offset, - nbd_completion_callback completion, + nbd_completion_callback *completion, uint32_t flags) { - struct command_cb cb = { .completion = completion }; + struct command_cb cb = { .completion = *completion }; if (nbd_unlocked_is_read_only (h) == 1) { set_error (EPERM, "server does not support write operations"); @@ -335,10 +335,10 @@ nbd_unlocked_aio_pwrite (struct nbd_handle *h, const void *buf, int64_t nbd_unlocked_aio_flush (struct nbd_handle *h, - nbd_completion_callback completion, +...
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
2020 Sep 07
4
[libnbd PATCH 0/2] Fix memory leak with closures
As promised in my earlier thread on libnbd completion callback question. Eric Blake (2): generator: Refactor handling of closures in unlocked functions generator: Free closures on failure docs/libnbd.pod | 2 +- generator/C.ml | 48 +++++++++++------ generator/C.mli | 1 + lib/debug.c | 7 +-- lib/opt.c | 31 ++++++-----