Displaying 8 results from an estimated 8 matches for "extent_callback".
Did you mean:
event_callback
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 16
3
[libnbd PATCH] info: Add support for new 'qemu-nbd -A' qemu:allocation-depth
A rather trivial decoding; we may enhance it further if qemu extends
things to give an integer depth alongside its tri-state encoding.
---
I'll wait to push this to libnbd until 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
2020 Sep 26
0
[PATCH nbdinfo v2] info: Add a --map option for displaying allocation metadata.
...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 *error);
static void __attribute__((noreturn))
usage (FILE *fp, int exitcode)
@@ -60,6 +65,7 @@ usage (FIL...
2020 Oct 17
1
[libnbd PATCH] info: Keep request within 4G bound
...ar *argv[])
if (json_output) fprintf (fp, "[\n");
for (offset = 0; offset < size;) {
prev_offset = offset;
- if (nbd_block_status (nbd, size - offset, offset,
+ if (nbd_block_status (nbd, MIN (size - offset, max_len), offset,
(nbd_extent_callback) { .callback = extent_callback,
.user_data = &offset },
0) == -1) {
--
2.29.0.rc1
2020 Oct 27
0
Re: [libnbd PATCH] info: Add support for new 'qemu-nbd -A' qemu:allocation-depth
...n "local";
- case 2: return "backing";
+ switch (type) {
+ case 0: return strdup ("unallocated");
+ case 1: return strdup ("local");
+ case 2: asprintf (&ret, "backing depth %d", type); return ret;
}
}
@@ -810,7 +812,7 @@ extent_callback (void *user_data, const char
*metacontext,
/* Print the entries received. */
for (i = 0; i < nr_entries; i += 2) {
- const char *descr = extent_description (map, entries[i+1]);
+ char *descr = extent_description (map, entries[i+1]);
if (!json_output) {
fprintf (fp, &quo...
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 Oct 06
2
[PATCH libnbd] info: Write output atomically.
...ot;, *s);
+ fprintf (fp, "\\u%04x", *s);
else
- putc (*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,
- offse...