diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 3e4ef7e821..d3f7797085 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -696,6 +696,9 @@ struct _qemuBlockNamedNodeData { qemuBlockNamedNodeDataBitmapPtr *bitmaps; size_t nbitmaps; + + /* the cluster size of the image is valid only when > 0 */ + unsigned long long clusterSize; }; virHashTablePtr diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 9cdf6c0f7f..e6d2e7d4db 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2997,6 +2997,9 @@ qemuMonitorJSONBlockGetNamedNodeDataWorker(size_t pos G_GNUC_UNUSED, if (virJSONValueObjectGetNumberUlong(img, "actual-size", &ent->physical) < 0) ent->physical = ent->capacity; + /* try looking up the cluster size */ + ignore_value(virJSONValueObjectGetNumberUlong(img, "cluster-size", &ent->clusterSize)); + if ((bitmaps = virJSONValueObjectGetArray(val, "dirty-bitmaps"))) qemuMonitorJSONBlockGetNamedNodeDataBitmaps(bitmaps, ent);