qemu: refactor qemuCompressProgramAvailable()

This commit is contained in:
Peter Krempa 2013-10-09 18:05:13 +02:00
parent f2b0a5336e
commit a863b89010

View File

@ -3138,18 +3138,18 @@ cleanup:
}
/* Returns true if a compression program is available in PATH */
static bool qemuCompressProgramAvailable(virQEMUSaveFormat compress)
static bool
qemuCompressProgramAvailable(virQEMUSaveFormat compress)
{
const char *prog;
char *c;
char *path;
if (compress == QEMU_SAVE_FORMAT_RAW)
return true;
prog = qemuSaveCompressionTypeToString(compress);
c = virFindFileInPath(prog);
if (!c)
if (!(path = virFindFileInPath(qemuSaveCompressionTypeToString(compress))))
return false;
VIR_FREE(c);
VIR_FREE(path);
return true;
}