mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +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 */
|
/* Returns true if a compression program is available in PATH */
|
||||||
static bool qemuCompressProgramAvailable(virQEMUSaveFormat compress)
|
static bool
|
||||||
|
qemuCompressProgramAvailable(virQEMUSaveFormat compress)
|
||||||
{
|
{
|
||||||
const char *prog;
|
char *path;
|
||||||
char *c;
|
|
||||||
|
|
||||||
if (compress == QEMU_SAVE_FORMAT_RAW)
|
if (compress == QEMU_SAVE_FORMAT_RAW)
|
||||||
return true;
|
return true;
|
||||||
prog = qemuSaveCompressionTypeToString(compress);
|
|
||||||
c = virFindFileInPath(prog);
|
if (!(path = virFindFileInPath(qemuSaveCompressionTypeToString(compress))))
|
||||||
if (!c)
|
|
||||||
return false;
|
return false;
|
||||||
VIR_FREE(c);
|
|
||||||
|
VIR_FREE(path);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user