From: Michal Privoznik <[email protected]>

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 <[email protected]>
---
 tests/bhyvexml2argvmock.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tests/bhyvexml2argvmock.c b/tests/bhyvexml2argvmock.c
index fe76564d51..7dbdd48682 100644
--- a/tests/bhyvexml2argvmock.c
+++ b/tests/bhyvexml2argvmock.c
@@ -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);
+}
-- 
2.52.0

Reply via email to