[libvirt] [PATCHv2 51/62] qemu: monitor: Extract 'write-threshold' automatically for -blockdev

Ján Tomko jtomko at redhat.com
Fri Aug 17 11:16:30 UTC 2018


On Mon, Aug 13, 2018 at 06:00:25PM +0200, Peter Krempa wrote:
>In cases when -blockdev is used we need to use 'query-named-block-nodes'
>instead of 'query-block'. This means that we can extract the
>write-threshold variable right away.
>
>To keep compatibility with old VMs modify the code which was extracting
>the value previously so that it updates the stats structure and a single
>code path then can be used to extract the data.
>
>Signed-off-by: Peter Krempa <pkrempa at redhat.com>
>---
> src/qemu/qemu_driver.c       | 57 ++++++++++++++++++++++++++------------------
> src/qemu/qemu_monitor.h      |  3 +++
> src/qemu/qemu_monitor_json.c | 16 ++++++++++---
> 3 files changed, 50 insertions(+), 26 deletions(-)
>
>diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
>index 63ce68bd35..688746c36f 100644
>--- a/src/qemu/qemu_driver.c
>+++ b/src/qemu/qemu_driver.c
>@@ -20029,29 +20029,39 @@ qemuDomainGetStatsOneBlockFallback(virQEMUDriverPtr driver,
> }
>
>
>-static int
>-qemuDomainGetStatsOneBlockNode(virDomainStatsRecordPtr record,
>-                               int *maxparams,
>-                               virStorageSourcePtr src,
>-                               size_t block_idx,
>-                               virHashTablePtr nodedata)
>+/**
>+ * qemuDomainGetStatsOneBlockRefreshNamed:
>+ * @src: disk source structure
>+ * @alias: disk alias
>+ * @stats: hash table containing stats for all disks
>+ * @nodedata: reply containin 'query-named-block-nodes' data

containing

>+ *
>+ * Refresh disk block stats data (qemuBlockStatsPtr) which are present only
>+ * in the reply of 'query-named-block-nodes' in cases when the data was gathered
>+ * by using qem-block originally.

query-block

>+ */
>+static void

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180817/5be56aa0/attachment-0001.sig>


More information about the libvir-list mailing list