]> xenbits.xensource.com Git - libvirt.git/commitdiff
test: Touch up error message when attempting to pin invalid vCPU
authorPeter Krempa <pkrempa@redhat.com>
Mon, 4 Jan 2016 18:46:31 +0000 (19:46 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 25 Jan 2016 16:53:08 +0000 (17:53 +0100)
Report
error: invalid argument: requested vcpu '100' is not present in the domain
instead of
error: invalid argument: requested vcpu is higher than allocated vcpus

src/test/test_driver.c
tests/vcpupin

index 8d1402e4b2e6d141b4ea7796c26f2f598629db41..37108abd231c0fe3ccbd9690fadaebd26cd7a077 100644 (file)
@@ -2508,8 +2508,9 @@ static int testDomainPinVcpu(virDomainPtr domain,
     }
 
     if (vcpu > virDomainDefGetVcpus(privdom->def)) {
-        virReportError(VIR_ERR_INVALID_ARG, "%s",
-                       _("requested vcpu is higher than allocated vcpus"));
+        virReportError(VIR_ERR_INVALID_ARG,
+                       _("requested vcpu '%d' is not present in the domain"),
+                       vcpu);
         goto cleanup;
     }
 
index 213db9357f06f3f94df1fc464400561c2deae29b..9e656c0aa1c0e8d5811b3c1793bc96afe8c98e05 100755 (executable)
@@ -43,7 +43,7 @@ compare exp out || fail=1
 $abs_top_builddir/tools/virsh --connect test:///default vcpupin test 100 0,1 > out 2>&1
 test $? = 1 || fail=1
 cat <<\EOF > exp || fail=1
-error: invalid argument: requested vcpu is higher than allocated vcpus
+error: invalid argument: requested vcpu '100' is not present in the domain
 
 EOF
 compare exp out || fail=1