[libvirt] [PATCHv2 1/2] virsh: allow alias to expand to opt=value pair

Chen Hanxiao chenhanxiao at cn.fujitsu.com
Thu Oct 24 09:49:42 UTC 2013



> -----Original Message-----
> From: Eric Blake [mailto:eblake at redhat.com]
> Sent: Thursday, October 24, 2013 3:22 PM
> To: libvir-list at redhat.com
> Cc: chenhanxiao at cn.fujitsu.com
> Subject: [PATCHv2 1/2] virsh: allow alias to expand to opt=value pair
> 
> We want to treat 'attach-disk --shareable' as an undocumented
> alias for 'attach-disk --mode=shareable'.  By improving our
> alias handling, we can allow all such --bool -> --opt=value
> replacements, and guarantee up front that the alias is not
> mixed with its replacement.
> 
> * tools/virsh.c (vshCmddefOptParse, vshCmddefGetOption): Add
> support for expanding bool alias to --opt=value.
> (opts_echo): Add another alias to test it.
> * tests/virshtest.c (mymain): Test it.
> 
> Signed-off-by: Eric Blake <eblake at redhat.com>
> ---
>  tests/virshtest.c |  1 +
>  tools/virsh.c     | 58
> +++++++++++++++++++++++++++++++++++++++++++++++--------
>  2 files changed, 51 insertions(+), 8 deletions(-)
> 

ACK

Thanks!





More information about the libvir-list mailing list