[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libnbd PATCH] info: Add support for new 'qemu-nbd -A' qemu:allocation-d
From: |
Eric Blake |
Subject: |
[libnbd PATCH] info: Add support for new 'qemu-nbd -A' qemu:allocation-depth |
Date: |
Fri, 16 Oct 2020 10:23:18 -0500 |
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 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: return "backing";
+ }
+ }
return NULL; /* Don't know - description field will be omitted. */
}
--
2.29.0.rc1
- Re: [PATCH v4 6/7] nbd: Refactor counting of metadata contexts, (continued)
[PATCH v4 7/7] nbd: Allow export of multiple bitmaps for one device, Eric Blake, 2020/10/09
[libnbd PATCH] info: Add support for new 'qemu-nbd -A' qemu:allocation-depth,
Eric Blake <=