mirror of https://github.com/xqemu/xqemu.git
kvm: Handle kvm_init_vcpu errors
Do not ignore errors of kvm_init_vcpu, they are fatal. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
This commit is contained in:
parent
d31ae052a9
commit
84b4915dd2
19
cpus.c
19
cpus.c
|
@ -265,12 +265,18 @@ void qemu_main_loop_start(void)
|
||||||
void qemu_init_vcpu(void *_env)
|
void qemu_init_vcpu(void *_env)
|
||||||
{
|
{
|
||||||
CPUState *env = _env;
|
CPUState *env = _env;
|
||||||
|
int r;
|
||||||
|
|
||||||
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);
|
if (kvm_enabled()) {
|
||||||
return;
|
r = kvm_init_vcpu(env);
|
||||||
|
if (r < 0) {
|
||||||
|
fprintf(stderr, "kvm_init_vcpu failed: %s\n", strerror(-r));
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int qemu_cpu_self(void *env)
|
int qemu_cpu_self(void *env)
|
||||||
|
@ -600,11 +606,16 @@ static int qemu_cpu_exec(CPUState *env);
|
||||||
static void *kvm_cpu_thread_fn(void *arg)
|
static void *kvm_cpu_thread_fn(void *arg)
|
||||||
{
|
{
|
||||||
CPUState *env = arg;
|
CPUState *env = arg;
|
||||||
|
int r;
|
||||||
|
|
||||||
qemu_mutex_lock(&qemu_global_mutex);
|
qemu_mutex_lock(&qemu_global_mutex);
|
||||||
qemu_thread_self(env->thread);
|
qemu_thread_self(env->thread);
|
||||||
|
|
||||||
kvm_init_vcpu(env);
|
r = kvm_init_vcpu(env);
|
||||||
|
if (r < 0) {
|
||||||
|
fprintf(stderr, "kvm_init_vcpu failed: %s\n", strerror(-r));
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
kvm_init_ipi(env);
|
kvm_init_ipi(env);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue