]> xenbits.xensource.com Git - libvirt.git/commitdiff
cputest: Print correct feature in virCPUUpdateLive test
authorJiri Denemark <jdenemar@redhat.com>
Wed, 27 Sep 2017 09:21:36 +0000 (11:21 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 16 Oct 2017 07:23:20 +0000 (09:23 +0200)
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>
tests/cputest.c

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