]> git.ipfire.org Git - thirdparty/libvirt.git/commit
cputest: Add tests for virCPUUpdateLive API
authorJiri Denemark <jdenemar@redhat.com>
Thu, 16 Mar 2017 11:26:30 +0000 (12:26 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 27 Mar 2017 14:29:27 +0000 (16:29 +0200)
commit84cc51ea74dc69d82023802995140f9713d7b737
tree7c0c59dcbe7575a2f29494a55139fe4017b13098
parent88705d4c9d168e2946b4044e164ee7a8d668cdc7
cputest: Add tests for virCPUUpdateLive API

The test takes

  x86-cpuid-Something-guest.xml CPU (the CPU libvirt would use for
    host-model on a CPU described by x86_64-cpuid-Something.xml without
    talking to QEMU about what it supports on the host)

and updates it according to CPUID data from QEMU:

  x86_64-cpuid-Something-enabled.xml (reported as "feature-words"
    property of the CPU device)

and

  x86_64-cpuid-Something-disabled.xml (reported as "filtered-features"
    property of the CPU device).

The result is compared to

  x86_64-cpuid-Something-json.xml (the CPU libvirt would use as
    host-model based on the reply from query-cpu-model-expansion).

The comparison is a bit tricky because the *-json.xml CPU contains fewer
disabled features. Only the features which are included in the base CPU
model, but listed as disabled in *.json will be disabled in *-json.xml.
The CPU computed by virCPUUpdateLive from the test data will list all
features present in the host's CPUID data and not enabled in *.json as
disabled. The cpuTestUpdateLiveCompare function checks that the computed
and expected sets of enabled features match.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
tests/cputest.c