提交 9f25cdf7 编写于 作者: C Chris Venteicher 提交者: Jiri Denemark

qemu_process: Store libDir in qemuProcessQMP struct

Store libDir path in the qemuProcessQMP struct in anticipation of moving
path construction code into qemuProcessQMPInit function.
Signed-off-by: NChris Venteicher <cventeic@redhat.com>
Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 126f77b5
......@@ -8332,6 +8332,7 @@ qemuProcessQMPFree(qemuProcessQMPPtr proc)
qemuProcessQMPStop(proc);
VIR_FREE(proc->binary);
VIR_FREE(proc->libDir);
VIR_FREE(proc->monpath);
VIR_FREE(proc->monarg);
VIR_FREE(proc->pidfile);
......@@ -8352,7 +8353,8 @@ qemuProcessQMPNew(const char *binary,
if (VIR_ALLOC(proc) < 0)
goto error;
if (VIR_STRDUP(proc->binary, binary) < 0)
if (VIR_STRDUP(proc->binary, binary) < 0 ||
VIR_STRDUP(proc->libDir, libDir) < 0)
goto error;
proc->runUid = runUid;
......@@ -8362,7 +8364,7 @@ qemuProcessQMPNew(const char *binary,
/* the ".sock" sufix is important to avoid a possible clash with a qemu
* domain called "capabilities"
*/
if (virAsprintf(&proc->monpath, "%s/%s", libDir,
if (virAsprintf(&proc->monpath, "%s/%s", proc->libDir,
"capabilities.monitor.sock") < 0)
goto error;
if (virAsprintf(&proc->monarg, "unix:%s,server,nowait", proc->monpath) < 0)
......@@ -8374,7 +8376,7 @@ qemuProcessQMPNew(const char *binary,
* -daemonize we need QEMU to be allowed to create them, rather
* than libvirtd. So we're using libDir which QEMU can write to
*/
if (virAsprintf(&proc->pidfile, "%s/%s", libDir, "capabilities.pidfile") < 0)
if (virAsprintf(&proc->pidfile, "%s/%s", proc->libDir, "capabilities.pidfile") < 0)
goto error;
virPidFileForceCleanupPath(proc->pidfile);
......
......@@ -218,6 +218,7 @@ typedef struct _qemuProcessQMP qemuProcessQMP;
typedef qemuProcessQMP *qemuProcessQMPPtr;
struct _qemuProcessQMP {
char *binary;
char *libDir;
uid_t runUid;
gid_t runGid;
char *stderr;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册