render / rpms / libvirt

Forked from rpms/libvirt 4 months ago
Clone
3ec523
From 6fcd1ae861279589172783c4937367685469f265 Mon Sep 17 00:00:00 2001
3ec523
From: Michal Privoznik <mprivozn@redhat.com>
3ec523
Date: Wed, 17 Sep 2014 17:17:03 +0200
3ec523
Subject: [PATCH] domaincapstest: Run cleanly on systems missing OVMF firmware
3ec523
3ec523
As of f05b6a918e28 the test produces the list of paths that can
3ec523
be passed to <loader/> and libvirt knows about them. However,
3ec523
during the process of generating the list the paths are checked
3ec523
for their presence. This may produce different results on
3ec523
different systems.  Therefore, the path - if missing - is
3ec523
added to pretend it's there.
3ec523
3ec523
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
3ec523
(cherry picked from commit b3f42da6b77644107bcbaf720d7ed9cef5c798a2)
3ec523
---
3ec523
 tests/domaincapstest.c | 11 +++++++++++
3ec523
 1 file changed, 11 insertions(+)
3ec523
3ec523
diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c
3ec523
index 8543963..067ad4d 100644
3ec523
--- a/tests/domaincapstest.c
3ec523
+++ b/tests/domaincapstest.c
3ec523
@@ -118,6 +118,17 @@ fillQemuCaps(virDomainCapsPtr domCaps,
3ec523
                              VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT,
3ec523
                              VIR_DOMAIN_HOSTDEV_PCI_BACKEND_KVM,
3ec523
                              VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO);
3ec523
+
3ec523
+    /* Moreover, as of f05b6a918e28 we are expecting to see
3ec523
+     * OVMF_CODE.fd file which may not exists everywhere. */
3ec523
+    if (!domCaps->os.loader.values.nvalues) {
3ec523
+        virDomainCapsLoaderPtr loader = &domCaps->os.loader;
3ec523
+
3ec523
+        if (fillStringValues(&loader->values,
3ec523
+                             "/usr/share/OVMF/OVMF_CODE.fd",
3ec523
+                             NULL) < 0)
3ec523
+            return -1;
3ec523
+    }
3ec523
     return 0;
3ec523
 }
3ec523
 #endif /* WITH_QEMU */