[libvirt] [PATCH] Allow comma separated list of shutdown/reboot modes with virsh

Daniel P. Berrange berrange at redhat.com
Fri Nov 30 19:03:34 UTC 2012


On Fri, Nov 30, 2012 at 02:01:53PM -0500, Eric Blake wrote:
> 
> > > > +    if (!(modes = virStringSplit(mode, ",", 0))) {
> > > 
> > > Any reason you can't use vshStringToArray to do the split?
> > 
> > I didn't know it existed - utility functions like that shouldn't
> > be in virsh code anyway. Now I know it exists, I'll kill it off
> > in favour of virStringSplit everywhere.
> 
> Except that vshStingToArray _also_ does ',,' unescaping, so that:
> 
> a,b,,c,d
> 
> is split into "a", "b,c", "d", rather than "a", "b", "", "c", "d"
> 
> so we'd still need a post-processing path after virStringSplit.

Well, which users of vshStringToArray actually need that feature ?

IIUC, the only ones are those which accept arbitrary user strings,
which is only 1/2 users in virsh. The rest can use the new API
with no practical loss in functionality, since they use fixed strings
where ',' is not used.

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list