]> xenbits.xensource.com Git - libvirt.git/commit
qemu: simplify list cleanup
authorEric Blake <eblake@redhat.com>
Wed, 28 Aug 2013 21:01:23 +0000 (15:01 -0600)
committerDaniel P. Berrange <berrange@redhat.com>
Thu, 5 Sep 2013 10:25:26 +0000 (11:25 +0100)
commit41b550567918790cb304378f39c3ba369bcca28e
tree735985c79e63a9dae0214037cb81cf00f0e54a6c
parenta3d24862df9d717b95fae3951019fa150a9d4e09
qemu: simplify list cleanup

No need to open code now that we have a nice function.

Interestingly, our virStringFreeList function is typed correctly
(a malloc'd list of malloc'd strings is NOT const, whether at the
point where it is created, or at the point where it is cleand up),
so using it with a 'const char **' argument would require a cast
to keep the compiler.  I chose instead to remove const from code
even where we don't modify the argument, just to avoid the need
to cast.

* src/qemu/qemu_command.h (qemuParseCommandLine): Drop declaration.
* src/qemu/qemu_command.c (qemuParseProcFileStrings)
(qemuStringToArgvEnv): Don't force malloc'd result to be const.
(qemuParseCommandLinePid, qemuParseCommandLineString): Simplify
cleanup.
(qemuParseCommandLine, qemuFindEnv): Drop const-correctness to
avoid the need to cast in callers.

Signed-off-by: Eric Blake <eblake@redhat.com>
src/qemu/qemu_command.c
src/qemu/qemu_command.h