[PATCH 1/4] qemu: conf: Clarify paths that are relative to libDir

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

 



Rather than duplicate libDir for each new path
---
 src/qemu/qemu_conf.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index b662b69..1075e26 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -192,21 +192,18 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged)
                       "%s/run/libvirt/qemu", LOCALSTATEDIR) < 0)
             goto error;
 
-        if (virAsprintf(&cfg->libDir,
-                      "%s/lib/libvirt/qemu", LOCALSTATEDIR) < 0)
-            goto error;
-
         if (virAsprintf(&cfg->cacheDir,
                       "%s/cache/libvirt/qemu", LOCALSTATEDIR) < 0)
             goto error;
-        if (virAsprintf(&cfg->saveDir,
-                      "%s/lib/libvirt/qemu/save", LOCALSTATEDIR) < 0)
+
+        if (virAsprintf(&cfg->libDir,
+                      "%s/lib/libvirt/qemu", LOCALSTATEDIR) < 0)
+            goto error;
+        if (virAsprintf(&cfg->saveDir, "%s/save", cfg->libDir) < 0)
             goto error;
-        if (virAsprintf(&cfg->snapshotDir,
-                        "%s/lib/libvirt/qemu/snapshot", LOCALSTATEDIR) < 0)
+        if (virAsprintf(&cfg->snapshotDir, "%s/snapshot", cfg->libDir) < 0)
             goto error;
-        if (virAsprintf(&cfg->autoDumpPath,
-                        "%s/lib/libvirt/qemu/dump", LOCALSTATEDIR) < 0)
+        if (virAsprintf(&cfg->autoDumpPath, "%s/dump", cfg->libDir) < 0)
             goto error;
     } else {
         char *rundir;
-- 
2.3.5

--
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]