[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCHv2 49/62] qemu: monitor: Add APIs for refreshing disk capacity when using -blockdev



On Mon, Aug 13, 2018 at 06:00:23PM +0200, Peter Krempa wrote:
Disk image size data are not contained in the reply of query-blockstats
but need to be gathered from query-block. For use with -blockdev we
really need to call 'query-named-block-nodes' and process it to retrieve
the correct data.

This patch introduces qemuMonitorBlockStatsUpdateCapacityBlockdev which
updates the capacity data by nodename rather than device name.

Signed-off-by: Peter Krempa <pkrempa redhat com>
---
src/qemu/qemu_monitor.c      | 11 +++++++++++
src/qemu/qemu_monitor.h      |  4 ++++
src/qemu/qemu_monitor_json.c | 46 ++++++++++++++++++++++++++++++++++++++++++++
src/qemu/qemu_monitor_json.h |  3 +++
4 files changed, 64 insertions(+)

diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 0a29ad7502..f5dca42b38 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -2311,6 +2311,17 @@ qemuMonitorBlockStatsUpdateCapacity(qemuMonitorPtr mon,
}


+int
+qemuMonitorBlockStatsUpdateCapacityBlockdev(qemuMonitorPtr mon,
+                                            virHashTablePtr stats)
+{
+    VIR_DEBUG("stats=%p", stats);
+
+    QEMU_CHECK_MONITOR(mon);
+
+    return qemuMonitorJSONBlockStatsUpdateCapacityBlockdev(mon, stats);
+}
+
int
qemuMonitorBlockResize(qemuMonitorPtr mon,
                       const char *device,
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index 649a925829..f83a18f563 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -599,6 +599,10 @@ int qemuMonitorBlockStatsUpdateCapacity(qemuMonitorPtr mon,
                                        bool backingChain)
    ATTRIBUTE_NONNULL(2);

+int qemuMonitorBlockStatsUpdateCapacityBlockdev(qemuMonitorPtr mon,
+                                            virHashTablePtr stats)

Indentation is off.

+    ATTRIBUTE_NONNULL(2);
+
int qemuMonitorBlockResize(qemuMonitorPtr mon,
                           const char *device,
                           const char *nodename,

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

Jano

Attachment: signature.asc
Description: Digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]