[PATCH 1/2] qemu: Add some cpu hotpluggable inforamtion in vm xml when run "virsh setvcpus vm --count <current> --live".

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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








[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux