x86/virt: Add enum for hypervisors to replace x86_hyper

The x86_hyper pointer is only used for checking whether a virtual
device is supporting the hypervisor the system is running on.

Use an enum for that purpose instead and drop the x86_hyper pointer.

Signed-off-by: Juergen Gross <[email protected]>
Acked-by: Thomas Gleixner <[email protected]>
Acked-by: Xavier Deguillard <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
Juergen Gross 2017-11-09 14:27:36 +01:00 • committed by Ingo Molnar
commit 03b2a320b1
11 changed files with 40 additions and 31 deletions

View file

@ -316,11 +316,9 @@ static int vmmouse_enable(struct psmouse *psmouse)
/*
* Array of supported hypervisors.
*/
static const struct hypervisor_x86 *vmmouse_supported_hypervisors[] = {
&x86_hyper_vmware,
#ifdef CONFIG_KVM_GUEST
&x86_hyper_kvm,
#endif
static enum x86_hypervisor_type vmmouse_supported_hypervisors[] = {
X86_HYPER_VMWARE,
X86_HYPER_KVM,
};
/**
@ -331,7 +329,7 @@ static bool vmmouse_check_hypervisor(void)
int i;
for (i = 0; i < ARRAY_SIZE(vmmouse_supported_hypervisors); i++)
if (vmmouse_supported_hypervisors[i] == x86_hyper)
if (vmmouse_supported_hypervisors[i] == x86_hyper_type)
return true;
return false;