]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
bhyvexml2argvmock: Provide virCPUProbeHost()
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 3 Feb 2026 11:16:58 +0000 (12:16 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 4 Feb 2026 07:29:38 +0000 (08:29 +0100)
The bhyvexml2argvmock is loaded by bhyvexml2argvtest which calls
virBhyveCapsBuild() which in turn calls virCPUProbeHost(). To
make our test environment stable, it shouldn't depend on actual
CPU and thus mocked implementation for virCPUProbeHost should be
offered. Surprisingly, this is done in bhyveargv2xmlmock but not
in bhyvexml2argvmock. Until now.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
tests/bhyvexml2argvmock.c

index fe76564d5146bba825247fa8f8992d08edb0274d..7dbdd486827221c9ca7214978f1663e99acc6eec 100644 (file)
@@ -8,6 +8,8 @@
 #include "virnetdevtap.h"
 #include "virmock.h"
 #include "internal.h"
+#include "cpu/cpu.h"
+#include "testutilshostcpus.h"
 
 #define VIR_FROM_THIS VIR_FROM_BHYVE
 
@@ -89,3 +91,9 @@ int bind(int sockfd G_GNUC_UNUSED,
 {
     return 0;
 }
+
+virCPUDef *
+virCPUProbeHost(virArch arch)
+{
+    return testUtilsHostCpusGetDefForArch(arch);
+}