]> xenbits.xensource.com Git - libvirt.git/commitdiff
* src/virsh.c: fixed 2 small bugs in setvcpus command, after
authorDaniel Veillard <veillard@redhat.com>
Wed, 15 Aug 2007 10:18:33 +0000 (10:18 +0000)
committerDaniel Veillard <veillard@redhat.com>
Wed, 15 Aug 2007 10:18:33 +0000 (10:18 +0000)
  Atsushi SAKAI pointed out a value checking problem
Daniel

ChangeLog
src/virsh.c

index 3ccf5ecd5ae2ea1b2f38717ead35099f6e6f61d7..618dab68adacd239880ca5971e7a7084570e2e6c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Aug 15 12:21:13 CEST 2007 Daniel Veillard <veillard@redhat.com>
+
+       * src/virsh.c: fixed 2 small bugs in setvcpus command, after
+         Atsushi SAKAI pointed out a value checking problem
+
 Tue Aug 14 14:32:51 CEST 2007 Daniel Veillard <veillard@redhat.com>
 
        * src/proxy_internal.c: fix the UUID lookup though proxy, by
index ecf53908f55fd7e53df87e06ac1a858c74bac6a2..5ad356572c4857bf6746d761f6b83f62f80dd721 100644 (file)
@@ -1679,14 +1679,14 @@ cmdSetvcpus(vshControl * ctl, vshCmd * cmd)
         return FALSE;
 
     count = vshCommandOptInt(cmd, "count", &count);
-    if (!count) {
+    if (count <= 0) {
         vshError(ctl, FALSE, _("Invalid number of virtual CPUs."));
         virDomainFree(dom);
         return FALSE;
     }
 
     maxcpu = virDomainGetMaxVcpus(dom);
-    if (!maxcpu) {
+    if (maxcpu <= 0) {
         virDomainFree(dom);
         return FALSE;
     }