Blob Blame History Raw
From 8f16d3dc1ba4ab8a1d057a45ab972f8c1abd7cda Mon Sep 17 00:00:00 2001
Message-Id: <8f16d3dc1ba4ab8a1d057a45ab972f8c1abd7cda@dist-git>
From: Peter Krempa <pkrempa@redhat.com>
Date: Wed, 14 Sep 2016 13:04:23 +0200
Subject: [PATCH] qemu: domain: Don't infer vcpu state

Use the state information (online, hotpluggable) provided by the monitor
code rather than trying to infer it. This fixes an issue where on
architectures that require hotplug of multiple threads at once the
sub-cores would get updated as offline on daemon restart thus creating
an invalid configuration.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1375783
(cherry picked from commit 64bc75f75606d0cc48432729b4618e2eae96accc)
---
 src/qemu/qemu_domain.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index f001c6e..8db2ed5 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -5878,15 +5878,11 @@ qemuDomainRefreshVcpuInfo(virQEMUDriverPtr driver,
         vcpupriv->enable_id = info[i].id;
 
         if (hotplug && state) {
-            vcpu->online = !!info[i].qom_path;
-
-            /* mark cpus that don't have an alias as non-hotpluggable */
-            if (vcpu->online) {
-                if (vcpupriv->alias)
-                    vcpu->hotpluggable = VIR_TRISTATE_BOOL_YES;
-                else
-                    vcpu->hotpluggable = VIR_TRISTATE_BOOL_NO;
-            }
+            vcpu->online = info[i].online;
+            if (info[i].hotpluggable)
+                vcpu->hotpluggable = VIR_TRISTATE_BOOL_YES;
+            else
+                vcpu->hotpluggable = VIR_TRISTATE_BOOL_NO;
         }
     }
 
-- 
2.10.0