KVM: surround kvm_arch_vcpu_async_ioctl() with #ifdef
PATCH 1/1 KVM: surround kvm_arch_vcpu_async_ioctl() with #ifdef
From: Simon Guo <[email protected]>
Although CONFIG_HAVE_KVM_VCPU_ASYNC_IOCTL is usually on, logically kvm_arch_vcpu_async_ioctl() definition should be wrapped with CONFIG_HAVE_KVM_VCPU_ASYNC_IOCTL #ifdef.
This patch adds the #ifdef surround.
Signed-off-by Simon Guo <[email protected]>
--- arch/mips/kvm/mips.c | 2 ++ arch/powerpc/kvm/powerpc.c | 2 ++ arch/s390/kvm/kvm-s390.c | 2 ++ 3 files changed, 6 insertions(+)
arch/mips/kvm/mips.c +2 -0
@@ -903,6 +903,7 @@ static int kvm_vcpu_ioctl_enable_cap(struct kvm_vcpu *vcpu,return r; } +#ifdef CONFIG_HAVE_KVM_VCPU_ASYNC_IOCTL long kvm_arch_vcpu_async_ioctl (struct file *filp,unsigned int ioctl,unsigned long arg) {
@@ -922,6 +923,7 @@ long kvm_arch_vcpu_async_ioctl(struct file *filp, unsigned int ioctl, return -ENOIOCTLCMD; } +#endif long kvm_arch_vcpu_ioctl (struct file *filp,unsigned int ioctl,unsigned long arg)
arch/powerpc/kvm/powerpc.c +2 -0
@@ -1757,6 +1757,7 @@ int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu,return -EINVAL ; } +#ifdef CONFIG_HAVE_KVM_VCPU_ASYNC_IOCTL long kvm_arch_vcpu_async_ioctl (struct file *filp,unsigned int ioctl,unsigned long arg) {
@@ -1771,6 +1772,7 @@ long kvm_arch_vcpu_async_ioctl(struct file *filp, }return -ENOIOCTLCMD ; } +#endif long kvm_arch_vcpu_ioctl (struct file *filp,unsigned int ioctl,unsigned long arg)
arch/s390/kvm/kvm-s390.c +2 -0
@@ -3784,6 +3784,7 @@ static long kvm_s390_guest_mem_op(struct kvm_vcpu *vcpu,return r; } +#ifdef CONFIG_HAVE_KVM_VCPU_ASYNC_IOCTL long kvm_arch_vcpu_async_ioctl (struct file *filp,unsigned int ioctl,unsigned long arg) {
@@ -3811,6 +3812,7 @@ long kvm_arch_vcpu_async_ioctl(struct file *filp, }return -ENOIOCTLCMD ; } +#endif long kvm_arch_vcpu_ioctl (struct file *filp,unsigned int ioctl,unsigned long arg)
Signature · 1 line
1.8.3.1
Paolo Bonzini
maintainerQuoted 5 lines · On 28/02/2018 03:31, [email protected] wrote:
From: Simon Guo <[email protected]>
Although
CONFIG_HAVE_KVM_VCPU_ASYNC_IOCTLis usually on, logicallykvm_arch_vcpu_async_ioctl()definition should be wrapped withCONFIG_HAVE_KVM_VCPU_ASYNC_IOCTL#ifdef.
No, the symbol is defined by Kconfig. It is a bug if it is not #defined.
Paolo
Quoted 70 lines
This patch adds the #ifdef surround.
Signed-off-by Simon Guo <[email protected]>--- arch/mips/kvm/mips.c | 2 ++ arch/powerpc/kvm/powerpc.c | 2 ++ arch/s390/kvm/kvm-s390.c | 2 ++ 3 files changed, 6 insertions(+)arch/mips/kvm/mips.c +2
-0@@ -903,6 +903,7 @@ static int kvm_vcpu_ioctl_enable_cap(struct kvm_vcpu *vcpu,return r; } +#ifdef CONFIG_HAVE_KVM_VCPU_ASYNC_IOCTL long kvm_arch_vcpu_async_ioctl (struct file *filp,unsigned int ioctl,unsigned long arg) {@@ -922,6 +923,7 @@ long kvm_arch_vcpu_async_ioctl(struct file *filp, unsigned int ioctl, return -ENOIOCTLCMD; } +#endif long kvm_arch_vcpu_ioctl (struct file *filp,unsigned int ioctl,unsigned long arg)arch/powerpc/kvm/powerpc.c +2
-0@@ -1757,6 +1757,7 @@ int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu,return -EINVAL ; } +#ifdef CONFIG_HAVE_KVM_VCPU_ASYNC_IOCTL long kvm_arch_vcpu_async_ioctl (struct file *filp,unsigned int ioctl,unsigned long arg) {@@ -1771,6 +1772,7 @@ long kvm_arch_vcpu_async_ioctl(struct file *filp, }return -ENOIOCTLCMD ; } +#endif long kvm_arch_vcpu_ioctl (struct file *filp,unsigned int ioctl,unsigned long arg)arch/s390/kvm/kvm-s390.c +2
-0@@ -3784,6 +3784,7 @@ static long kvm_s390_guest_mem_op(struct kvm_vcpu *vcpu,return r; } +#ifdef CONFIG_HAVE_KVM_VCPU_ASYNC_IOCTL long kvm_arch_vcpu_async_ioctl (struct file *filp,unsigned int ioctl,unsigned long arg) {@@ -3811,6 +3812,7 @@ long kvm_arch_vcpu_async_ioctl(struct file *filp, }return -ENOIOCTLCMD ; } +#endif long kvm_arch_vcpu_ioctl (struct file *filp,unsigned int ioctl,unsigned long arg)