]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: Mock virQEMUCapsProbeHVF()
authorAndrea Bolognani <abologna@redhat.com>
Wed, 10 Aug 2022 09:42:37 +0000 (11:42 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Wed, 10 Aug 2022 15:49:52 +0000 (17:49 +0200)
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 <dinechin@redhat.com>
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Christophe de Dinechin <dinechin@redhat.com>
Tested-by: Christophe de Dinechin <dinechin@redhat.com>
tests/domaincapsmock.c

index d382d06e2718523f25e3c624e005954bbac297a2..4d53e48c4825335218f8fcf64b3b177152037836 100644 (file)
@@ -51,6 +51,12 @@ virQEMUCapsGetKVMSupportsSecureGuest(virQEMUCaps *qemuCaps)
 
     return real_virQEMUCapsGetKVMSupportsSecureGuest(qemuCaps);
 }
+
+int
+virQEMUCapsProbeHVF(virQEMUCaps *qemuCaps G_GNUC_UNUSED)
+{
+    return 0;
+}
 #endif
 
 int