On Thu, Oct 03, 2024 at 15:46:31 +0200, Peter Krempa wrote:
Store the names of internal snapshots present in supported images in
the
data we dump from 'query-named-block-nodes' so that the upcoming changes
to the internal snapshot code can access it.
To test this we use the bitmap detection test cases which can be easily
extended to dump this data.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_monitor.h | 3 +
src/qemu/qemu_monitor_json.c | 19 ++
tests/qemublocktest.c | 11 +
.../bitmap/snapshots-internal.json | 298 ++++++++++++++++++
.../bitmap/snapshots-internal.out | 2 +
5 files changed, 333 insertions(+)
create mode 100644 tests/qemublocktestdata/bitmap/snapshots-internal.json
create mode 100644 tests/qemublocktestdata/bitmap/snapshots-internal.out
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index 6251f48d28..4341519cfe 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -709,6 +709,9 @@ struct _qemuBlockNamedNodeData {
qemuBlockNamedNodeDataBitmap **bitmaps;
size_t nbitmaps;
+ /* NULL terminated string list of internal snapshot names */
+ char **snapshots;
+
/* the cluster size of the image is valid only when > 0 */
unsigned long long clusterSize;
The upstream pipeline detected that I've forgot to clear the snapshots
string list in qemuMonitorJSONBlockNamedNodeDataFree.
Consider the following squashed in:
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 2c3fce9002..c594b33106 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -2569,6 +2569,7 @@ qemuMonitorJSONBlockNamedNodeDataFree(qemuBlockNamedNodeData *data)
for (i = 0; i < data->nbitmaps; i++)
qemuMonitorJSONBlockNamedNodeDataBitmapFree(data->bitmaps[i]);
+ g_strfreev(data->snapshots);
g_free(data->bitmaps);
g_free(data);
}