]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: hotplug: Clear vcpu ordering for coldplug of vcpus
authorPeter Krempa <pkrempa@redhat.com>
Fri, 31 Mar 2017 11:05:47 +0000 (13:05 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 4 Apr 2017 07:10:03 +0000 (09:10 +0200)
Vcpu order is required to stay sequential. Clear the order on cpu
coldplug to avoid issues with removing vcpus out of sequence.

src/qemu/qemu_hotplug.c

index 48de6b81546b92bd5f09ccef67f8773a307b3291..5488b1dd4d177074d1fb6b90f3a5978980852279 100644 (file)
@@ -5784,13 +5784,15 @@ qemuDomainSetVcpuConfig(virDomainDefPtr def,
 
     def->individualvcpus = true;
 
+    /* ordering information may become invalid, thus clear it */
+    virDomainDefVcpuOrderClear(def);
+
     while ((next = virBitmapNextSetBit(map, next)) >= 0) {
         if (!(vcpu = virDomainDefGetVcpu(def, next)))
             continue;
 
         vcpu->online = state;
         vcpu->hotpluggable = VIR_TRISTATE_BOOL_YES;
-        vcpu->order = 0;
     }
 }