diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 806aecb29d..ba9e44945b 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -2295,7 +2295,7 @@ qemuDomainAttachMemory(virQEMUDriver *driver, if (qemuDomainAdjustMaxMemLock(vm) < 0) goto removedef; - if (qemuProcessSetupEmulator(vm, true) < 0) + if (qemuProcessSetupEmulator(vm) < 0) goto removedef; restoreemulatorcgroup = true; @@ -2336,11 +2336,10 @@ qemuDomainAttachMemory(virQEMUDriver *driver, VIR_WARN("Unable to remove memory device from /dev"); if (releaseaddr) qemuDomainReleaseMemoryDeviceSlot(vm, mem); + if (restoreemulatorcgroup) + qemuProcessSetupEmulator(vm); } - if (restoreemulatorcgroup) - qemuProcessSetupEmulator(vm, false); - virDomainMemoryDefFree(mem); return ret; diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index a4a4a17a9b..1d3cdeff9a 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2596,9 +2596,7 @@ qemuProcessSetupPid(virDomainObj *vm, mem_mode == VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE)) { /* QEMU allocates its memory from the emulator thread. Thus it - * needs to access union of all host nodes configured. This is - * going to be replaced with proper value later in the startup - * process. */ + * needs to access union of all host nodes configured. */ if (unionMems && nameval == VIR_CGROUP_THREAD_EMULATOR && mem_mode != VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE) { @@ -2702,15 +2700,14 @@ qemuProcessSetupPid(virDomainObj *vm, int -qemuProcessSetupEmulator(virDomainObj *vm, - bool unionMems) +qemuProcessSetupEmulator(virDomainObj *vm) { return qemuProcessSetupPid(vm, vm->pid, VIR_CGROUP_THREAD_EMULATOR, 0, vm->def->cputune.emulatorpin, vm->def->cputune.emulator_period, vm->def->cputune.emulator_quota, vm->def->cputune.emulatorsched, - unionMems); + true); } @@ -7764,7 +7761,7 @@ qemuProcessLaunch(virConnectPtr conn, goto cleanup; VIR_DEBUG("Setting emulator tuning/settings"); - if (qemuProcessSetupEmulator(vm, true) < 0) + if (qemuProcessSetupEmulator(vm) < 0) goto cleanup; VIR_DEBUG("Setting cgroup for external devices (if required)"); @@ -7827,10 +7824,6 @@ qemuProcessLaunch(virConnectPtr conn, if (qemuConnectAgent(driver, vm) < 0) goto cleanup; - VIR_DEBUG("Fixing up emulator tuning/settings"); - if (qemuProcessSetupEmulator(vm, false) < 0) - goto cleanup; - VIR_DEBUG("setting up hotpluggable cpus"); if (qemuDomainHasHotpluggableStartupVcpus(vm->def)) { if (qemuDomainRefreshVcpuInfo(vm, asyncJob, false) < 0) diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h index 1c4c0678ab..cae1b49756 100644 --- a/src/qemu/qemu_process.h +++ b/src/qemu/qemu_process.h @@ -236,5 +236,4 @@ void qemuProcessCleanupMigrationJob(virQEMUDriver *driver, void qemuProcessRefreshDiskProps(virDomainDiskDef *disk, struct qemuDomainDiskInfo *info); -int qemuProcessSetupEmulator(virDomainObj *vm, - bool unionMems); +int qemuProcessSetupEmulator(virDomainObj *vm);