mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-30 12:31:16 +00:00
qemu_hotplug: Temporarily allow emulator thread to access other NUMA nodes during mem hotplug
Again, this fixes the same problem as one of previous commits, but this time for memory hotplug. Long story short, if there's a domain running and the emulator thread is restricted to a subset of host NUMA nodes, but the memory that's about to be hotplugged requires memory from a host NUMA node that's not in the set we need to allow emulator thread to access the node, temporarily. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
3ec6d586bc
commit
e53291514c
@ -2247,6 +2247,7 @@ qemuDomainAttachMemory(virQEMUDriver *driver,
|
|||||||
bool teardownlabel = false;
|
bool teardownlabel = false;
|
||||||
bool teardowncgroup = false;
|
bool teardowncgroup = false;
|
||||||
bool teardowndevice = false;
|
bool teardowndevice = false;
|
||||||
|
bool restoreemulatorcgroup = false;
|
||||||
g_autoptr(virJSONValue) props = NULL;
|
g_autoptr(virJSONValue) props = NULL;
|
||||||
virObjectEvent *event;
|
virObjectEvent *event;
|
||||||
int id;
|
int id;
|
||||||
@ -2294,6 +2295,10 @@ qemuDomainAttachMemory(virQEMUDriver *driver,
|
|||||||
if (qemuDomainAdjustMaxMemLock(vm) < 0)
|
if (qemuDomainAdjustMaxMemLock(vm) < 0)
|
||||||
goto removedef;
|
goto removedef;
|
||||||
|
|
||||||
|
if (qemuProcessSetupEmulator(vm, true) < 0)
|
||||||
|
goto removedef;
|
||||||
|
restoreemulatorcgroup = true;
|
||||||
|
|
||||||
qemuDomainObjEnterMonitor(vm);
|
qemuDomainObjEnterMonitor(vm);
|
||||||
if (qemuMonitorAddObject(priv->mon, &props, NULL) < 0)
|
if (qemuMonitorAddObject(priv->mon, &props, NULL) < 0)
|
||||||
goto exit_monitor;
|
goto exit_monitor;
|
||||||
@ -2333,6 +2338,9 @@ qemuDomainAttachMemory(virQEMUDriver *driver,
|
|||||||
qemuDomainReleaseMemoryDeviceSlot(vm, mem);
|
qemuDomainReleaseMemoryDeviceSlot(vm, mem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (restoreemulatorcgroup)
|
||||||
|
qemuProcessSetupEmulator(vm, false);
|
||||||
|
|
||||||
virDomainMemoryDefFree(mem);
|
virDomainMemoryDefFree(mem);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
@ -2701,7 +2701,7 @@ qemuProcessSetupPid(virDomainObj *vm,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int
|
int
|
||||||
qemuProcessSetupEmulator(virDomainObj *vm,
|
qemuProcessSetupEmulator(virDomainObj *vm,
|
||||||
bool unionMems)
|
bool unionMems)
|
||||||
{
|
{
|
||||||
|
@ -235,3 +235,6 @@ void qemuProcessCleanupMigrationJob(virQEMUDriver *driver,
|
|||||||
|
|
||||||
void qemuProcessRefreshDiskProps(virDomainDiskDef *disk,
|
void qemuProcessRefreshDiskProps(virDomainDiskDef *disk,
|
||||||
struct qemuDomainDiskInfo *info);
|
struct qemuDomainDiskInfo *info);
|
||||||
|
|
||||||
|
int qemuProcessSetupEmulator(virDomainObj *vm,
|
||||||
|
bool unionMems);
|
||||||
|
Loading…
Reference in New Issue
Block a user