@@ -2527,6 +2527,11 @@ static int kvm_init(MachineState *ms)
type = kvm_arch_get_default_type(ms);
}
+ if (type < 0) {
+ ret = -EINVAL;
+ goto err;
+ }
+
do {
ret = kvm_ioctl(s, KVM_CREATE_VM, type);
} while (ret == -EINTR);
@@ -2913,7 +2913,7 @@ static int virt_kvm_type(MachineState *ms, const char *type_str)
"require an IPA range (%d bits) larger than "
"the one supported by the host (%d bits)",
requested_pa_size, max_vm_pa_size);
- exit(1);
+ return -1;
}
/*
* We return the requested PA log size, unless KVM only supports
@@ -3105,7 +3105,7 @@ static int spapr_kvm_type(MachineState *machine, const char *vm_type)
}
error_report("Unknown kvm-type specified '%s'", vm_type);
- exit(1);
+ return -1;
}
/*