mirror of https://github.com/xemu-project/xemu.git
Fix CPU topology initialization
Late initialization of CPU topology in CPUState prevents KVM guests to actually see the topology. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
af364b418c
commit
3f7638ec40
8
vl.c
8
vl.c
|
@ -3484,10 +3484,10 @@ void qemu_init_vcpu(void *_env)
|
||||||
{
|
{
|
||||||
CPUState *env = _env;
|
CPUState *env = _env;
|
||||||
|
|
||||||
if (kvm_enabled())
|
|
||||||
kvm_init_vcpu(env);
|
|
||||||
env->nr_cores = smp_cores;
|
env->nr_cores = smp_cores;
|
||||||
env->nr_threads = smp_threads;
|
env->nr_threads = smp_threads;
|
||||||
|
if (kvm_enabled())
|
||||||
|
kvm_init_vcpu(env);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3813,12 +3813,12 @@ void qemu_init_vcpu(void *_env)
|
||||||
{
|
{
|
||||||
CPUState *env = _env;
|
CPUState *env = _env;
|
||||||
|
|
||||||
|
env->nr_cores = smp_cores;
|
||||||
|
env->nr_threads = smp_threads;
|
||||||
if (kvm_enabled())
|
if (kvm_enabled())
|
||||||
kvm_start_vcpu(env);
|
kvm_start_vcpu(env);
|
||||||
else
|
else
|
||||||
tcg_init_vcpu(env);
|
tcg_init_vcpu(env);
|
||||||
env->nr_cores = smp_cores;
|
|
||||||
env->nr_threads = smp_threads;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void qemu_notify_event(void)
|
void qemu_notify_event(void)
|
||||||
|
|
Loading…
Reference in New Issue