-----Original Message-----
From: Eric Blake [mailto:eblake@redhat.com]
Sent: Wednesday, October 23, 2013 5:49 PM
To: Chen Hanxiao; 'Michal Privoznik'
Cc: libvir-list(a)redhat.com
Subject: Re: [libvirt] [PATCH 1/5]virsh: disable config readonly and shareable in
virsh command
On 10/23/2013 09:57 AM, Chen Hanxiao wrote:
>> I don't think either of these approaches are needed. If you make
>> --shareable an undocumented alias of --mode=shareable, then the alias
>> handling code will already guarantee that only one of the two spellings
>> appears, and you don't have to do any screening here.
>>
>
> I think we still need these codes.
> We can stop <TAB> to complete it and we can also undocument it.
> But if users just type "--mode=readonly --shareable" and press ENTER, we
still need screen here.
No, the generic argument parser that checks that the user passed sane
arguments should have already flagged it before we get into
cmdAttachDisk, since the generic argument parser is what already knows
how to deal with VSH_OT_ALIAS. Inside cmdAttachDisk, you shouldn't have
to check for --shareable at all; the alias code should have already
converted it to canonical form before getting to the specific command.
I'll see if I can help write a patch to fix VSH_OT_ALIAS.
Thanks.
My v2 patches almost finished and will be posted in a few hours.
If this one could not fit our will, then please do me a favor :)
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org