From: Daniel Veillard Date: Wed, 15 Aug 2007 10:18:33 +0000 (+0000) Subject: * src/virsh.c: fixed 2 small bugs in setvcpus command, after X-Git-Tag: LIBVIRT_0_3_2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7b5e2c2d86c987a6846ec15199b0cef2521225b;p=thirdparty%2Flibvirt.git * src/virsh.c: fixed 2 small bugs in setvcpus command, after Atsushi SAKAI pointed out a value checking problem Daniel --- diff --git a/ChangeLog b/ChangeLog index 3ccf5ecd5a..618dab68ad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Aug 15 12:21:13 CEST 2007 Daniel Veillard + + * 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 * src/proxy_internal.c: fix the UUID lookup though proxy, by diff --git a/src/virsh.c b/src/virsh.c index ecf53908f5..5ad356572c 100644 --- a/src/virsh.c +++ b/src/virsh.c @@ -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; }