[libvirt] [PATCH] virsh: print error in case of cellno is invalid

2011-01-05 Thread Osier Yang
If invalid cellno is specified, command freecell will still print the amount of available memory of node. As a fix, print error instead. * tools/virsh.c: vshCommandOptInt, return -1 when value for parameter is specified, but invalid, which means strtol was failed, it won't affects other

Re: [libvirt] [PATCH] virsh: print error in case of cellno is invalid

2011-01-05 Thread Eric Blake
On 01/05/2011 07:03 AM, Osier Yang wrote: If invalid cellno is specified, command freecell will still print the amount of available memory of node. As a fix, print error instead. * tools/virsh.c: vshCommandOptInt, return -1 when value for parameter is specified, but invalid, which means

Re: [libvirt] [PATCH] virsh: print error in case of cellno is invalid

2011-01-05 Thread Daniel P. Berrange
On Wed, Jan 05, 2011 at 10:10:00AM -0700, Eric Blake wrote: Style nit: you used: if (cond) { abc; def; } else xyz; But we prefer either: if (!cond) xyz; else { abc; def; } or: if (cond) { abc; def; } else { xyz; } since HACKING

Re: [libvirt] [PATCH] virsh: print error in case of cellno is invalid

2011-01-05 Thread Laine Stump
On 01/05/2011 12:49 PM, Daniel P. Berrange wrote: IMHO the hacking guideline should only allow if (foo) bar; else wizz; Or if (foo) { bar; ... } else { wizz; ... } +1 (just in case we're voting :-) -- libvir-list mailing list

Re: [libvirt] [PATCH] virsh: print error in case of cellno is invalid

2011-01-05 Thread Osier Yang
于 2011年01月06日 01:10, Eric Blake 写道: On 01/05/2011 07:03 AM, Osier Yang wrote: If invalid cellno is specified, command freecell will still print the amount of available memory of node. As a fix, print error instead. * tools/virsh.c: vshCommandOptInt, return -1 when value for parameter is