]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: conf: Clarify paths that are relative to libDir
authorCole Robinson <crobinso@redhat.com>
Fri, 24 Apr 2015 00:16:30 +0000 (20:16 -0400)
committerCole Robinson <crobinso@redhat.com>
Mon, 27 Apr 2015 23:36:21 +0000 (19:36 -0400)
Rather than duplicate libDir for each new path

(cherry picked from commit c19f43ae7e69103b9db59be1dcab6f8236fa1b24)

src/qemu/qemu_conf.c

index 2cf3905a3e24fe3012168e31307f93cec9c8d74b..88a067a4a5ef0cd2ab1e9bf0fd03742dafe6fe5f 100644 (file)
@@ -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;