From: Daniel P. Berrangé Date: Wed, 15 Jul 2020 14:53:11 +0000 (+0100) Subject: Partially revert "qemu: fix missing error reports in capabilities probing" X-Git-Tag: v6.6.0-rc1~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d488a7c4585046e61313547dd4a227b3e857117;p=thirdparty%2Flibvirt.git Partially revert "qemu: fix missing error reports in capabilities probing" This partially reverts commit 5331c4804f4f419b9e75741084f926e52413d3a1. The original commit mistakenly thought virFileCacheLookup did not set an error. In fact the only case it doesn't set an error for is when the cache key is NULL. This in fact the fault of the caller for passing an invalid cache key, so doesn't need to be handled. This caller bug was fixed by checking for a NULL binary in the virQEMUCapsCacheLookupDefault method. Reviewed-by: Michal Privoznik Signed-off-by: Daniel P. Berrangé --- diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index d6bfec9996..98ddd2dcdc 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -5640,11 +5640,6 @@ 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; diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index c365d92ae0..7530edac53 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5306,10 +5306,8 @@ qemuDomainPostParseDataAlloc(const virDomainDef *def, virQEMUDriverPtr driver = opaque; if (!(*parseOpaque = virQEMUCapsCacheLookup(driver->qemuCapsCache, - def->emulator))) { - virResetLastError(); + def->emulator))) return 1; - } return 0; }