1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00

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: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2020-01-08 18:17:58 +00:00
parent 8b58b5ee03
commit e90a643c90
2 changed files with 9 additions and 1 deletions

View File

@ -193,7 +193,7 @@ virCPUGetHost(virArch arch,
virDomainCapsCPUModelsPtr models);
virCPUDefPtr
virCPUProbeHost(virArch arch);
virCPUProbeHost(virArch arch) G_GNUC_NO_INLINE;
virCPUDefPtr
virCPUBaseline(virArch arch,

View File

@ -2,7 +2,9 @@
#include "virnetdev.h"
#include "internal.h"
#include "testutilshostcpus.h"
#include "util/viruuid.h"
#include "cpu/cpu.h"
#define VIR_FROM_THIS VIR_FROM_BHYVE
@ -25,3 +27,9 @@ virUUIDGenerate(unsigned char *uuid)
return -1;
return 0;
}
virCPUDefPtr
virCPUProbeHost(virArch arch)
{
return testUtilsHostCpusGetDefForArch(arch);
}