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
This commit is contained in:
Peter Krempa 2016-09-13 17:56:08 +02:00
parent 2a0e68be91
commit 64bc75f756

View File

@ -5941,15 +5941,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;
}
}