Re: [PATCH v6 5/6] virsh: Expose new virDomainFSFreeze and virDomainFSThaw API

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

 



On 05/01/2014 03:38 AM, Daniel P. Berrange wrote:

>>
>> The parser already accepts repeated options (well, precisely ONE
>> repeated option), by making that option be last in the command
>> description and giving it .type = VSH_OT_ARGV.  For comparison, see the
>> echo command in virsh.c or the send-key command in virsh-domain.c.
> 
> That seems rather uneccessarily strict to me. I think it is entirely
> valid to allow any --fooo option to be marked as allowing repeats,
> not require it to be the final non-option argument.

The repeated option is not required to be last in the user's command
line, only that it is declared last in the C code.  However, using a
repeated option in anything other than the last position makes for more
work for the end user.  As an example, these two commands are equivalent:

$ virsh echo --shell hello\! world
'hello!' world
$ virsh echo --string hello\! --string world --shell
'hello!' world

Supporting more than one option to be repeated might be possible (you'd
have to patch the option parser to allow it), but using that gets tricky
(you now HAVE to supply the option name for practically all repetitions
of the option; at most one of the repeated options can take advantage of
positional encoding for omitting the option name).

But this particular example doesn't strike me as a case where we need
multiple repeated options - multiple mountpoints is really all the more
this command needs, and that works just fine with the existing
framework, without needing to invent support for a command with two
repeated options.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

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