[libvirt] [PATCH] qemu: clear vcpupin when unhotplug vcpu

step1: hotplug vcpus step2: pin vcpus step3: unhotplug vcpus As a result, vcpu pin info still show up in xml. So we need clear it. Signed-off-by: Xu Yandong <xuyandong2@huawei.com> --- src/qemu/qemu_hotplug.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 62e505b779..df94b54d09 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -6105,6 +6105,9 @@ qemuDomainHotplugDelVcpu(virQEMUDriverPtr driver, qemuDomainVcpuPersistOrder(vm->def); + virBitmapFree(vcpuinfo->cpumask); + vcpuinfo->cpumask = NULL; + if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) goto cleanup; @@ -6390,6 +6393,8 @@ qemuDomainSetVcpusConfig(virDomainDefPtr def, vcpu->online = false; vcpu->hotpluggable = VIR_TRISTATE_BOOL_YES; + virBitmapFree(vcpu->cpumask); + vcpu->cpumask = NULL; if (--curvcpus == nvcpus) break; -- 2.18.1

On Thu, Sep 19, 2019 at 04:01:54 -0400, Xu Yandong wrote:
step1: hotplug vcpus step2: pin vcpus step3: unhotplug vcpus As a result, vcpu pin info still show up in xml. So we need clear it.
Signed-off-by: Xu Yandong <xuyandong2@huawei.com> ---
The idea is that you can pre-configure the vcpu pinning info before hotplugging the cpu. This means that the pinning is a configuration value even if the vCPU is offline thus the existing behaviour is desired.
participants (2)
-
Peter Krempa
-
Xu Yandong