1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-25 01:34:11 +03:00

qemuMonitorGetAllBlockStatsInfo: Remove 'backingChain' argument

All (proper) callers pass true so we can remove the argument.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Peter Krempa 2021-10-19 15:25:46 +02:00
parent 4e950ba4b4
commit 5f5631707f
6 changed files with 14 additions and 26 deletions

View File

@ -10051,7 +10051,7 @@ qemuDomainBlocksStatsGather(virQEMUDriver *driver,
}
qemuDomainObjEnterMonitor(driver, vm);
nstats = qemuMonitorGetAllBlockStatsInfo(priv->mon, &blockstats, true);
nstats = qemuMonitorGetAllBlockStatsInfo(priv->mon, &blockstats);
if (capacity && nstats >= 0) {
if (blockdev)
@ -18477,7 +18477,7 @@ qemuDomainGetStatsBlock(virQEMUDriver *driver,
if (HAVE_JOB(privflags) && virDomainObjIsActive(dom)) {
qemuDomainObjEnterMonitor(driver, dom);
rc = qemuMonitorGetAllBlockStatsInfo(priv->mon, &stats, true);
rc = qemuMonitorGetAllBlockStatsInfo(priv->mon, &stats);
if (rc >= 0) {
if (blockdev)

View File

@ -2056,27 +2056,22 @@ qemuMonitorQueryBlockstats(qemuMonitor *mon)
* qemuMonitorGetAllBlockStatsInfo:
* @mon: monitor object
* @ret_stats: pointer that is filled with a hash table containing the stats
* @backingChain: recurse into the backing chain of devices
*
* Creates a hash table in @ret_stats with block stats of all devices. In case
* @backingChain is true @ret_stats will additionally contain stats for
* backing chain members of block devices.
* Creates a hash table in @ret_stats with block stats of all devices and the
* backing chains for the block devices.
*
* Returns < 0 on error, count of supported block stats fields on success.
*/
int
qemuMonitorGetAllBlockStatsInfo(qemuMonitor *mon,
GHashTable **ret_stats,
bool backingChain)
GHashTable **ret_stats)
{
int ret;
g_autoptr(GHashTable) stats = virHashNew(g_free);
VIR_DEBUG("ret_stats=%p, backing=%d", ret_stats, backingChain);
QEMU_CHECK_MONITOR(mon);
ret = qemuMonitorJSONGetAllBlockStatsInfo(mon, stats, backingChain);
ret = qemuMonitorJSONGetAllBlockStatsInfo(mon, stats);
if (ret < 0)
return -1;

View File

@ -738,8 +738,7 @@ struct _qemuBlockStats {
};
int qemuMonitorGetAllBlockStatsInfo(qemuMonitor *mon,
GHashTable **ret_stats,
bool backingChain)
GHashTable **ret_stats)
ATTRIBUTE_NONNULL(2);
int qemuMonitorBlockStatsUpdateCapacity(qemuMonitor *mon,

View File

@ -2469,8 +2469,7 @@ static int
qemuMonitorJSONGetOneBlockStatsInfo(virJSONValue *dev,
const char *dev_name,
int depth,
GHashTable *hash,
bool backingChain)
GHashTable *hash)
{
g_autofree qemuBlockStats *bstats = NULL;
int nstats = 0;
@ -2507,10 +2506,8 @@ qemuMonitorJSONGetOneBlockStatsInfo(virJSONValue *dev,
qemuMonitorJSONAddOneBlockStatsInfo(bstats, nodename, hash) < 0)
return -1;
if (backingChain &&
(backing = virJSONValueObjectGetObject(dev, "backing")) &&
qemuMonitorJSONGetOneBlockStatsInfo(backing, dev_name, depth + 1,
hash, true) < 0)
if ((backing = virJSONValueObjectGetObject(dev, "backing")) &&
qemuMonitorJSONGetOneBlockStatsInfo(backing, dev_name, depth + 1, hash) < 0)
return -1;
return nstats;
@ -2538,8 +2535,7 @@ qemuMonitorJSONQueryBlockstats(qemuMonitor *mon)
int
qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitor *mon,
GHashTable *hash,
bool backingChain)
GHashTable *hash)
{
int nstats = 0;
int rc;
@ -2570,8 +2566,7 @@ qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitor *mon,
if (*dev_name == '\0')
dev_name = NULL;
rc = qemuMonitorJSONGetOneBlockStatsInfo(dev, dev_name, 0, hash,
backingChain);
rc = qemuMonitorJSONGetOneBlockStatsInfo(dev, dev_name, 0, hash);
if (rc < 0)
return -1;

View File

@ -77,8 +77,7 @@ int qemuMonitorJSONGetBlockInfo(qemuMonitor *mon,
virJSONValue *qemuMonitorJSONQueryBlockstats(qemuMonitor *mon);
int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitor *mon,
GHashTable *hash,
bool backingChain);
GHashTable *hash);
int qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitor *mon,
GHashTable *stats,
bool backingChain);

View File

@ -1657,7 +1657,7 @@ testQemuMonitorJSONqemuMonitorJSONGetAllBlockStatsInfo(const void *opaque)
CHECK0FULL(wr_highest_offset_valid, WR_HIGHEST_OFFSET_VALID, "%d", "%d")
if (qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorTestGetMonitor(test),
blockstats, false) < 0)
blockstats) < 0)
return -1;
if (!blockstats) {