mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemu_process: Move monitor code to qemuProcessQMPConnectMonitor
All code related to QEMU monitor is moved from qemuProcessQMPNew and qemuProcessQMPInit into qemuProcessQMPConnectMonitor. Signed-off-by: Chris Venteicher <cventeic@redhat.com> Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
cfaebe837c
commit
126f77b55f
@ -8379,10 +8379,6 @@ qemuProcessQMPNew(const char *binary,
|
|||||||
|
|
||||||
virPidFileForceCleanupPath(proc->pidfile);
|
virPidFileForceCleanupPath(proc->pidfile);
|
||||||
|
|
||||||
proc->config.type = VIR_DOMAIN_CHR_TYPE_UNIX;
|
|
||||||
proc->config.data.nix.path = proc->monpath;
|
|
||||||
proc->config.data.nix.listen = false;
|
|
||||||
|
|
||||||
return proc;
|
return proc;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
@ -8407,7 +8403,6 @@ qemuProcessQMPInit(qemuProcessQMPPtr proc)
|
|||||||
static int
|
static int
|
||||||
qemuProcessQMPLaunch(qemuProcessQMPPtr proc)
|
qemuProcessQMPLaunch(qemuProcessQMPPtr proc)
|
||||||
{
|
{
|
||||||
virDomainXMLOptionPtr xmlopt = NULL;
|
|
||||||
const char *machine;
|
const char *machine;
|
||||||
int status = 0;
|
int status = 0;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
@ -8470,6 +8465,26 @@ qemuProcessQMPLaunch(qemuProcessQMPPtr proc)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ret = 0;
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int
|
||||||
|
qemuProcessQMPConnectMonitor(qemuProcessQMPPtr proc)
|
||||||
|
{
|
||||||
|
virDomainXMLOptionPtr xmlopt = NULL;
|
||||||
|
int ret = -1;
|
||||||
|
|
||||||
|
VIR_DEBUG("proc=%p, emulator=%s, proc->pid=%lld",
|
||||||
|
proc, proc->binary, (long long)proc->pid);
|
||||||
|
|
||||||
|
proc->config.type = VIR_DOMAIN_CHR_TYPE_UNIX;
|
||||||
|
proc->config.data.nix.path = proc->monpath;
|
||||||
|
proc->config.data.nix.listen = false;
|
||||||
|
|
||||||
if (!(xmlopt = virDomainXMLOptionNew(NULL, NULL, NULL, NULL, NULL)) ||
|
if (!(xmlopt = virDomainXMLOptionNew(NULL, NULL, NULL, NULL, NULL)) ||
|
||||||
!(proc->vm = virDomainObjNew(xmlopt)))
|
!(proc->vm = virDomainObjNew(xmlopt)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -8485,24 +8500,7 @@ qemuProcessQMPLaunch(qemuProcessQMPPtr proc)
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (!proc->mon)
|
|
||||||
qemuProcessQMPStop(proc);
|
|
||||||
virObjectUnref(xmlopt);
|
virObjectUnref(xmlopt);
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
qemuProcessQMPConnectMonitor(qemuProcessQMPPtr proc)
|
|
||||||
{
|
|
||||||
int ret = -1;
|
|
||||||
|
|
||||||
VIR_DEBUG("proc=%p, emulator=%s, proc->pid=%lld",
|
|
||||||
proc, proc->binary, (long long)proc->pid);
|
|
||||||
|
|
||||||
ret = 0;
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user