提交 47fa65ec 编写于 作者: P Peter Krempa

qemu: Export stats relevant for the storage backend

Data relevant for the storage of a backing chain member will need to be
reported separately when switching to blockdev. Prepare a function that
extracts the appropriate data.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 419c7e12
...@@ -20111,8 +20111,29 @@ qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver, ...@@ -20111,8 +20111,29 @@ qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver,
} }
} }
ret = 0;
cleanup:
return ret;
}
static int
qemuDomainGetStatsBlockExportBackendStorage(const char *entryname,
virHashTablePtr stats,
size_t recordnr,
virDomainStatsRecordPtr records,
int *nrecords)
{
qemuBlockStats *entry;
int ret = -1;
if (!stats || !entryname || !(entry = virHashLookup(stats, entryname))) {
ret = 0;
goto cleanup;
}
if (entry->write_threshold) if (entry->write_threshold)
QEMU_ADD_BLOCK_PARAM_ULL(record, maxparams, block_idx, "threshold", QEMU_ADD_BLOCK_PARAM_ULL(records, nrecords, recordnr, "threshold",
entry->write_threshold); entry->write_threshold);
ret = 0; ret = 0;
...@@ -20218,6 +20239,11 @@ qemuDomainGetStatsBlockExportDisk(virDomainDiskDefPtr disk, ...@@ -20218,6 +20239,11 @@ qemuDomainGetStatsBlockExportDisk(virDomainDiskDefPtr disk,
stats) < 0) stats) < 0)
goto cleanup; goto cleanup;
if (qemuDomainGetStatsBlockExportBackendStorage(alias,
stats, *recordnr,
records, nrecords) < 0)
goto cleanup;
VIR_FREE(alias); VIR_FREE(alias);
(*recordnr)++; (*recordnr)++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册