]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Partially revert "qemu: fix missing error reports in capabilities probing"
authorDaniel P. Berrangé <berrange@redhat.com>
Wed, 15 Jul 2020 14:53:11 +0000 (15:53 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Fri, 17 Jul 2020 09:49:08 +0000 (10:49 +0100)
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 <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/qemu/qemu_capabilities.c
src/qemu/qemu_domain.c

index d6bfec99965b7792140b95501218c101614aed06..98ddd2dcdc6e54e414c1c6b830a195390398ab99 100644 (file)
@@ -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;
index c365d92ae0df6e20de0817b6136a827ee6211b02..7530edac5334504e8f03775083cd29092711e516 100644 (file)
@@ -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;
 }