qemu: monitor: Remove unused qemuMonitorBlockStatsUpdateCapacity
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
837b637f40
commit
9f6151f50d
@ -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
|
int
|
||||||
qemuMonitorBlockStatsUpdateCapacityBlockdev(qemuMonitor *mon,
|
qemuMonitorBlockStatsUpdateCapacityBlockdev(qemuMonitor *mon,
|
||||||
GHashTable *stats)
|
GHashTable *stats)
|
||||||
|
@ -677,10 +677,6 @@ int qemuMonitorGetAllBlockStatsInfo(qemuMonitor *mon,
|
|||||||
GHashTable **ret_stats)
|
GHashTable **ret_stats)
|
||||||
ATTRIBUTE_NONNULL(2);
|
ATTRIBUTE_NONNULL(2);
|
||||||
|
|
||||||
int qemuMonitorBlockStatsUpdateCapacity(qemuMonitor *mon,
|
|
||||||
GHashTable *stats)
|
|
||||||
ATTRIBUTE_NONNULL(2);
|
|
||||||
|
|
||||||
int qemuMonitorBlockStatsUpdateCapacityBlockdev(qemuMonitor *mon,
|
int qemuMonitorBlockStatsUpdateCapacityBlockdev(qemuMonitor *mon,
|
||||||
GHashTable *stats)
|
GHashTable *stats)
|
||||||
ATTRIBUTE_NONNULL(2);
|
ATTRIBUTE_NONNULL(2);
|
||||||
|
@ -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
|
static int
|
||||||
qemuMonitorJSONBlockStatsUpdateCapacityBlockdevWorker(size_t pos G_GNUC_UNUSED,
|
qemuMonitorJSONBlockStatsUpdateCapacityBlockdevWorker(size_t pos G_GNUC_UNUSED,
|
||||||
virJSONValue *val,
|
virJSONValue *val,
|
||||||
|
@ -98,9 +98,6 @@ int
|
|||||||
qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitor *mon,
|
qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitor *mon,
|
||||||
GHashTable *hash);
|
GHashTable *hash);
|
||||||
int
|
int
|
||||||
qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitor *mon,
|
|
||||||
GHashTable *stats);
|
|
||||||
int
|
|
||||||
qemuMonitorJSONBlockStatsUpdateCapacityBlockdev(qemuMonitor *mon,
|
qemuMonitorJSONBlockStatsUpdateCapacityBlockdev(qemuMonitor *mon,
|
||||||
GHashTable *stats);
|
GHashTable *stats);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user