cputest: Print correct feature in virCPUUpdateLive test

If the actual result does not match our expectation, the tests would
not correctly show the difference if a CPU feature is disabled in the
expected result and the actual result does not mention it at all. The
test could complain about an unrelated CPU feature or it could even
crash in case the actual result contains no more features to go through.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
Jiri Denemark 2017-09-27 11:21:36 +02:00
parent 9d62af7283
commit c517a6a369

View File

@ -605,7 +605,7 @@ cpuTestUpdateLiveCompare(virArch arch,
(cmp > 0 && (cmp > 0 &&
featExp->policy == VIR_CPU_FEATURE_DISABLE)) { featExp->policy == VIR_CPU_FEATURE_DISABLE)) {
VIR_TEST_VERBOSE("Actual CPU has extra feature '%s'\n", VIR_TEST_VERBOSE("Actual CPU has extra feature '%s'\n",
featAct->name); cmp <= 0 ? featAct->name : featExp->name);
ret = -1; ret = -1;
} }
} }