KVM: cleanup io_device code

We modernize the io_device code so that we use container_of() instead of
dev->private, and move the vtable to a separate ops structure
(theoretically allows better caching for multiple instances of the same
ops structure)

Signed-off-by: Gregory Haskins <ghaskins@novell.com>
Acked-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
Gregory Haskins
2009-06-01 12:54:50 -04:00
committed by Avi Kivity
parent 787a660a4f
commit d76685c4a0
8 changed files with 110 additions and 54 deletions

View File

@@ -2264,7 +2264,7 @@ static struct kvm_io_device *vcpu_find_pervcpu_dev(struct kvm_vcpu *vcpu,
if (vcpu->arch.apic) {
dev = &vcpu->arch.apic->dev;
if (dev->in_range(dev, addr, len, is_write))
if (kvm_iodevice_in_range(dev, addr, len, is_write))
return dev;
}
return NULL;