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

qemu_process: Setup paths within qemuProcessQMPInit

Move code for setting paths and prepping file system from
qemuProcessQMPNew to qemuProcessQMPInit.

This keeps qemuProcessQMPNew limited to data structures and path
initialization is done in qemuProcessQMPInit.

The patch is a non-functional, cut / paste change, however goto is now
"cleanup" rather than "error".
Signed-off-by: NChris Venteicher <cventeic@redhat.com>
Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 9f25cdf7
...@@ -8361,14 +8361,30 @@ qemuProcessQMPNew(const char *binary, ...@@ -8361,14 +8361,30 @@ qemuProcessQMPNew(const char *binary,
proc->runGid = runGid; proc->runGid = runGid;
proc->forceTCG = forceTCG; proc->forceTCG = forceTCG;
return proc;
error:
qemuProcessQMPFree(proc);
return NULL;
}
static int
qemuProcessQMPInit(qemuProcessQMPPtr proc)
{
int ret = -1;
VIR_DEBUG("proc=%p, emulator=%s", proc, proc->binary);
/* the ".sock" sufix is important to avoid a possible clash with a qemu /* the ".sock" sufix is important to avoid a possible clash with a qemu
* domain called "capabilities" * domain called "capabilities"
*/ */
if (virAsprintf(&proc->monpath, "%s/%s", proc->libDir, if (virAsprintf(&proc->monpath, "%s/%s", proc->libDir,
"capabilities.monitor.sock") < 0) "capabilities.monitor.sock") < 0)
goto error; goto cleanup;
if (virAsprintf(&proc->monarg, "unix:%s,server,nowait", proc->monpath) < 0) if (virAsprintf(&proc->monarg, "unix:%s,server,nowait", proc->monpath) < 0)
goto error; goto cleanup;
/* ".pidfile" suffix is used rather than ".pid" to avoid a possible clash /* ".pidfile" suffix is used rather than ".pid" to avoid a possible clash
* with a qemu domain called "capabilities" * with a qemu domain called "capabilities"
...@@ -8377,27 +8393,13 @@ qemuProcessQMPNew(const char *binary, ...@@ -8377,27 +8393,13 @@ qemuProcessQMPNew(const char *binary,
* than libvirtd. So we're using libDir which QEMU can write to * than libvirtd. So we're using libDir which QEMU can write to
*/ */
if (virAsprintf(&proc->pidfile, "%s/%s", proc->libDir, "capabilities.pidfile") < 0) if (virAsprintf(&proc->pidfile, "%s/%s", proc->libDir, "capabilities.pidfile") < 0)
goto error; goto cleanup;
virPidFileForceCleanupPath(proc->pidfile); virPidFileForceCleanupPath(proc->pidfile);
return proc;
error:
qemuProcessQMPFree(proc);
return NULL;
}
static int
qemuProcessQMPInit(qemuProcessQMPPtr proc)
{
int ret = -1;
VIR_DEBUG("proc=%p, emulator=%s", proc, proc->binary);
ret = 0; ret = 0;
cleanup:
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册