diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 268e32f801fcd7b4d7a84013a417caa821231932..fc502ff8e4cba1e761ab0de1aae98c8e1466a654 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -5634,6 +5634,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; @@ -5780,6 +5785,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); + return NULL; + } if (!(qemuCaps = virQEMUCapsCacheLookup(cache, binary))) return NULL; diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 8b2447482dd65bb86db589b02e0fc3dd90e33bee..4421d1f8b2af733b5e5ee8da3fb73fe0d50cfc22 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -6131,8 +6131,10 @@ qemuDomainPostParseDataAlloc(const virDomainDef *def, virQEMUDriverPtr driver = opaque; if (!(*parseOpaque = virQEMUCapsCacheLookup(driver->qemuCapsCache, - def->emulator))) + def->emulator))) { + virResetLastError(); return 1; + } return 0; }