]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: hotplug: Iterate over vcpu 0 in individual vcpu hotplug code
authorPeter Krempa <pkrempa@redhat.com>
Fri, 31 Mar 2017 11:02:14 +0000 (13:02 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 4 Apr 2017 07:10:03 +0000 (09:10 +0200)
Buggy condition meant that vcpu0 would not be iterated in the checks.
Since it's not hotpluggable anyways we would not be able to break the
configuration of a live VM.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1437013

src/qemu/qemu_hotplug.c

index de561da58e412eeec92240dbbb49159ff106a411..b5b520d8c665cca1f56db0b30398f132730f859e 100644 (file)
@@ -5784,7 +5784,7 @@ qemuDomainSetVcpuConfig(virDomainDefPtr def,
 
     def->individualvcpus = true;
 
-    while ((next = virBitmapNextSetBit(map, next)) > 0) {
+    while ((next = virBitmapNextSetBit(map, next)) >= 0) {
         if (!(vcpu = virDomainDefGetVcpu(def, next)))
             continue;
 
@@ -5817,7 +5817,7 @@ qemuDomainFilterHotplugVcpuEntities(virDomainDefPtr def,
         return NULL;
 
     /* make sure that all selected vcpus are in the correct state */
-    while ((next = virBitmapNextSetBit(map, next)) > 0) {
+    while ((next = virBitmapNextSetBit(map, next)) >= 0) {
         if (!(vcpu = virDomainDefGetVcpu(def, next)))
             continue;
 
@@ -5837,7 +5837,7 @@ qemuDomainFilterHotplugVcpuEntities(virDomainDefPtr def,
     /* Make sure that all vCPUs belonging to a single hotpluggable entity were
      * selected and then de-select any sub-threads of it. */
     next = -1;
-    while ((next = virBitmapNextSetBit(map, next)) > 0) {
+    while ((next = virBitmapNextSetBit(map, next)) >= 0) {
         if (!(vcpu = virDomainDefGetVcpu(def, next)))
             continue;