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

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



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


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