[libvirt] [PATCH 06/10] list: Add helper to convert strings separated by ', ' to array

Eric Blake eblake at redhat.com
Thu Sep 6 21:02:45 UTC 2012


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 at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 617 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120906/520b8ae2/attachment-0001.sig>


More information about the libvir-list mailing list