Configuring the cluster size of an image may have performance
implications. This patch allows us to detect cluster size for existing
images so that we will be able to propagate it to new images which are
based on existing images e.g. during snapshots/block-copy/etc.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
qemuBlockNamedNodeDataBitmapPtr *bitmaps;
size_t nbitmaps;
+
+ /* the cluster size of the image is valid only when > 0 */
+ unsigned long long clusterSize;
};
virHashTablePtr
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);