search for: output_return

Displaying 16 results from an estimated 16 matches for "output_return".

2018 Jan 28
0
[nbdkit PATCH 2/2] filters: Add log filter
...act); + if (id) + fprintf (logfile, "id=%" PRIu64 " ", id); + va_start (args, fmt); + vfprintf (logfile, fmt, args); + va_end (args); + fputc ('\n', logfile); + funlockfile (logfile); +} + +/* Shared code for a nicer log of return value */ +static void +output_return (struct handle *h, const char *act, uint64_t id, int r) +{ + const char *s = "Other=>EINVAL"; + + /* Only decode what connections.c:nbd_errno() recognizes */ + switch (r) { + case 0: + s = "Success"; + break; + case EROFS: + s = "EROFS=>EPERM"; +...
2020 Jul 22
1
Re: [PATCH nbdkit] server: Pass the export name through filter .open calls.
...-inner order of .open is (intentionally) opposite the inner-to-outer order of .prepare, and the name passed to plugin.open has indeed left scope. Unless we want backend.c to start storing the name passed into backend_open(). > >> +++ b/filters/log/log.c >> @@ -227,11 +227,12 @@ output_return (struct handle *h, const char >> *act, uint64_t id, int r, int *err) >>   /* Open a connection. */ >>   static void * >> -log_open (nbdkit_next_open *next, void *nxdata, int readonly) >> +log_open (nbdkit_next_open *next, void *nxdata, >> +          int readonly...
2018 Jan 28
3
[nbdkit PATCH 0/2] RFC: tweak error handling, add log filter
Here's what I'm currently playing with; I'm not ready to commit anything until I rebase my FUA work on top of this, as I only want to break filter ABI once between releases. Eric Blake (2): backend: Rework internal/filter error return semantics filters: Add log filter TODO | 2 - docs/nbdkit-filter.pod | 84 +++++++-- docs/nbdkit.pod
2019 Mar 26
0
[PATCH nbdkit v4 08/15] log: Log extents requests.
...(NBDKIT_FLAG_REQ_ONE))); + output (h, "Extents", id, + "offset=0x%" PRIx64 " count=0x%x req_one=%d ...", + offs, count, !!(flags & NBDKIT_FLAG_REQ_ONE)); + r = next_ops->extents (nxdata, count, offs, flags, extents, err); + if (r == -1) + output_return (h, "...Extents", id, r, err); + else { + FILE *fp; + char *extents_str = NULL; + size_t i, n, len = 0; + + fp = open_memstream (&extents_str, &len); + if (fp != NULL) { + n = nbdkit_extents_count (extents); + for (i = 0; i < n; ++i) { + struct...
2019 Mar 28
0
[PATCH nbdkit v5 FINAL 09/19] log: Log extents requests.
...(NBDKIT_FLAG_REQ_ONE))); + output (h, "Extents", id, + "offset=0x%" PRIx64 " count=0x%x req_one=%d ...", + offs, count, !!(flags & NBDKIT_FLAG_REQ_ONE)); + r = next_ops->extents (nxdata, count, offs, flags, extents, err); + if (r == -1) + output_return (h, "...Extents", id, r, err); + else { + FILE *fp; + char *extents_str = NULL; + size_t i, n, len = 0; + + fp = open_memstream (&extents_str, &len); + if (fp != NULL) { + n = nbdkit_extents_count (extents); + for (i = 0; i < n; ++i) { + struct...
2020 Jul 22
0
Re: [PATCH nbdkit] server: Pass the export name through filter .open calls.
...e both the original readonly and exportname passed to backend_open(), rather than making the filter have to save it off in the filter? It looks like protocol-handshake.c is the only caller, and still has everything in scope at the time. > +++ b/filters/log/log.c > @@ -227,11 +227,12 @@ output_return (struct handle *h, const char *act, uint64_t id, int r, int *err) > > /* Open a connection. */ > static void * > -log_open (nbdkit_next_open *next, void *nxdata, int readonly) > +log_open (nbdkit_next_open *next, void *nxdata, > + int readonly, const char *exportna...
2018 Feb 01
6
[nbdkit PATCH v2 0/3] add log, blocksize filters
Since v1: add the blocksize filter, add testsuite coverage of the log filter, several fixes to the log filter based on what adding tests revealed I'm still working on FUA flag support patches on top of this; the patches should all be committed in the same release, as we want to minimize the number of releases that cause a filter ABI/API bump Eric Blake (3): backend: Rework internal/filter
2020 Jul 21
4
[PATCH nbdkit] server: Pass the export name through filter .open calls.
...ext (nxdata, readonly) == -1) + if (next (nxdata, readonly, exportname) == -1) return NULL; ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&lock); diff --git a/filters/log/log.c b/filters/log/log.c index f47a6a93..8b146f1c 100644 --- a/filters/log/log.c +++ b/filters/log/log.c @@ -227,11 +227,12 @@ output_return (struct handle *h, const char *act, uint64_t id, int r, int *err) /* Open a connection. */ static void * -log_open (nbdkit_next_open *next, void *nxdata, int readonly) +log_open (nbdkit_next_open *next, void *nxdata, + int readonly, const char *exportname) { struct handle *h; -...
2020 Aug 06
6
[nbdkit PATCH v2 0/5] .list_exports
Since v1: - patch 1: check size limits - patch 2: better handling of default export name canonicalization - patch 3: support filters as well as plugins - patch 4: new - patch 5: rewrite sh parser, fix testsuite to actually work and cover more cases (now that libnbd.git is fixed) Eric Blake (4): server: Add exports list functions server: Prepare to use export list from plugin log: Add
2018 Mar 08
19
[nbdkit PATCH v3 00/15] Add FUA support to nbdkit
After more than a month since v2 [1], I've finally got my FUA support series polished. This is all of my outstanding patches, even though some of them were originally posted in separate threads from the original FUA post [2], [3] [1] https://www.redhat.com/archives/libguestfs/2018-January/msg00113.html [2] https://www.redhat.com/archives/libguestfs/2018-January/msg00219.html [3]
2019 Mar 28
32
[PATCH nbdkit v5 FINAL 00/19] Implement extents.
This has already been pushed upstream. I am simply posting these here so we have a reference in the mailing list in case we find bugs later (as I'm sure we will - it's a complex patch series). Great thanks to Eric Blake for tireless review on this one. It also seems to have identified a few minor bugs in qemu along the way. Rich.
2020 Aug 27
10
[nbdkit PATCH v2 0/8] exportname filter
This is a revision of my .default_export work, plus new work on .export_descriptions and a new exportname filter. I think it is now ready to check in. Things I'd still like in 1.22: - the file plugin should implement .list_exports (patch already posted, but it needs rebasing on this series) - the ext2 filter should override .list_exports when in exportname mode - the nbd plugin should be
2019 Mar 26
21
[PATCH nbdkit v4 00/15] Implement Block Status.
I'm not sure exactly which version we're up to, but let's say it's version 4. I'm a lot happier with this version: - all filters have been reviewed and changed where I think that's necessary - can_extents is properly defined and implemented now - NBD protocol is followed - I believe it addresses all previous review points where possible The "only" thing
2020 Sep 21
18
[nbdkit PATCH v3 00/14] exportname filter
It's been several weeks since I posted v2 (I got distracted by improving libnbd to better test things, which in turn surfaced some major memory leak problems in nbdsh that are now fixed). Many of the patches are minor rebases from v2, with the biggest changes being fallout from: - patch 2: rename nbdkit_add_default_export to nbdkit_use_default_export - overall: this missed 1.22, so update
2019 May 16
27
[nbdkit PATCH v2 00/24] implement NBD_CMD_CACHE
Since v1: - rework .can_cache to be tri-state, with default of no advertisement (ripple effect through other patches) - add a lot more patches in order to round out filter support And in the meantime, Rich pushed NBD_CMD_CACHE support into libnbd, so in theory we now have a way to test cache commands through the entire stack. Eric Blake (24): server: Internal hooks for implementing
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