提交 e90a643c 编写于 作者: D Daniel P. Berrangé

tests: avoid probing host CPU from bhyve test

bhyveargv2xmlmock calls virBhyveCapsBuild which in turn
calls virCPUProbeHost, probing the real host CPU. This
causes a test failure if the host CPU happens to contain
the 'arch-capabilities' feature as it triggers a call
to virHostCPUGetMSR() which fails on FreeBSD.

Fortunately we already have convenient code for mocking
the host CPU probing.
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 8b58b5ee
...@@ -193,7 +193,7 @@ virCPUGetHost(virArch arch, ...@@ -193,7 +193,7 @@ virCPUGetHost(virArch arch,
virDomainCapsCPUModelsPtr models); virDomainCapsCPUModelsPtr models);
virCPUDefPtr virCPUDefPtr
virCPUProbeHost(virArch arch); virCPUProbeHost(virArch arch) G_GNUC_NO_INLINE;
virCPUDefPtr virCPUDefPtr
virCPUBaseline(virArch arch, virCPUBaseline(virArch arch,
......
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
#include "virnetdev.h" #include "virnetdev.h"
#include "internal.h" #include "internal.h"
#include "testutilshostcpus.h"
#include "util/viruuid.h" #include "util/viruuid.h"
#include "cpu/cpu.h"
#define VIR_FROM_THIS VIR_FROM_BHYVE #define VIR_FROM_THIS VIR_FROM_BHYVE
...@@ -25,3 +27,9 @@ virUUIDGenerate(unsigned char *uuid) ...@@ -25,3 +27,9 @@ virUUIDGenerate(unsigned char *uuid)
return -1; return -1;
return 0; return 0;
} }
virCPUDefPtr
virCPUProbeHost(virArch arch)
{
return testUtilsHostCpusGetDefForArch(arch);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册