Re: [PATCH 2/2] virsh: fix regression in parsing optional integer

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

 



On Tue, Apr 12, 2011 at 15:35:07 -0600, Eric Blake wrote:
> Regression introduced in 0.8.5, commit c1564268.  The command
> 'virsh freecell 0' quit working when it changed from an optional
> string to an optional integer.
> 
> This patch introduces a slight change that specifying an option
> twice is now detected as an error.
> 
> * tools/virsh.c (vshCmddefGetData, vshCmddefGetOption)
> (vshCommandCheckOpts): Alter parameters to use bitmaps.
> (vshCmddefOptParse): New function.
> (vshCommandParse): Update for better handling of positional
> arguments.
> (vshCmddefHelp): Allow unit tests to validate options.
> ---
>  tools/virsh.c |  149 +++++++++++++++++++++++++++++++++++++++-----------------
>  1 files changed, 104 insertions(+), 45 deletions(-)

100iI hate command line parsing in virsh.
^[

The code looks like it does what it's supposed to do and I guess we should be
fine with the limit for 32 arguments for a single virsh command :-) If not,
there's clearly something wrong about the command which would need more.

ACK

Jirka

--
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]