diff options
author | Wei Yongjun <yjwei@cn.fujitsu.com> | 2010-03-11 21:09:45 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-05-17 05:15:31 -0400 |
commit | 160d2f6c0c90713aa3bb93dd344fe0d527342e26 (patch) | |
tree | 284248727d161df1e3e95875fb9aca44aeaa7ca2 /arch/x86/kvm/x86.c | |
parent | 5c0d0920a270b9f2aa20c1cecb162703da32e766 (diff) |
KVM: x86: fix the error of ioctl KVM_IRQ_LINE if no irq chip
If no irq chip in kernel, ioctl KVM_IRQ_LINE will return -EFAULT.
But I see in other place such as KVM_[GET|SET]IRQCHIP, -ENXIO is
return. So this patch used -ENXIO instead of -EFAULT.
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r-- | arch/x86/kvm/x86.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index a1cf87fe9f3a..7a8fe9051ecf 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -2836,11 +2836,13 @@ long kvm_arch_vm_ioctl(struct file *filp, | |||
2836 | r = -EFAULT; | 2836 | r = -EFAULT; |
2837 | if (copy_from_user(&irq_event, argp, sizeof irq_event)) | 2837 | if (copy_from_user(&irq_event, argp, sizeof irq_event)) |
2838 | goto out; | 2838 | goto out; |
2839 | r = -ENXIO; | ||
2839 | if (irqchip_in_kernel(kvm)) { | 2840 | if (irqchip_in_kernel(kvm)) { |
2840 | __s32 status; | 2841 | __s32 status; |
2841 | status = kvm_set_irq(kvm, KVM_USERSPACE_IRQ_SOURCE_ID, | 2842 | status = kvm_set_irq(kvm, KVM_USERSPACE_IRQ_SOURCE_ID, |
2842 | irq_event.irq, irq_event.level); | 2843 | irq_event.irq, irq_event.level); |
2843 | if (ioctl == KVM_IRQ_LINE_STATUS) { | 2844 | if (ioctl == KVM_IRQ_LINE_STATUS) { |
2845 | r = -EFAULT; | ||
2844 | irq_event.status = status; | 2846 | irq_event.status = status; |
2845 | if (copy_to_user(argp, &irq_event, | 2847 | if (copy_to_user(argp, &irq_event, |
2846 | sizeof irq_event)) | 2848 | sizeof irq_event)) |