[PATCH v3 07/10] Revert "qemu_conf: Track embed root dir"

Michal Privoznik mprivozn at redhat.com
Tue Mar 31 16:24:19 UTC 2020


This reverts commit 06a19921b6a522cd7b4d352c9320909752947de3.

What I haven't realized when writing this ^^ commit is that the
virQEMUDriver structure already stores the root directory path.
And since the pointer is immutable it can be accessed right from
the structure and thus there is no need to duplicate it in the
driver config.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
Reviewed-by: Andrea Bolognani <abologna at redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413 at gmail.com>
Reviewed-by: Daniel P. Berrangé <berrange at redhat.com>
---
 src/qemu/qemu_conf.c | 2 --
 src/qemu/qemu_conf.h | 2 --
 2 files changed, 4 deletions(-)

diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 5339c5fc04..da2abb6188 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -115,7 +115,6 @@ 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");
     }
@@ -302,7 +301,6 @@ 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 89332eeb73..8a0d220ce7 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -76,8 +76,6 @@ 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




More information about the libvir-list mailing list