search for: nbdkit_debug

Displaying 20 results from an estimated 392 matches for "nbdkit_debug".

2020 Jun 02
0
[PATCH nbdkit 3/5] vddk: Miscellaneous improvements to reexec code.
...,42 +95,40 @@ perform_reexec (const char *env, const char *prepend) * until we get a short read. This assumes nbdkit did not alter its * original argv[]. */ - fd = open ("/proc/self/cmdline", O_RDONLY); + fd = open (cmdline_file, O_RDONLY|O_CLOEXEC); if (fd == -1) { - nbdkit_debug ("failure to parse original argv: %m"); + nbdkit_debug ("open: %s: %m", cmdline_file); return; } - do { - char *p = realloc (buf, buflen * 2); + for (;;) { ssize_t r; - if (!p) { - nbdkit_debug ("failure to parse original argv: %m"); +...
2020 Jun 02
0
[PATCH nbdkit 2/5] vddk: Move reexec code to a new file.
...s not make it easy to know in advance how large + * it was, so we just slurp in the whole file, doubling our reads + * until we get a short read. This assumes nbdkit did not alter its + * original argv[]. + */ + fd = open ("/proc/self/cmdline", O_RDONLY); + if (fd == -1) { + nbdkit_debug ("failure to parse original argv: %m"); + return; + } + + do { + char *p = realloc (buf, buflen * 2); + ssize_t r; + + if (!p) { + nbdkit_debug ("failure to parse original argv: %m"); + return; + } + buf = p; + buflen *= 2; + r = read (fd, buf...
2020 Mar 31
2
[nbdkit PATCH] retry: Tweak error message
..., 1 deletion(-) diff --git a/filters/retry/retry.c b/filters/retry/retry.c index 11e5313b..db91d7ca 100644 --- a/filters/retry/retry.c +++ b/filters/retry/retry.c @@ -173,7 +173,7 @@ do_retry (struct retry_handle *h, again: /* Log the original errno since it will be lost when we retry. */ - nbdkit_debug ("retry %d: original errno = %d", data->retry+1, *err); + nbdkit_debug ("retry attempt %d: original errno = %d", data->retry, *err); if (data->retry >= retries) { nbdkit_debug ("could not recover after %d retries", retries); -- 2.26.0.rc2
2020 Jun 02
9
[PATCH nbdkit 0/5] vddk: Fix password parameter.
Probably needs a bit of cleanup, but seems like it is generally the right direction. One thing I've noticed is that the expect test randomly (but rarely) hangs :-( I guess something is racey but I don't know what at the moment. Rich.
2020 Feb 10
2
[nbdkit PATCH 05/10] plugins: Wire up file-based plugin support for NBD_INFO_INIT_STATE
...test to see whether SEEK_DATA/SEEK_HOLE are likely to work on + * the current filesystem, and to see if the image is sparse or zero. + */ + ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&lseek_lock); + r = lseek (h->fd, 0, SEEK_DATA); + if (r == -1) { + if (errno == ENXIO) { + nbdkit_debug ("extents enabled, entire image is hole"); + h->can_extents = true; + h->init_sparse = true; + h->init_zero = true; + } else { + nbdkit_debug ("extents disabled: lseek(SEEK_DATA): %m"); + } + } + else { + h->can_extent...
2019 Nov 02
2
[PATCH nbdkit] server: Use GCC hints to move debug and error handling code out of hot paths.
For GCC only, define unlikely() macro. Use it on error paths to move code out of the hot path. In the server only, use the debug() macro (don't call nbdkit_debug directly). This macro checks the verbose flag and moves the call to nbdkit_debug out of the hot path. --- server/connections.c | 11 ++++++----- server/internal.h | 17 ++++++++++++++++- server/plugins.c | 2 +- server/protocol.c | 4 ++-- server/sockets.c | 4 ++-- 5 files chang...
2019 May 30
0
[nbdkit PATCH 3/4] nbd: Use libnbd 0.1
...is no hope of - * resynchronizing with the server, and all further requests from the - * client will fail. Returns -1 for convenience. */ -static int -nbdplug_mark_dead (struct handle *h) -{ - int err = errno; - - ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&h->trans_lock); - if (!h->dead) { - nbdkit_debug ("permanent failure while talking to server %s: %m", - servname); - h->dead = true; - } - else if (!err) - errno = ESHUTDOWN; - /* NBD only accepts a limited set of errno values over the wire, and - nbdkit converts all other values to EINVAL. If we died du...
2019 Jun 12
0
[nbdkit PATCH v3 3/5] nbd: Use libnbd 0.1.3+
...is no hope of - * resynchronizing with the server, and all further requests from the - * client will fail. Returns -1 for convenience. */ -static int -nbdplug_mark_dead (struct handle *h) -{ - int err = errno; - - ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&h->trans_lock); - if (!h->dead) { - nbdkit_debug ("permanent failure while talking to server %s: %m", - servname); - h->dead = true; - } - else if (!err) - errno = ESHUTDOWN; - /* NBD only accepts a limited set of errno values over the wire, and - nbdkit converts all other values to EINVAL. If we died du...
2019 Apr 23
0
[nbdkit PATCH 7/7] nbd: Implement structured replies
...lt; 0) + /* magic and handle overlap between simple and structured replies */ + if (read_full (h->fd, &rep, sizeof rep.simple)) return nbd_mark_dead (h); - if (be32toh (rep.magic) != NBD_SIMPLE_REPLY_MAGIC) + switch (be32toh (rep.simple.magic)) { + case NBD_SIMPLE_REPLY_MAGIC: + nbdkit_debug ("received simple reply for cookie %#" PRIx64 ", status %s", + rep.simple.handle, + name_of_nbd_error(be32toh (rep.simple.error))); + error = be32toh (rep.simple.error); + break; + case NBD_STRUCTURED_REPLY_MAGIC: + if (!h->structur...
2020 Feb 11
0
Re: [nbdkit PATCH 05/10] plugins: Wire up file-based plugin support for NBD_INFO_INIT_STATE
...HOLE are likely to work on > + * the current filesystem, and to see if the image is sparse or zero. > + */ > + ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&lseek_lock); > + r = lseek (h->fd, 0, SEEK_DATA); > + if (r == -1) { > + if (errno == ENXIO) { > + nbdkit_debug ("extents enabled, entire image is hole"); > + h->can_extents = true; > + h->init_sparse = true; > + h->init_zero = true; > + } else { > + nbdkit_debug ("extents disabled: lseek(SEEK_DATA): %m"); > + } > + }...
2020 Jun 02
2
Re: [PATCH nbdkit 3/5] vddk: Miscellaneous improvements to reexec code.
...r *env, const char *prepend) > * until we get a short read. This assumes nbdkit did not alter its > * original argv[]. > */ > - fd = open ("/proc/self/cmdline", O_RDONLY); > + fd = open (cmdline_file, O_RDONLY|O_CLOEXEC); > if (fd == -1) { > - nbdkit_debug ("failure to parse original argv: %m"); > + nbdkit_debug ("open: %s: %m", cmdline_file); > return; > } > > - do { > - char *p = realloc (buf, buflen * 2); > + for (;;) { > ssize_t r; > > - if (!p) { > - nbdki...
2020 Apr 01
2
Re: [nbdkit PATCH] retry: Tweak error message
...kit: null[1]: error: injecting EIO error into pread >> nbdkit: null[1]: debug: retry 6: original errno = 5 >> nbdkit: null[1]: debug: could not recover after 5 retries >> >> again: >> /* Log the original errno since it will be lost when we retry. */ >> - nbdkit_debug ("retry %d: original errno = %d", data->retry+1, *err); >> + nbdkit_debug ("retry attempt %d: original errno = %d", data->retry, *err); >> >> if (data->retry >= retries) { >> nbdkit_debug ("could not recover after %d retries&qu...
2019 Apr 25
6
[nbdkit PATCH v2 0/5] structured replies/.extents for nbd plugin
Updated based on other changes that have happened in the meantime: - rely more on cleanup.h (throughout) - split structured read for easier review (patch 2 and 3 were combined in v1) - rely on nbdkit not leaking a server's partial answer (patch 3) - add tests (patch 5) - other bug fixes I found while testing it - drop EOVERFLOW patch for now; it will be separate once upstream NBD protocol
2019 Jul 01
0
[nbdkit PATCH 2/2] nbd: Use nbdkit aio_*_notify variants
...bdplug_reader (void *handle) break; } } - - ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&h->trans_lock); - trans = h->trans; - prev = &h->trans; - while (trans) { - r = nbd_aio_command_completed (h->nbd, trans->cookie); - if (r == -1) { - nbdkit_debug ("transaction %" PRId64 " failed: %s", trans->cookie, - nbd_get_error ()); - trans->err = nbd_get_errno (); - if (!trans->err) - trans->err = EIO; - } - if (r) { - nbdkit_debug ("cookie %" PRId64...
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 Aug 18
2
Re: [PATCH nbdkit 1/9] server: Add libnbdkit.so.
On 8/18/20 8:53 AM, Richard W.M. Jones wrote: > On Tue, Aug 18, 2020 at 07:48:43AM -0500, Eric Blake wrote: >>> +extern int nbdkit_main (int argc, char *argv[]); >> >> A bit odd to declare this in a .c; but I don't see any existing >> decent .h to put it in, nor is it worth adding a new one just for >> this. So it is fine right here. > > Yup, better
2019 Jul 30
1
[PATCH nbdkit] nbd: Update for libnbd 0.9.6.
...e, 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)) { nbdkit_error ("failed to post semaphore: %m"); @@ -383,6 +388...
2019 Apr 23
0
[nbdkit PATCH 6/7] nbd: Implement NBD_OPT_GO client request
...loc: %m"); + return -1; + } + if (read_full (h->fd, buffer, reply->replylen)) { + nbdkit_error ("unable to read option reply payload: %m"); + free (buffer); + return -1; + } + buffer[reply->replylen] = '\0'; + if (!payload) { + nbdkit_debug ("ignoring option reply payload"); + free (buffer); + } + else + *payload = buffer; + } + return 0; +} + +/* Attempt to negotiate structured reads, block status, and NBD_OPT_GO. + Return 1 if haggling completed, 0 if haggling failed but + NBD_OPT_EXPORT_NAME is still...
2020 Mar 19
1
[nbdkit PATCH] nbd: Drop nbd-standalone fallback
...ere is no hope of - * resynchronizing with the server, and all further requests from the - * client will fail. Returns -1 for convenience. */ -static int -nbd_mark_dead (struct handle *h) -{ - int err = errno; - - ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&h->trans_lock); - if (!h->dead) { - nbdkit_debug ("permanent failure while talking to server %s: %m", - servname); - h->dead = true; - } - else if (!err) - errno = ESHUTDOWN; - /* NBD only accepts a limited set of errno values over the wire, and - nbdkit converts all other values to EINVAL. If we died du...
2019 Apr 23
12
[nbdkit PATCH 0/7] Implement structured replies in nbd plugin
I'm hoping to implement .extents for the nbd plugin; this is a prerequisite. I'm not sure about patch 3 - if we like it, I'll squash it to 2, if we don't, I think we are okay just dropping it. I'm also wondering if we have to worry about malicious plugins that don't populate the entire .pread buffer in an effort to get nbdkit to expose portions of the heap; my patch 7 loses