mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +00:00
Pull code to start CPUs executing out of qemudInitCpuAffinity()
The code to start CPUs executing has nothing todo with CPU affinity masks, so pull it out of the qemudInitCpuAffinity() method and up into qemudStartVMDaemon() * src/qemu/qemu_driver.c: Pull code to start CPUs executing out of qemudInitCpuAffinity()
This commit is contained in:
parent
8c12b20c61
commit
5697aa848b
@ -1389,13 +1389,10 @@ qemuDetectVcpuPIDs(virConnectPtr conn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
qemudInitCpus(virConnectPtr conn,
|
qemudInitCpuAffinity(virConnectPtr conn,
|
||||||
struct qemud_driver *driver,
|
virDomainObjPtr vm) {
|
||||||
virDomainObjPtr vm,
|
|
||||||
const char *migrateFrom) {
|
|
||||||
int i, hostcpus, maxcpu = QEMUD_CPUMASK_LEN;
|
int i, hostcpus, maxcpu = QEMUD_CPUMASK_LEN;
|
||||||
virNodeInfo nodeinfo;
|
virNodeInfo nodeinfo;
|
||||||
qemuDomainObjPrivatePtr priv = vm->privateData;
|
|
||||||
unsigned char *cpumap;
|
unsigned char *cpumap;
|
||||||
int cpumaplen;
|
int cpumaplen;
|
||||||
|
|
||||||
@ -1440,20 +1437,6 @@ qemudInitCpus(virConnectPtr conn,
|
|||||||
}
|
}
|
||||||
VIR_FREE(cpumap);
|
VIR_FREE(cpumap);
|
||||||
|
|
||||||
/* XXX This resume doesn't really belong here. Move it up to caller */
|
|
||||||
if (migrateFrom == NULL) {
|
|
||||||
/* Allow the CPUS to start executing */
|
|
||||||
qemuDomainObjEnterMonitorWithDriver(driver, vm);
|
|
||||||
if (qemuMonitorStartCPUs(priv->mon, conn) < 0) {
|
|
||||||
if (virGetLastError() == NULL)
|
|
||||||
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
|
||||||
"%s", _("resume operation failed"));
|
|
||||||
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2343,7 +2326,7 @@ static int qemudStartVMDaemon(virConnectPtr conn,
|
|||||||
if (qemuDetectVcpuPIDs(conn, driver, vm) < 0)
|
if (qemuDetectVcpuPIDs(conn, driver, vm) < 0)
|
||||||
goto abort;
|
goto abort;
|
||||||
|
|
||||||
if (qemudInitCpus(conn, driver, vm, migrateFrom) < 0)
|
if (qemudInitCpuAffinity(conn, vm) < 0)
|
||||||
goto abort;
|
goto abort;
|
||||||
|
|
||||||
if (qemuInitPasswords(driver, vm) < 0)
|
if (qemuInitPasswords(driver, vm) < 0)
|
||||||
@ -2354,8 +2337,20 @@ static int qemudStartVMDaemon(virConnectPtr conn,
|
|||||||
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
||||||
goto abort;
|
goto abort;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (migrateFrom == NULL) {
|
||||||
|
/* Allow the CPUS to start executing */
|
||||||
|
if (qemuMonitorStartCPUs(priv->mon, conn) < 0) {
|
||||||
|
if (virGetLastError() == NULL)
|
||||||
|
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
||||||
|
"%s", _("resume operation failed"));
|
||||||
|
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
||||||
|
goto abort;
|
||||||
|
}
|
||||||
|
}
|
||||||
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
||||||
|
|
||||||
|
|
||||||
if (virDomainSaveStatus(conn, driver->stateDir, vm) < 0)
|
if (virDomainSaveStatus(conn, driver->stateDir, vm) < 0)
|
||||||
goto abort;
|
goto abort;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user