Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ca45aaae authored by Avi Kivity's avatar Avi Kivity
Browse files

KVM: Unset kvm_arch_ops if arch module loading failed



Otherwise, the core module thinks the arch module is loaded, and won't
let you reload it after you've fixed the bug.

Signed-off-by: default avatarAvi Kivity <avi@qumranet.com>
parent b720a3be
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -2464,7 +2464,7 @@ int kvm_init_arch(struct kvm_arch_ops *ops, struct module *module)

	r = kvm_arch_ops->hardware_setup();
	if (r < 0)
	    return r;
		goto out;

	on_each_cpu(kvm_arch_ops->hardware_enable, NULL, 0, 1);
	r = register_cpu_notifier(&kvm_cpu_notifier);
@@ -2500,6 +2500,8 @@ int kvm_init_arch(struct kvm_arch_ops *ops, struct module *module)
out_free_1:
	on_each_cpu(kvm_arch_ops->hardware_disable, NULL, 0, 1);
	kvm_arch_ops->hardware_unsetup();
out:
	kvm_arch_ops = NULL;
	return r;
}