[PATCH 2/2] qemu: Add some cpu hotpluggable inforamtion in vm xml when run "virsh setvcpus vm --count --config".

Jidong Xia xiajidong at cmss.chinamobile.com
Thu Apr 9 12:38:48 UTC 2020


when run "virsh setvcpus vm --count <current> --config", and
destroy vm, then start vm, 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 at cmss.chinamobile.com>
---
 src/qemu/qemu_hotplug.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index c574f63..312f257 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -6274,8 +6274,10 @@ qemuDomainSetVcpusConfig(virDomainDefPtr def,
     /* ordering information may become invalid, thus clear it */
     virDomainDefVcpuOrderClear(def);

-    if (curvcpus == nvcpus)
+    if (curvcpus == nvcpus) {
+        def->individualvcpus = true;
         return;
+    }

     if (curvcpus < nvcpus) {
         for (i = 0; i < maxvcpus; i++) {
--
1.8.3.1







More information about the libvir-list mailing list