[libvirt PATCH 3/3] tests: Mock virQEMUCapsProbeHVF()

Andrea Bolognani abologna at redhat.com
Wed Aug 10 14:29:44 UTC 2022


Successfully returning without doing anything is what the
function already does on non-Apple platforms.

When building on macOS, however, the check for HVF availability
will be performed. When running on bare metal, that will result
in the QEMU_CAPS_HVF flag being added to the virQEMUCaps
instance, and a bunch of error messages along the lines of

  In 'tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml':
  Offset 7557
  Expect [c]
  Actual [hvf'/>
    <flag name=‘c]

showing up.

Up until now we hadn't noticed because our CI jobs run in VMs,
where HVF support is not available.

Reported-by: Christophe de Dinechin <cdupontd at redhat.com>
Signed-off-by: Andrea Bolognani <abologna at redhat.com>
---
 tests/domaincapsmock.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/domaincapsmock.c b/tests/domaincapsmock.c
index d382d06e27..4d53e48c48 100644
--- a/tests/domaincapsmock.c
+++ b/tests/domaincapsmock.c
@@ -51,6 +51,12 @@ virQEMUCapsGetKVMSupportsSecureGuest(virQEMUCaps *qemuCaps)
 
     return real_virQEMUCapsGetKVMSupportsSecureGuest(qemuCaps);
 }
+
+int
+virQEMUCapsProbeHVF(virQEMUCaps *qemuCaps G_GNUC_UNUSED)
+{
+    return 0;
+}
 #endif
 
 int
-- 
2.37.1



More information about the libvir-list mailing list