diff options
author | Christoffer Dall <c.dall@virtualopensystems.com> | 2012-07-24 08:51:20 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-07-26 05:23:25 -0400 |
commit | 23d43cf998275bc97437931c0cdee1df2c1aa3ca (patch) | |
tree | cc1a76fefb98f66e7807d54049ddaf008db055ac /virt | |
parent | 99245b507dc3b1b2815d6a6cb4e94a6b7018a24b (diff) |
KVM: Move KVM_IRQ_LINE to arch-generic code
Handle KVM_IRQ_LINE and KVM_IRQ_LINE_STATUS in the generic
kvm_vm_ioctl() function and call into kvm_vm_ioctl_irq_line().
This is even more relevant when KVM/ARM also uses this ioctl.
Signed-off-by: Christoffer Dall <c.dall@virtualopensystems.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'virt')
-rw-r--r-- | virt/kvm/kvm_main.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index de89497fe4c7..bcf973ec98ff 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c | |||
@@ -2149,6 +2149,29 @@ static long kvm_vm_ioctl(struct file *filp, | |||
2149 | break; | 2149 | break; |
2150 | } | 2150 | } |
2151 | #endif | 2151 | #endif |
2152 | #ifdef __KVM_HAVE_IRQ_LINE | ||
2153 | case KVM_IRQ_LINE_STATUS: | ||
2154 | case KVM_IRQ_LINE: { | ||
2155 | struct kvm_irq_level irq_event; | ||
2156 | |||
2157 | r = -EFAULT; | ||
2158 | if (copy_from_user(&irq_event, argp, sizeof irq_event)) | ||
2159 | goto out; | ||
2160 | |||
2161 | r = kvm_vm_ioctl_irq_line(kvm, &irq_event); | ||
2162 | if (r) | ||
2163 | goto out; | ||
2164 | |||
2165 | r = -EFAULT; | ||
2166 | if (ioctl == KVM_IRQ_LINE_STATUS) { | ||
2167 | if (copy_to_user(argp, &irq_event, sizeof irq_event)) | ||
2168 | goto out; | ||
2169 | } | ||
2170 | |||
2171 | r = 0; | ||
2172 | break; | ||
2173 | } | ||
2174 | #endif | ||
2152 | default: | 2175 | default: |
2153 | r = kvm_arch_vm_ioctl(filp, ioctl, arg); | 2176 | r = kvm_arch_vm_ioctl(filp, ioctl, arg); |
2154 | if (r == -ENOTTY) | 2177 | if (r == -ENOTTY) |