mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-04-01 20:05:19 +00:00
qemuMonitorBlockStatsUpdateCapacity: Remove 'backingChain' argument
Always fetch the stats for all backing chain members. Callers from qemu_driver.c already always passed 'true' and the caller from the migration code won't mind when we fetch all stats. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
5f5631707f
commit
ab8d520eb5
@ -10057,7 +10057,7 @@ qemuDomainBlocksStatsGather(virQEMUDriver *driver,
|
||||
if (blockdev)
|
||||
rc = qemuMonitorBlockStatsUpdateCapacityBlockdev(priv->mon, blockstats);
|
||||
else
|
||||
rc = qemuMonitorBlockStatsUpdateCapacity(priv->mon, blockstats, true);
|
||||
rc = qemuMonitorBlockStatsUpdateCapacity(priv->mon, blockstats);
|
||||
}
|
||||
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || nstats < 0 || rc < 0)
|
||||
@ -18483,8 +18483,7 @@ qemuDomainGetStatsBlock(virQEMUDriver *driver,
|
||||
if (blockdev)
|
||||
rc = qemuMonitorBlockStatsUpdateCapacityBlockdev(priv->mon, stats);
|
||||
else
|
||||
ignore_value(qemuMonitorBlockStatsUpdateCapacity(priv->mon, stats,
|
||||
true));
|
||||
ignore_value(qemuMonitorBlockStatsUpdateCapacity(priv->mon, stats));
|
||||
}
|
||||
|
||||
if (fetchnodedata)
|
||||
|
@ -495,7 +495,7 @@ qemuMigrationCookieAddNBD(qemuMigrationCookie *mig,
|
||||
if (blockdev)
|
||||
rc = qemuMonitorBlockStatsUpdateCapacityBlockdev(priv->mon, stats);
|
||||
else
|
||||
rc = qemuMonitorBlockStatsUpdateCapacity(priv->mon, stats, false);
|
||||
rc = qemuMonitorBlockStatsUpdateCapacity(priv->mon, stats);
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
|
||||
return -1;
|
||||
|
||||
|
@ -2084,14 +2084,11 @@ qemuMonitorGetAllBlockStatsInfo(qemuMonitor *mon,
|
||||
/* Updates "stats" to fill virtual and physical size of the image */
|
||||
int
|
||||
qemuMonitorBlockStatsUpdateCapacity(qemuMonitor *mon,
|
||||
GHashTable *stats,
|
||||
bool backingChain)
|
||||
GHashTable *stats)
|
||||
{
|
||||
VIR_DEBUG("stats=%p, backing=%d", stats, backingChain);
|
||||
|
||||
QEMU_CHECK_MONITOR(mon);
|
||||
|
||||
return qemuMonitorJSONBlockStatsUpdateCapacity(mon, stats, backingChain);
|
||||
return qemuMonitorJSONBlockStatsUpdateCapacity(mon, stats);
|
||||
}
|
||||
|
||||
|
||||
|
@ -742,8 +742,7 @@ int qemuMonitorGetAllBlockStatsInfo(qemuMonitor *mon,
|
||||
ATTRIBUTE_NONNULL(2);
|
||||
|
||||
int qemuMonitorBlockStatsUpdateCapacity(qemuMonitor *mon,
|
||||
GHashTable *stats,
|
||||
bool backingChain)
|
||||
GHashTable *stats)
|
||||
ATTRIBUTE_NONNULL(2);
|
||||
|
||||
int qemuMonitorBlockStatsUpdateCapacityBlockdev(qemuMonitor *mon,
|
||||
|
@ -2617,8 +2617,7 @@ static int
|
||||
qemuMonitorJSONBlockStatsUpdateCapacityOne(virJSONValue *image,
|
||||
const char *dev_name,
|
||||
int depth,
|
||||
GHashTable *stats,
|
||||
bool backingChain)
|
||||
GHashTable *stats)
|
||||
{
|
||||
g_autofree char *entry_name = qemuDomainStorageAlias(dev_name, depth);
|
||||
virJSONValue *backing;
|
||||
@ -2627,13 +2626,11 @@ qemuMonitorJSONBlockStatsUpdateCapacityOne(virJSONValue *image,
|
||||
stats, NULL) < 0)
|
||||
return -1;
|
||||
|
||||
if (backingChain &&
|
||||
(backing = virJSONValueObjectGetObject(image, "backing-image")) &&
|
||||
if ((backing = virJSONValueObjectGetObject(image, "backing-image")) &&
|
||||
qemuMonitorJSONBlockStatsUpdateCapacityOne(backing,
|
||||
dev_name,
|
||||
depth + 1,
|
||||
stats,
|
||||
true) < 0)
|
||||
stats) < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
@ -2642,8 +2639,7 @@ qemuMonitorJSONBlockStatsUpdateCapacityOne(virJSONValue *image,
|
||||
|
||||
int
|
||||
qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitor *mon,
|
||||
GHashTable *stats,
|
||||
bool backingChain)
|
||||
GHashTable *stats)
|
||||
{
|
||||
size_t i;
|
||||
g_autoptr(virJSONValue) devices = NULL;
|
||||
@ -2668,9 +2664,7 @@ qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitor *mon,
|
||||
!(image = virJSONValueObjectGetObject(inserted, "image")))
|
||||
continue;
|
||||
|
||||
if (qemuMonitorJSONBlockStatsUpdateCapacityOne(image, dev_name, 0,
|
||||
stats,
|
||||
backingChain) < 0)
|
||||
if (qemuMonitorJSONBlockStatsUpdateCapacityOne(image, dev_name, 0, stats) < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -79,8 +79,7 @@ virJSONValue *qemuMonitorJSONQueryBlockstats(qemuMonitor *mon);
|
||||
int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitor *mon,
|
||||
GHashTable *hash);
|
||||
int qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitor *mon,
|
||||
GHashTable *stats,
|
||||
bool backingChain);
|
||||
GHashTable *stats);
|
||||
int qemuMonitorJSONBlockStatsUpdateCapacityBlockdev(qemuMonitor *mon,
|
||||
GHashTable *stats);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user