search for: export_list

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

2020 Aug 14
0
[libnbd PATCH v2 11/13] api: Add nbd_aio_opt_list
...474b..9204c11 100644 --- a/examples/list-exports.c +++ b/examples/list-exports.c @@ -30,18 +30,52 @@ #include <stdio.h> #include <stdlib.h> #include <stdint.h> +#include <string.h> #include <inttypes.h> #include <errno.h> #include <libnbd.h> +struct export_list { + int i; + char **names; +}; + +/* Callback function for nbd_opt_list */ +static int +list_one (void *opaque, const char *name, + const char *description) +{ + struct export_list *l = opaque; + char **names; + + printf ("[%d] %s\n", l->i, name); + if (*description) +...
2020 Aug 19
0
[libnbd PATCH 2/2] info: Use nbd_opt_info for fewer handles during --list
...See TODO for a suggestion on how to - * improve this. - */ static void list_all_exports (struct nbd_handle *nbd1, const char *uri) { @@ -468,31 +466,41 @@ list_all_exports (struct nbd_handle *nbd1, const char *uri) printf ("\t\"exports\": []\n"); for (i = 0; i < export_list.len; ++i) { - const char *name; + const char *name = export_list.names[i]; struct nbd_handle *nbd2; - /* Connect to the original URI, but using opt mode to alter the export. */ - name = export_list.names[i]; - nbd2 = nbd_create (); - if (nbd2 == NULL) { - fprintf (stder...
2020 Oct 27
6
[PATCH libnbd 0/5] info: --map: Coalesce adjacent extents of the same type.
This adds coalescing of adjacent extents of the same type, as mentioned by Eric Blake in the commit message here: https://github.com/libguestfs/libnbd/commit/46072f6611f80245846a445766da071e457b00cd The patch series is rather long because it detours through adding the <vector.h> library from nbdkit into libnbd and replacing ad hoc uses of realloc, char ** etc in various places. Rich.
2020 Oct 02
0
[libnbd PATCH v2 2/2] info: List available meta-contexts
...o.c b/info/nbdinfo.c index 6f5d191..5358f82 100644 --- a/info/nbdinfo.c +++ b/info/nbdinfo.c @@ -37,12 +37,18 @@ static bool json_output = false; static const char *map = NULL; static bool size_only = false; +struct context_list { + char *name; + struct context_list *next; +}; + static struct export_list { size_t len; char **names; char **descs; } export_list; +static int collect_context (void *opaque, const char *name); static int collect_export (void *opaque, const char *name, const char *desc); static void list_one_export (struct nbd_handle *nbd, const ch...
2020 Aug 18
0
[libnbd PATCH v3 2/2] api: Add nbd_aio_opt_list
...ef1b..f6200f4 100644 --- a/examples/list-exports.c +++ b/examples/list-exports.c @@ -29,18 +29,52 @@ #include <stdio.h> #include <stdlib.h> #include <stdint.h> +#include <string.h> #include <inttypes.h> #include <errno.h> #include <libnbd.h> +struct export_list { + int i; + char **names; +}; + +/* Callback function for nbd_opt_list */ +static int +list_one (void *opaque, const char *name, + const char *description) +{ + struct export_list *l = opaque; + char **names; + + printf ("[%d] %s\n", l->i, name); + if (*description) +...
2007 Sep 20
2
Search::Xapian cygwin fix
Olly, The cygwin linker requires -shared, otherwise WinMain at 16 will not be skipped. BTW: mingw also. But this should test and fix someone else. -- Reini Urban http://phpwiki.org/ http://murbreak.at/ http://spacemovie.mur.at/ http://helsinki.at/ -------------- next part -------------- A non-text attachment was scrubbed... Name: Search-Xapian-1.0.2.0-cyg.patch Type:
2020 Aug 18
3
[libnbd PATCH v3 0/2] Implementing NBD_OPT_LIST
This is a subset of my v2 posting, but limited to just the NBD_OPT_LIST handling. The biggest change since v2 is the addition of added unit testing in all four language bindings (C, python, ocaml, golang). The tests require nbdkit built from git on PATH, and may not be entirely idiomatic, but I at least validated that they catch issues (for example, adding an exit statement near the end of the
2020 Jul 22
2
Re: [PATCH nbdkit] server: Deprecate the -e/--exportname parameter.
...--run 'nbdsh -u nbd+unix:///foo\?socket=$unixsocket \ -c "print(h.pread(3, 0))"' but that's a lot more painful to write. We _don't_ need to advertise 'foo' or 'bar' over NBD_OPT_INFO (at least, not for plugins that don't implement the forthcoming .export_list callback), but _do_ need a way for the captive application (nbdsh in this case) to know _which_ export the captive should connect to. And, if we reinstate _just_ that usage of -e,... >> (4) I have temporarily disabled tests/test-long-name.sh.  This is >>      still a valid test, but...
2020 Oct 06
2
[PATCH libnbd] info: Write output atomically.
...negotiated ? "true" : "false"); } if (!list_all) @@ -321,7 +335,7 @@ main (int argc, char *argv[]) list_all_exports (nbd, argv[optind]); if (json_output) - printf ("}\n"); + fprintf (fp, "}\n"); } for (i = 0; i < export_list.len; i++) { @@ -333,6 +347,19 @@ main (int argc, char *argv[]) nbd_opt_abort (nbd); nbd_shutdown (nbd, 0); nbd_close (nbd); + + /* Close the output stream and copy it to the real stdout. */ + if (fclose (fp) == EOF) { + fprintf (stderr, "%s: ", progname); + perror ("...
2015 Dec 20
3
How to run InternalizePass
I'm working on a whole program optimizer that uses LLVM as a library, and one of the things I want to do is eliminate dead global functions and variables even when they are not local to a module. (This understandably doesn't happen by default because the optimizer has to assume it could be compiling a library rather than a program.) I've actually written a function to do this, but
2020 Oct 02
4
[libnbd PATCH v2 0/2] opt_list_meta_context
In v2: ack'ed preliminary patches have been pushed, and I've added a lot of testsuite coverage as well as putting the new API to use in nbdinfo. Eric Blake (2): api: Add nbd_opt_list_meta_context info: List available meta-contexts lib/internal.h | 1 + generator/API.ml | 84 ++++++++-
2020 Jul 22
0
Re: [PATCH nbdkit] server: Deprecate the -e/--exportname parameter.
...oo\?socket=$unixsocket \ > -c "print(h.pread(3, 0))"' > > but that's a lot more painful to write. > > We _don't_ need to advertise 'foo' or 'bar' over NBD_OPT_INFO (at > least, not for plugins that don't implement the forthcoming > .export_list callback), but _do_ need a way for the captive > application (nbdsh in this case) to know _which_ export the captive > should connect to. > > And, if we reinstate _just_ that usage of -e,... > > >>(4) I have temporarily disabled tests/test-long-name.sh.  This is > >&...
2020 Aug 14
18
[libnbd PATCH v2 00/13] Adding nbd_set_opt_mode to improve nbdinfo
Well, I'm not quite done (I still want to get nbdinfo to work on a single nbd connection for all cases when reading the heads of the file is not required), but I'm happy with patches 1-11, and 12-13 show where I'm headed for getting NBD_OPT_INFO to work. Posting now to see if some of the earlier patches are ready to commit while I continue working on the latter half. Eric Blake (13):
2020 Aug 19
3
[libnbd PATCH 0/2] NBD_OPT_INFO support
This replaces 13/13 of my v2 series; and now that it has pretty good testsuite coverage and demonstrable performance improvement to nbdinfo, I'm going ahead and pushing this now. We may still want to add further nbd_opt_* commands for other fine-grained tuning of negotiation, but for now, I think things have stabilized on this end, and I can return to polishing .list_exports on the nbdkit
2020 Sep 26
1
[PATCH nbdinfo proposal] info: Add a --map option for displaying allocation metadata
This is a rough-and-ready implementation of nbdinfo --map option, to display the allocation and other metadata of NBD exports. I only tested it lightly against nbdkit. It needs at least some tests. Command like these should work: nbdinfo --map nbd://localhost nbdinfo --map=qemu:dirty-bitmap nbd://localhost Rich.
2020 Jul 22
2
Re: [PATCH nbdkit] server: Deprecate the -e/--exportname parameter.
...t;> -c "print(h.pread(3, 0))"' >> >> but that's a lot more painful to write. >> >> We _don't_ need to advertise 'foo' or 'bar' over NBD_OPT_INFO (at >> least, not for plugins that don't implement the forthcoming >> .export_list callback), but _do_ need a way for the captive >> application (nbdsh in this case) to know _which_ export the captive >> should connect to. >> >> And, if we reinstate _just_ that usage of -e,... >> >>>> (4) I have temporarily disabled tests/test-long-name.s...
2020 Sep 26
0
[PATCH nbdinfo v2] info: Add a --map option for displaying allocation metadata.
...fo.c index 647a24c..ff060aa 100644 --- a/info/nbdinfo.c +++ b/info/nbdinfo.c @@ -34,6 +34,7 @@ static bool list_all = false; static bool probe_content, content_flag, no_content_flag; static bool json_output = false; +static const char *map = NULL; static bool size_only = false; static struct export_list { @@ -49,6 +50,10 @@ static void list_one_export (struct nbd_handle *nbd, const char *desc, static void list_all_exports (struct nbd_handle *nbd1, const char *uri); static void print_json_string (const char *); static char *get_content (struct nbd_handle *, int64_t size); +static int extent_call...
2020 Sep 26
2
[PATCH nbdinfo v2] info: Add a --map option for displaying allocation metadata.
Fixes bugs with JSON output in the previous patch, and adds some tests. Rich.
2020 Jul 21
3
[PATCH nbdkit] server: Deprecate the -e/--exportname parameter.
This parameter provided a name for the "default export" -- ie. the one and only export returned to the client by NBD_OPT_LIST. But nbdkit traditionally didn't care what export name the client requested. Since 1.16 plugins have been able to serve different content per export name (and return errors for unknown exports), but the -e option didn't reflect that and only created