search for: print_json_string

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

2020 Jul 29
0
[libnbd PATCH 2/2] info: Expose description in list mode
...no_content_flag; static bool json_output = false; static bool size_only = false; -static void list_one_export (struct nbd_handle *nbd); +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); @@ -243,7 +243,8 @@ main (int argc, char *argv[]) } if (!list_all) - list_one_export (nbd); + /* XXX We would need libnbd to request NBD_INFO_DESCRIPTION */ + list_one_export (nbd, NULL); e...
2020 Oct 06
2
[PATCH libnbd] info: Write output atomically.
...hout"); + fprintf (fp, "\n"); } } else { - printf ("{\n"); + fprintf (fp, "{\n"); if (protocol) { - printf ("\"protocol\": "); + fprintf (fp, "\"protocol\": "); print_json_string (protocol); - printf (",\n"); + fprintf (fp, ",\n"); } if (tls_negotiated >= 0) - printf ("\"TLS\": %s,\n", tls_negotiated ? "true" : "false"); + fprintf (fp, "\"TLS\": %s,\n&qu...
2020 Jul 29
3
[libnbd PATCH 0/2] Expose export description
An incremental improvement on top of listing exports. I still think it's worth experimenting with revisiting how our API for list mode should actually work [1] (so that we can reuse a single connection for both grabbing the list and finally using NBD_OPT_GO), but this change was easier to whip together while still thinking about that. [1]
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 Oct 02
0
[libnbd PATCH v2 2/2] info: List available meta-contexts
...export (struct nbd_handle *nbd, const char *desc, printf (",\n"); } + if (show_context) { + printf ("\t\"contexts\": [\n"); + for (struct context_list *next = contexts; next; next = next->next) { + printf ("\t\t"); + print_json_string (next->name); + if (next->next) + putchar(','); + putchar('\n'); + } + printf ("\t],\n"); + } + if (is_rotational >= 0) printf ("\t\"%s\": %s,\n", "is_rotational", is_rota...
2020 Sep 26
0
[PATCH nbdinfo v2] info: Add a --map option for displaying allocation metadata.
...c 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_callback (void *user_data, const char *metacontext, + uint64_t offset, + uint32_t *entries, size_t nr_entries, + int *er...
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 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 Aug 03
5
[libnbd PATCH 0/4] More nbdinfo fixes
This rounds up the remaining bugs that I originally identified in: https://www.redhat.com/archives/libguestfs/2020-July/msg00153.html Eric Blake (4): api: Permit export list APIs when Connected info: Support --list with serializing servers info: Fix --json output when list size != 1 info: Permit --size --json generator/API.ml | 6 +++--- info/info-list-json.sh | 9 +++++++++
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 ++++++++-