mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 14:15:28 +00:00
qemu: monitor: Detect image cluster size from 'query-named-block-nodes'
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>
This commit is contained in:
parent
90ba5f02da
commit
fd49364d8b
@ -696,6 +696,9 @@ struct _qemuBlockNamedNodeData {
|
|||||||
|
|
||||||
qemuBlockNamedNodeDataBitmapPtr *bitmaps;
|
qemuBlockNamedNodeDataBitmapPtr *bitmaps;
|
||||||
size_t nbitmaps;
|
size_t nbitmaps;
|
||||||
|
|
||||||
|
/* the cluster size of the image is valid only when > 0 */
|
||||||
|
unsigned long long clusterSize;
|
||||||
};
|
};
|
||||||
|
|
||||||
virHashTablePtr
|
virHashTablePtr
|
||||||
|
@ -2997,6 +2997,9 @@ qemuMonitorJSONBlockGetNamedNodeDataWorker(size_t pos G_GNUC_UNUSED,
|
|||||||
if (virJSONValueObjectGetNumberUlong(img, "actual-size", &ent->physical) < 0)
|
if (virJSONValueObjectGetNumberUlong(img, "actual-size", &ent->physical) < 0)
|
||||||
ent->physical = ent->capacity;
|
ent->physical = ent->capacity;
|
||||||
|
|
||||||
|
/* try looking up the cluster size */
|
||||||
|
ignore_value(virJSONValueObjectGetNumberUlong(img, "cluster-size", &ent->clusterSize));
|
||||||
|
|
||||||
if ((bitmaps = virJSONValueObjectGetArray(val, "dirty-bitmaps")))
|
if ((bitmaps = virJSONValueObjectGetArray(val, "dirty-bitmaps")))
|
||||||
qemuMonitorJSONBlockGetNamedNodeDataBitmaps(bitmaps, ent);
|
qemuMonitorJSONBlockGetNamedNodeDataBitmaps(bitmaps, ent);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user