From: Peter Krempa Date: Thu, 21 Jul 2022 11:03:53 +0000 (+0200) Subject: qemu: monitor: Remove unused qemuMonitorBlockStatsUpdateCapacity X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=9f6151f50dcd90f9d4969a8cff7c77aeb56c9e23;p=libvirt.git qemu: monitor: Remove unused qemuMonitorBlockStatsUpdateCapacity Signed-off-by: Peter Krempa Reviewed-by: Pavel Hrdina Reviewed-by: Ján Tomko --- diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 39351a1234..a3f1d5f117 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -1972,17 +1972,6 @@ qemuMonitorGetAllBlockStatsInfo(qemuMonitor *mon, } -/* Updates "stats" to fill virtual and physical size of the image */ -int -qemuMonitorBlockStatsUpdateCapacity(qemuMonitor *mon, - GHashTable *stats) -{ - QEMU_CHECK_MONITOR(mon); - - return qemuMonitorJSONBlockStatsUpdateCapacity(mon, stats); -} - - int qemuMonitorBlockStatsUpdateCapacityBlockdev(qemuMonitor *mon, GHashTable *stats) diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index c5cfd8e5b9..881aa71c7f 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -677,10 +677,6 @@ int qemuMonitorGetAllBlockStatsInfo(qemuMonitor *mon, GHashTable **ret_stats) ATTRIBUTE_NONNULL(2); -int qemuMonitorBlockStatsUpdateCapacity(qemuMonitor *mon, - GHashTable *stats) - ATTRIBUTE_NONNULL(2); - int qemuMonitorBlockStatsUpdateCapacityBlockdev(qemuMonitor *mon, GHashTable *stats) ATTRIBUTE_NONNULL(2); diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 86390309ae..78dc6d9b66 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2469,65 +2469,6 @@ qemuMonitorJSONBlockStatsUpdateCapacityData(virJSONValue *image, } -static int -qemuMonitorJSONBlockStatsUpdateCapacityOne(virJSONValue *image, - const char *dev_name, - int depth, - GHashTable *stats) -{ - g_autofree char *entry_name = qemuDomainStorageAlias(dev_name, depth); - virJSONValue *backing; - - if (qemuMonitorJSONBlockStatsUpdateCapacityData(image, entry_name, - stats, NULL) < 0) - return -1; - - if ((backing = virJSONValueObjectGetObject(image, "backing-image")) && - qemuMonitorJSONBlockStatsUpdateCapacityOne(backing, - dev_name, - depth + 1, - stats) < 0) - return -1; - - return 0; -} - - -int -qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitor *mon, - GHashTable *stats) -{ - size_t i; - g_autoptr(virJSONValue) devices = NULL; - - if (!(devices = qemuMonitorJSONQueryBlock(mon))) - return -1; - - for (i = 0; i < virJSONValueArraySize(devices); i++) { - virJSONValue *dev; - virJSONValue *inserted; - virJSONValue *image; - const char *dev_name; - - if (!(dev = qemuMonitorJSONGetBlockDev(devices, i))) - return -1; - - if (!(dev_name = qemuMonitorJSONGetBlockDevDevice(dev))) - return -1; - - /* drive may be empty */ - if (!(inserted = virJSONValueObjectGetObject(dev, "inserted")) || - !(image = virJSONValueObjectGetObject(inserted, "image"))) - continue; - - if (qemuMonitorJSONBlockStatsUpdateCapacityOne(image, dev_name, 0, stats) < 0) - return -1; - } - - return 0; -} - - static int qemuMonitorJSONBlockStatsUpdateCapacityBlockdevWorker(size_t pos G_GNUC_UNUSED, virJSONValue *val, diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 4a8f053685..3070d29580 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -98,9 +98,6 @@ int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitor *mon, GHashTable *hash); int -qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitor *mon, - GHashTable *stats); -int qemuMonitorJSONBlockStatsUpdateCapacityBlockdev(qemuMonitor *mon, GHashTable *stats);