[PATCH 19/34] test: Touch up error message when attempting to pin invalid vCPU

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 | 5 +++--
 tests/vcpupin          | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 4d268de..5986749 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -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;
     }

diff --git a/tests/vcpupin b/tests/vcpupin
index 213db93..9e656c0 100755
--- a/tests/vcpupin
+++ b/tests/vcpupin
@@ -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
-- 
2.6.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]