As of 0bd2ccdec an empty disk path for virDomainBlockStats (or the one with Flags) is allowed meaning "get me overall summarized statistics". However, running 'virsh domblkstat $dom' throws a misleading error: # ./tools/virsh domblkstat dom error: Failed to get block stats dom error: invalid argument: invalid path: while after this commit # virsh domblkstat dom error: Operation not supported: summary statistics are not supported yet Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx> --- src/qemu/qemu_driver.c | 12 ++++++++++++ src/test/test_driver.c | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index c9a865e..e04a328 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -9434,6 +9434,12 @@ qemuDomainBlockStats(virDomainPtr dom, virDomainDiskDefPtr disk = NULL; qemuDomainObjPrivatePtr priv; + if (!*path) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", + _("summary statistics are not supported yet")); + return ret; + } + if (!(vm = qemuDomObjFromDomain(dom))) goto cleanup; @@ -9507,6 +9513,12 @@ qemuDomainBlockStatsFlags(virDomainPtr dom, virCheckFlags(VIR_TYPED_PARAM_STRING_OKAY, -1); + if (!*path) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", + _("summary statistics are not supported yet")); + return ret; + } + /* We don't return strings, and thus trivially support this flag. */ flags &= ~VIR_TYPED_PARAM_STRING_OKAY; diff --git a/src/test/test_driver.c b/src/test/test_driver.c index b724f82..6806ffd 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -3362,6 +3362,12 @@ static int testDomainBlockStats(virDomainPtr domain, unsigned long long statbase; int ret = -1; + if (!*path) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", + _("summary statistics are not supported yet")); + return ret; + } + testDriverLock(privconn); privdom = virDomainObjListFindByName(privconn->domains, domain->name); -- 1.9.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list