6ae9ed
From 8f16d3dc1ba4ab8a1d057a45ab972f8c1abd7cda Mon Sep 17 00:00:00 2001
6ae9ed
Message-Id: <8f16d3dc1ba4ab8a1d057a45ab972f8c1abd7cda@dist-git>
6ae9ed
From: Peter Krempa <pkrempa@redhat.com>
6ae9ed
Date: Wed, 14 Sep 2016 13:04:23 +0200
6ae9ed
Subject: [PATCH] qemu: domain: Don't infer vcpu state
6ae9ed
6ae9ed
Use the state information (online, hotpluggable) provided by the monitor
6ae9ed
code rather than trying to infer it. This fixes an issue where on
6ae9ed
architectures that require hotplug of multiple threads at once the
6ae9ed
sub-cores would get updated as offline on daemon restart thus creating
6ae9ed
an invalid configuration.
6ae9ed
6ae9ed
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1375783
6ae9ed
(cherry picked from commit 64bc75f75606d0cc48432729b4618e2eae96accc)
6ae9ed
---
6ae9ed
 src/qemu/qemu_domain.c | 14 +++++---------
6ae9ed
 1 file changed, 5 insertions(+), 9 deletions(-)
6ae9ed
6ae9ed
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
6ae9ed
index f001c6e..8db2ed5 100644
6ae9ed
--- a/src/qemu/qemu_domain.c
6ae9ed
+++ b/src/qemu/qemu_domain.c
6ae9ed
@@ -5878,15 +5878,11 @@ qemuDomainRefreshVcpuInfo(virQEMUDriverPtr driver,
6ae9ed
         vcpupriv->enable_id = info[i].id;
6ae9ed
 
6ae9ed
         if (hotplug && state) {
6ae9ed
-            vcpu->online = !!info[i].qom_path;
6ae9ed
-
6ae9ed
-            /* mark cpus that don't have an alias as non-hotpluggable */
6ae9ed
-            if (vcpu->online) {
6ae9ed
-                if (vcpupriv->alias)
6ae9ed
-                    vcpu->hotpluggable = VIR_TRISTATE_BOOL_YES;
6ae9ed
-                else
6ae9ed
-                    vcpu->hotpluggable = VIR_TRISTATE_BOOL_NO;
6ae9ed
-            }
6ae9ed
+            vcpu->online = info[i].online;
6ae9ed
+            if (info[i].hotpluggable)
6ae9ed
+                vcpu->hotpluggable = VIR_TRISTATE_BOOL_YES;
6ae9ed
+            else
6ae9ed
+                vcpu->hotpluggable = VIR_TRISTATE_BOOL_NO;
6ae9ed
         }
6ae9ed
     }
6ae9ed
 
6ae9ed
-- 
6ae9ed
2.10.0
6ae9ed