[PATCH 1/2] qemu_conf: Track embed root dir

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

 



When initializing virQEMUDriverConfig structure we are given the
root directory for possible embed connection. Save it for future
use. While we could get it later from @uri member, it's not as
easy as dereferencing a pointer (virURIParse() +
virURIGetParam() + error reporting).

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/qemu/qemu_conf.c | 2 ++
 src/qemu/qemu_conf.h | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 17a6eb3422..d57ffdaeb5 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -115,6 +115,7 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged,
 
     if (root) {
         cfg->uri = g_strdup_printf("qemu:///embed?root=%s", root);
+        cfg->root = g_strdup(root);
     } else {
         cfg->uri = g_strdup(privileged ? "qemu:///system" : "qemu:///session");
     }
@@ -299,6 +300,7 @@ static void virQEMUDriverConfigDispose(void *obj)
 
     virStringListFree(cfg->cgroupDeviceACL);
     VIR_FREE(cfg->uri);
+    VIR_FREE(cfg->root);
 
     VIR_FREE(cfg->configBaseDir);
     VIR_FREE(cfg->configDir);
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index 3ce9566b71..82fea63fbc 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -76,6 +76,8 @@ struct _virQEMUDriverConfig {
     virObject parent;
 
     char *uri;
+    char *root; /* The root directory for embed driver,
+                   NULL for system/session connections */
 
     uid_t user;
     gid_t group;
-- 
2.24.1





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

  Powered by Linux