提交 06a19921 编写于 作者: M Michal Privoznik

qemu_conf: Track embed root dir

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: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
上级 ac36a824
......@@ -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);
......
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册