mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 23:07:44 +00:00
qemu: cpu: unplug: Remove vcpu pinning on cold cpu unplug
Remove the pinning info when removing to CPU, otherwise when the VM will be started our code will try to pin non-existing vcpus as the definition wasn't updated. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1129372
This commit is contained in:
parent
64bbf4c33d
commit
60df621f75
@ -4277,6 +4277,7 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
|
|||||||
qemuAgentCPUInfoPtr cpuinfo = NULL;
|
qemuAgentCPUInfoPtr cpuinfo = NULL;
|
||||||
int ncpuinfo;
|
int ncpuinfo;
|
||||||
qemuDomainObjPrivatePtr priv;
|
qemuDomainObjPrivatePtr priv;
|
||||||
|
size_t i;
|
||||||
|
|
||||||
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
|
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
|
||||||
VIR_DOMAIN_AFFECT_CONFIG |
|
VIR_DOMAIN_AFFECT_CONFIG |
|
||||||
@ -4386,6 +4387,12 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
||||||
|
/* remove vcpupin entries for vcpus that were unplugged */
|
||||||
|
if (nvcpus < persistentDef->vcpus) {
|
||||||
|
for (i = persistentDef->vcpus; i >= nvcpus; i--)
|
||||||
|
virDomainVcpuPinDel(persistentDef, i);
|
||||||
|
}
|
||||||
|
|
||||||
if (maximum) {
|
if (maximum) {
|
||||||
persistentDef->maxvcpus = nvcpus;
|
persistentDef->maxvcpus = nvcpus;
|
||||||
if (nvcpus < persistentDef->vcpus)
|
if (nvcpus < persistentDef->vcpus)
|
||||||
|
Loading…
Reference in New Issue
Block a user