[PATCH 2/4] qemu: refactor qemuCompressProgramAvailable()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 src/qemu/qemu_driver.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index b9f340c..cfdbb9a 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -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;
 }

-- 
1.8.3.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]