From: xiajidong <xiajidong@xxxxxxxxxxxxxxxxxxxx> The optional cpu attribute current can be used to specify whether fewer than the maximum number of virtual CPUs should be enabled. when run "virsh setvcpus vm --count <current> --live", it can display cpu hotpluggable information when run "virsh dumpxml vm | grep vcpu". so we can know the value of enabled and hotpluggable attributes of the current vcpus. Signed-off-by: Jidong Xia <xiajidong@xxxxxxxxxxxxxxxxxxxx> --- src/qemu/qemu_hotplug.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 14654a1..c574f63 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -6168,6 +6168,10 @@ qemuDomainSelectHotplugVcpuEntities(virDomainDefPtr def, } else { *enable = false; + if (nvcpus == curvcpus) { + def->individualvcpus = true; + } + for (i = maxvcpus - 1; i >= 0 && curvcpus > nvcpus; i--) { vcpu = virDomainDefGetVcpu(def, i); vcpupriv = QEMU_DOMAIN_VCPU_PRIVATE(vcpu); -- 1.8.3.1