• E
    qemu: simplify list cleanup · 41b55056
    Eric Blake 提交于
    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: NEric Blake <eblake@redhat.com>
    41b55056
qemu_command.h 12.7 KB