The "virsh domcapabilities --arch ppc64" command will fail with no error message set if qemu-system-ppc64 is not currently installed. This is because virQEMUCapsCacheLookup() does not report any error message if not capabilities can be obtained from the cache. Almost all methods calling this expected an error to be set on failure. Once that's fixed though, we see a further bug which is that virQEMUCapsCacheLookupDefault() is passing a NULL binary path to virQEMUCapsCacheLookup(), so we need to catch that too. Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx> --- src/qemu/qemu_capabilities.c | 11 +++++++++++ src/qemu/qemu_domain.c | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index aa90eab229..448d6fa175 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -5517,6 +5517,11 @@ virQEMUCapsCacheLookup(virFileCachePtr cache, priv->microcodeVersion = virHostCPUGetMicrocodeVersion(); ret = virFileCacheLookup(cache, binary); + if (!ret) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("no capabilities available for %s"), binary); + return NULL; + } VIR_DEBUG("Returning caps %p for %s", ret, binary); return ret; @@ -5664,6 +5669,12 @@ virQEMUCapsCacheLookupDefault(virFileCachePtr cache, probedbinary = virQEMUCapsGetDefaultEmulator(hostarch, arch); binary = probedbinary; } + if (!binary) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unable to find any emulator to serve '%s' architecture"), + archStr); + goto cleanup; + } if (!(qemuCaps = virQEMUCapsCacheLookup(cache, binary))) goto cleanup; diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 2dad823a86..97096073e6 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -6068,8 +6068,10 @@ qemuDomainPostParseDataAlloc(const virDomainDef *def, virQEMUDriverPtr driver = opaque; if (!(*parseOpaque = virQEMUCapsCacheLookup(driver->qemuCapsCache, - def->emulator))) + def->emulator))) { + virResetLastError(); return 1; + } return 0; } -- 2.26.2