mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
qemu: refactor qemuCompressProgramAvailable()
This commit is contained in:
parent
f2b0a5336e
commit
a863b89010
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user