[libvirt] [PATCH] tests: avoid probing host CPU from bhyve test

Michal Privoznik mprivozn at redhat.com
Thu Jan 9 16:31:43 UTC 2020

On 1/8/20 7:20 PM, Daniel P. Berrangé wrote:
> 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.
> Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
> ---
>   tests/bhyveargv2xmlmock.c | 8 ++++++++
>   1 file changed, 8 insertions(+)

With this squashed in:

diff --git i/src/cpu/cpu.h w/src/cpu/cpu.h
index 13909bb7a4..2e8b8923ae 100644
--- i/src/cpu/cpu.h
+++ w/src/cpu/cpu.h
@@ -193,7 +193,7 @@ virCPUGetHost(virArch arch,
                virDomainCapsCPUModelsPtr models);

-virCPUProbeHost(virArch arch);
+virCPUProbeHost(virArch arch) G_GNUC_NO_INLINE;

  virCPUBaseline(virArch arch,

Reviewed-by: Michal Privoznik <mprivozn at redhat.com>


More information about the libvir-list mailing list