proc->runGid = runGid;
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
* domain called "capabilities"
*/
if (virAsprintf(&proc->monpath, "%s/%s", proc->libDir,
"capabilities.monitor.sock") < 0)
- goto error;
+ goto cleanup;
+
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
* with a qemu domain called "capabilities"
* than libvirtd. So we're using libDir which QEMU can write to
*/
if (virAsprintf(&proc->pidfile, "%s/%s", proc->libDir, "capabilities.pidfile") < 0)
- goto error;
+ goto cleanup;
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;
+ cleanup:
return ret;
}