search for: extent_descript

Displaying 8 results from an estimated 8 matches for "extent_descript".

2020 Oct 16
3
[libnbd PATCH] info: Add support for new 'qemu-nbd -A' qemu:allocation-depth
...l the counterpart qemu patches land upstream, although it looks like I've got positive review. info/nbdinfo.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/info/nbdinfo.c b/info/nbdinfo.c index 24ec129..1afdf98 100644 --- a/info/nbdinfo.c +++ b/info/nbdinfo.c @@ -780,6 +780,13 @@ extent_description (const char *metacontext, uint32_t type) case 1: return "dirty"; } } + else if (strcmp (metacontext, "qemu:allocation-depth") == 0) { + switch (type & 3) { + case 0: return "unallocated"; + case 1: return "local"; + case 2: re...
2020 Oct 27
0
Re: [libnbd PATCH] info: Add support for new 'qemu-nbd -A' qemu:allocation-depth
..., 15 insertions(+), 12 deletions(-) diff --git a/info/nbdinfo.c b/info/nbdinfo.c index 2b22f51..b152f28 100644 --- a/info/nbdinfo.c +++ b/info/nbdinfo.c @@ -767,28 +767,30 @@ get_content (struct nbd_handle *nbd, int64_t size) } /* Callback handling --map. */ -static const char * +static char * extent_description (const char *metacontext, uint32_t type) { + char *ret; + if (strcmp (metacontext, "base:allocation") == 0) { switch (type) { - case 0: return "allocated"; - case 1: return "hole"; - case 2: return "zero"; - case 3: return "hole,...
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 01
1
Re: [PATCH nbdinfo v2] info: Add a --map option for displaying allocation metadata.
...$out > + > +# Note the memory plugin uses a 32K page size, and extents > +# are always aligned with this. > +nbdkit -U - memory 1M --run ' > + nbdsh -u "$uri" \ ...since you are depending on it. > +/* Callback handling --map. */ > +static const char * > +extent_description (const char *metacontext, uint32_t type) > +{ > + if (strcmp (metacontext, "base:allocation") == 0) { Should we favor the use of LIBNBD_CONTEXT_BASE_ALLOCATION instead of open-coding this? > + switch (type) { > + case 0: return "allocated"; > + case...
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 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
0
[PATCH nbdinfo v2] info: Add a --map option for displaying allocation metadata.
...uot;); + } else { /* Print per-connection fields. */ protocol = nbd_get_protocol (nbd); @@ -591,3 +646,70 @@ get_content (struct nbd_handle *nbd, int64_t size) free (cmd); return ret; /* caller frees */ } + +/* Callback handling --map. */ +static const char * +extent_description (const char *metacontext, uint32_t type) +{ + if (strcmp (metacontext, "base:allocation") == 0) { + switch (type) { + case 0: return "allocated"; + case 1: return "zero"; + case 2: return "hole"; + case 3: return "hole,zero"; +...
2020 Oct 06
2
[PATCH libnbd] info: Write output atomically.
...(*s, stdout); + fputc (*s, fp); } } - putc ('"', stdout); + fputc ('"', fp); } /* Run the file(1) command on the first part of the export and save @@ -768,27 +802,27 @@ extent_callback (void *user_data, const char *metacontext, const char *descr = extent_description (map, entries[i+1]); if (!json_output) { - printf ("%10" PRIu64 " " - "%10" PRIu32 " " - "%3" PRIu32, - offset, entries[i], entries[i+1]); + fprintf (fp, "%10" PRIu64 " &qu...