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

Eric Blake eblake at redhat.com
Wed Sep 5 16:24:16 UTC 2012


On 09/04/2012 09:16 AM, Osier Yang wrote:
> tools/virsh.c: New helper function vshStringToArray.
> tools/virsh.h: Declare vshStringToArray.
> tools/virsh-domain.c: use the helper in cmdUndefine.
> ---
>  tools/virsh-domain.c |   19 ++-----------------
>  tools/virsh.c        |   44 ++++++++++++++++++++++++++++++++++++++++++++
>  tools/virsh.h        |    1 +
>  3 files changed, 47 insertions(+), 17 deletions(-)

ACK.  This is a nice refactor for later use.

But down the road, do we want to borrow a leaf from qemu's book, and
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.

-- 
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/20120905/a02b2946/attachment-0001.sig>


More information about the libvir-list mailing list