KVM: device: add simple registration mechanism for kvm_device_ops
authorWill Deacon <will.deacon@arm.com>
Tue, 2 Sep 2014 09:27:33 +0000 (10:27 +0100)
committerChristoffer Dall <christoffer.dall@linaro.org>
Thu, 2 Oct 2014 15:19:18 +0000 (17:19 +0200)
commit86318858caaa5a5e5b58f7bd2624c2a953eddf76
treedf31cf35b59fc6dba01bf53798a545b1547ba54a
parentcdead48c82db0e501edfce2c85b7834de2960d6f
KVM: device: add simple registration mechanism for kvm_device_ops

kvm_ioctl_create_device currently has knowledge of all the device types
and their associated ops. This is fairly inflexible when adding support
for new in-kernel device emulations, so move what we currently have out
into a table, which can support dynamic registration of ops by new
drivers for virtual hardware.

Cc: Alex Williamson <Alex.Williamson@redhat.com>
Cc: Alex Graf <agraf@suse.de>
Cc: Gleb Natapov <gleb@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit d60eacb07053142bfb9b41582074a89a790a9d46)
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
include/linux/kvm_host.h
include/uapi/linux/kvm.h
virt/kvm/kvm_main.c