On 09/06/2012 08:38 AM, Osier Yang wrote:
> allow for users to input ',,' for a literal comma that
does not separate
> options? If so, then we should merge in the double comma handling from
> vshParseSnapshotDiskspec (virsh-snapshot.c) into this function, and have
> that function also refactored to use this helper. Without something
> like that, users cannot input a literal comma when listing
> comma-separated arguments.
>
That will be nice, but seems useless for virsh now, the only two
commands which have option accepts multiple values are undefine
and pool-list. For domain undefine, the volumes can't have ',' in
the name (see the schema), for pool-list, pool types can't have ','
either.
I just pointed out that 'virsh snapshot-create-as' is a third virsh
command that accepts a list of comma-separated arguments, but where one
of the arguments is a file name and therefore uses ',,' escaping. So
I'm proposing that we _also_ merge vshParseSnapshotDiskspec into this
common helper routine, and thus make double ',,' parsing common
throughout virsh (even if most callers can't have ',' in a list element
in the first place); but it can be a separate patch.
--
Eric Blake eblake(a)redhat.com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org