]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
domaincapstest: Run cleanly on systems missing OVMF firmware
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 17 Sep 2014 15:17:03 +0000 (17:17 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 17 Sep 2014 15:42:47 +0000 (17:42 +0200)
As of f05b6a918e28 the test produces the list of paths that can
be passed to <loader/> and libvirt knows about them. However,
during the process of generating the list the paths are checked
for their presence. This may produce different results on
different systems.  Therefore, the path - if missing - is
added to pretend it's there.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
tests/domaincapstest.c

index 85439632b185e5c11bd2e8c8c1da0ec77d883a07..067ad4d9ad93e4ed9d7e92762496517109de6114 100644 (file)
@@ -118,6 +118,17 @@ fillQemuCaps(virDomainCapsPtr domCaps,
                              VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT,
                              VIR_DOMAIN_HOSTDEV_PCI_BACKEND_KVM,
                              VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO);
+
+    /* Moreover, as of f05b6a918e28 we are expecting to see
+     * OVMF_CODE.fd file which may not exists everywhere. */
+    if (!domCaps->os.loader.values.nvalues) {
+        virDomainCapsLoaderPtr loader = &domCaps->os.loader;
+
+        if (fillStringValues(&loader->values,
+                             "/usr/share/OVMF/OVMF_CODE.fd",
+                             NULL) < 0)
+            return -1;
+    }
     return 0;
 }
 #endif /* WITH_QEMU */