search for: nbd_aio_block_status

Displaying 20 results from an estimated 24 matches for "nbd_aio_block_status".

2019 Aug 14
3
[libnbd PATCH 0/2] Drop generated file from git
Rich recently patched things to generate one man page per function rather than libnbd-api.3 (nice), but in doing so got stumped by a problem with a fresh git clone (automake fails for any 'include' directive that does not already exist). I've figured out how to hack around it, but the hack requires GNU make. We already use GNU make constructs elsewhere (such as $(wildcard)), but
2019 Jun 04
1
Re: [PATCH libnbd v2 2/4] generator: Callback returns int instead of void.
...ed on a configure check or on hard-coded version information - we don't yet have a LIBNBD_VERSION macro in libnbd.h, but my recent addition LIBNBD_HAVE_NBD_SUPPORTS_URI can serve as a hack witness for 0.1.2 vs. later) where I declare a typedef to the two different function signatures, then call nbd_aio_block_status(..., (type)myfunc) where the cast to (type) is a no-op for 0.1.x and casts the return type of int to void for 0.1.2. On the other hand, changing my nbdkit-nbd patches to use pkg-config to require 0.1.3 or newer is also easy, at which point I don't have to worry about back-compat to the older A...
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
2020 Sep 07
0
[libnbd PATCH 2/2] generator: Free closures on failure
...r support. + */ + block_status_cb_called = block_status_cb_freed = + completion_cb_called = completion_cb_freed = 0; + nbd = nbd_create (); + if (nbd == NULL) NBD_ERROR; + /* Intentionally omit a call to: + * nbd_add_meta_context (nbd, LIBNBD_CONTEXT_BASE_ALLOCATION); + */ + cookie = nbd_aio_block_status (nbd, sizeof buf, 0, + (nbd_extent_callback) { .callback = block_status_cb, + .free = block_status_cb_free }, + (nbd_completion_callback) { .callback = completion_cb, +...
2019 Jul 22
0
Re: [libnbd] More thoughts on callbacks and more
...char *msg), > void *user_data); Would the 'valid_flag' be presented to non-C bindings, or is it only needed for C code? At any rate, the idea makes sense as a lighter-weight way for libnbd to always inform the callback about the last invocation. For nbd_aio_pread_structured and nbd_aio_block_status, the chunk/extent callback can either match server state (if the server replies replies with NBD_REPLY_FLAG_DONE on an OFFSET_DATA/BLOCK_STATUS reply, we could set VALID|FREE; if the server defers NBD_REPLY_FLAG_DONE to an NBD_REPLY_TYPE_NONE packet then the two flags will definitely not be set at...
2019 Jun 29
1
Re: [libnbd PATCH 5/6] api: Add new nbd_aio_FOO_notify functions
Obvious change given the previous patch, so ACK. I do wonder if we should make the notify parameter mandatory (and therefore avoid the duplicate functions). Another trick you might do if feeling really keen is to programmatically generate the notify variants of commands, something like this: let make_notify_variant_of_call ({ args; longdesc } as call) = let args = List.rev args in let
2019 Jun 20
1
Re: [libnbd PATCH 5/8] states: Wire in a read callback
On Mon, Jun 17, 2019 at 07:07:55PM -0500, Eric Blake wrote: > + errno = nbd_internal_errno_of_nbd_error (error); > + set_error (errno, "server reported read failure at offset 0x%" PRIx64, > + offset); > + if (cmd->cb.fn.read (cmd->cb.opaque, cmd->data + (offset - cmd->offset), > + 0, offset,
2019 Aug 14
0
[libnbd PATCH 2/2] docs: Drop docs/Makefile.inc from git
...us \ - nbd_poll \ - nbd_aio_connect \ - nbd_aio_connect_uri \ - nbd_aio_connect_unix \ - nbd_aio_connect_tcp \ - nbd_aio_connect_command \ - nbd_aio_pread \ - nbd_aio_pread_structured \ - nbd_aio_pwrite \ - nbd_aio_disconnect \ - nbd_aio_flush \ - nbd_aio_trim \ - nbd_aio_cache \ - nbd_aio_zero \ - nbd_aio_block_status \ - nbd_aio_get_fd \ - nbd_aio_get_direction \ - nbd_aio_notify_read \ - nbd_aio_notify_write \ - nbd_aio_is_created \ - nbd_aio_is_connecting \ - nbd_aio_is_ready \ - nbd_aio_is_processing \ - nbd_aio_is_dead \ - nbd_aio_is_closed \ - nbd_aio_command_completed \ - nbd_aio_peek_command_completed \...
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 ++++++-----
2019 Aug 15
1
[PATCH libnbd] docs: Change docs/Makefile.inc back to a regular include, readd to git.
...us \ + nbd_poll \ + nbd_aio_connect \ + nbd_aio_connect_uri \ + nbd_aio_connect_unix \ + nbd_aio_connect_tcp \ + nbd_aio_connect_command \ + nbd_aio_pread \ + nbd_aio_pread_structured \ + nbd_aio_pwrite \ + nbd_aio_disconnect \ + nbd_aio_flush \ + nbd_aio_trim \ + nbd_aio_cache \ + nbd_aio_zero \ + nbd_aio_block_status \ + nbd_aio_get_fd \ + nbd_aio_get_direction \ + nbd_aio_notify_read \ + nbd_aio_notify_write \ + nbd_aio_is_created \ + nbd_aio_is_connecting \ + nbd_aio_is_ready \ + nbd_aio_is_processing \ + nbd_aio_is_dead \ + nbd_aio_is_closed \ + nbd_aio_command_completed \ + nbd_aio_peek_command_completed \...
2019 Sep 17
0
[PATCH libnbd 2/2] api: New API for reading NBD protocol.
...t_state with + name = "FINISHED"; + comment = "Finish off newstyle negotiation"; + }; ] (* Fixed newstyle NBD_OPT_STARTTLS option. *) @@ -1574,6 +1584,20 @@ are free to pass in other contexts." "L<nbd_block_status(3)>"; "L<nbd_aio_block_status(3)>"]; }; + "get_protocol", { + default_call with + args = []; ret = RStaticString; + permitted_states = [ Connected; Closed ]; + shortdesc = "return the NBD protocol variant"; + longdesc = "\ +Return the NBD protocol variant in use on the conne...
2019 Jul 22
3
Re: [libnbd] More thoughts on callbacks and more
On Mon, Jul 22, 2019 at 10:08:25AM +0100, Richard W.M. Jones wrote: > On Sat, Jul 20, 2019 at 07:38:45AM +0100, Richard W.M. Jones wrote: > > More thoughts on callbacks, etc. following on from: > > https://www.redhat.com/archives/libguestfs/2019-July/thread.html#00184 > > > > Closure lifetimes > > ----------------- Here's a possibly better idea which still
2019 Jul 27
3
[PATCH libnbd] lib: Use symbol versions.
...rs to be working in as much as I can see the symbol versions appearing, and the test/example programs continue to run. $ nm -D --with-symbol-versions lib/.libs/libnbd.so.0 | grep LIBNBD 0000000000000000 A LIBNBD_1.0@@LIBNBD_1.0 0000000000005470 T nbd_add_meta_context@@LIBNBD_1.0 00000000000085d0 T nbd_aio_block_status@@LIBNBD_1.0 0000000000008710 T nbd_aio_block_status_callback@@LIBNBD_1.0 0000000000008110 T nbd_aio_cache@@LIBNBD_1.0 0000000000008230 T nbd_aio_cache_callback@@LIBNBD_1.0 00000000000089e0 T nbd_aio_command_completed@@LIBNBD_1.0 0000000000006f20 T nbd_aio_connect@@LIBNBD_1.0 0000000000007320 T nbd_...
2019 Jul 01
0
[nbdkit PATCH 2/2] nbd: Use nbdkit aio_*_notify variants
...&s, nbdplug_notify, 0)); return nbdplug_reply (h, &s); } @@ -816,8 +776,9 @@ nbdplug_extents (void *handle, uint32_t count, uint64_t offset, assert (!(flags & ~NBDKIT_FLAG_REQ_ONE)); nbdplug_prepare (&s); s.extents = extents; - nbdplug_register (h, &s, nbd_aio_block_status (h->nbd, count, offset, - &s, nbdplug_extent, f)); + nbdplug_register (h, &s, nbd_aio_block_status_notify (h->nbd, count, offset, + &s, nbdplug_extent, +...
2019 Jun 04
0
[PATCH libnbd v2 2/4] generator: Callback returns int instead of void.
Callback functions now return an int instead of a void. This allows in some cases for the callback to indicate that there was an error. This is a small change to the API: For nbd_set_debug_callback the signature has changed, but the return value is ignored. For nbd_block_status and nbd_aio_block_status the extent function can return an error, which causes the block status command to return an error. Unfortunately this causes us to set the state to dead, although with more effort we could recover from this. Because of this behaviour I didn't document what happens in the error case as we may...
2019 Aug 15
3
[nbdkit PATCH] nbd: Another libnbd version bump
...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, - nbdplug_extent, &s, - nbdplug_notify, &s, - f)); + nbdplug_register (h, &s, n...
2019 Sep 17
3
[PATCH libnbd 1/2] api: Add new API to read whether TLS was negotiated.
When LIBNBD_TLS_ALLOW is used we don't have a way to find out if TLS was really negotiated. This adds a flag and a way to read it back. Unfortunately there is no test yet, because LIBNBD_TLS_ALLOW is not tested -- it really should be but requires quite a complicated set of tests because ideally we'd like to find out whether it falls back correctly for all supported servers. --- TODO
2019 Jun 04
9
[PATCH libnbd v2 0/4] api: Implement concurrent writer.
v1: https://www.redhat.com/archives/libguestfs/2019-June/msg00014.html I pushed a few bits which are uncontroversial. The main changes since v1 are: An extra patch removes the want_to_send / check for nbd_aio_is_ready in examples/threaded-reads-and-writes.c. This logic was wrong since commit 6af72b87 as was pointed out by Eric in his review. Comments and structure of
2019 May 30
0
[nbdkit PATCH 3/4] nbd: Use libnbd 0.1
...amp;& h->extents); - s = nbdplug_request_full (h, f, NBD_CMD_BLOCK_STATUS, offset, count, NULL, - NULL, extents); - return nbdplug_reply (h, s); + assert (!(flags & ~NBDKIT_FLAG_REQ_ONE)); + /* XXX API changes in libnbd 0.1.2: */ + s = nbdplug_register (h, nbd_aio_block_status (h->nbd, count, offset, f, + &data, nbdplug_extent /* , f */)); + r = nbdplug_reply (h, s); + if (r == 0 && data.err) { + errno = data.err; + r = -1; + } + return r; } /* Cache a portion of the file. */ @@ -1327,7 +736,8 @@...
2019 Jun 12
0
[nbdkit PATCH v3 3/5] nbd: Use libnbd 0.1.3+
...BD_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_status (h->nbd, count, offset, + extents, nbdplug_extent, f)); return nbdplug_reply (h, s); } @@ -1332,7 +708,7 @@ nbdplug_cache (void *handle, uint32_t count, uint64_t offset, uint32_t flags) struct transaction *s; assert (!flags); - s = nbd...