]> git.ipfire.org Git - thirdparty/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)
committerCole Robinson <crobinso@redhat.com>
Wed, 10 May 2017 19:11:11 +0000 (15:11 -0400)
Vcpu order is required to stay sequential. Clear the order on cpu
coldplug to avoid issues with removing vcpus out of sequence.

(cherry picked from commit b416a33a6f49b7755a65d0de4ee09c770b79cc8d)

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;
     }
 }