kvm: Add ifdef around IA64 ioctls.
PATCH 1/1 kvm: Add ifdef around IA64 ioctls.
From: Vinson Lee <[email protected]>
Fix build error.
CC ioctls/kvm.o
In file included from ioctls/kvm.c:8:0:ioctls/kvm.c:115:8: error: ‘KVM_IA64_VCPU_GET_STACK’ undeclared here (not in a function)
IOCTL(KVM_IA64_VCPU_GET_STACK),
^
include/ioctls.h:53:15: note: in definition of macro ‘IOCTL’
{ .request = _request, .name = #_request, }
^
ioctls/kvm.c:116:8: error: ‘KVM_IA64_VCPU_SET_STACK’ undeclared here (not in a function)
IOCTL(KVM_IA64_VCPU_SET_STACK),
^include/ioctls.h:53:15: note: in definition of macro ‘IOCTL’
{ .request = _request, .name = #_request, }
IA64 ioctls were removed in Linux 3.19.
commit 6b397158d07f885154b871a15f879d25b3de7579
Author: Radim Krčmář <[email protected]> Date: Thu Nov 20 14:43:18 2014 +0100
kvm: remove IA64 ioctls
KVM ia64 is no longer present so new applications shouldn't use them.
The main problem is that they most likely didn't work even before,
because of a conflict in the #defines:
#define KVM_SET_GUEST_DEBUG _IOW(KVMIO, 0x9b, struct kvm_guest_debug)
#define KVM_IA64_VCPU_SET_STACK _IOW(KVMIO, 0x9b, void *)
The argument to KVM_SET_GUEST_DEBUG is:
struct kvm_guest_debug {
__u32 control;
__u32 pad;
struct kvm_guest_debug_arch arch;
};
struct kvm_guest_debug_arch {
};
meaning that sizeof(struct kvm_guest_debug) == sizeof(void *) == 8
and KVM_SET_GUEST_DEBUG == KVM_IA64_VCPU_SET_STACK.
KVM_SET_GUEST_DEBUG is handled in virt/kvm/kvm_main.c before even calling
kvm_arch_vcpu_ioctl (which would have handled KVM_IA64_VCPU_SET_STACK),
so KVM_IA64_VCPU_SET_STACK would just return -EINVAL.
Signed-off-by: Radim Krčmář <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>Signed-off-by Vinson Lee <[email protected]>
--- ioctls/kvm.c | 2 ++ 1 file changed, 2 insertions(+)
ioctls/kvm.c +2 -0
@@ -112,8 +112,10 @@ static const struct ioctl kvm_ioctls[] = {IOCTL (KVM_SET_GUEST_DEBUG ),IOCTL (KVM_X86_SETUP_MCE ),IOCTL (KVM_X86_GET_MCE_CAP_SUPPORTED ), +#if defined(KVM_IA64_VCPU_GET_STACK)IOCTL (KVM_IA64_VCPU_GET_STACK ),IOCTL (KVM_IA64_VCPU_SET_STACK ), +#endifIOCTL (KVM_ENABLE_CAP ),IOCTL (KVM_DIRTY_TLB ), IOCTL(KVM_GET_ONE_REG),
Signature · 1 line
2.2.2