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

@@ -2463,7 +2463,7 @@ struct kvm_io_device *kvm_io_bus_find_dev(struct kvm_io_bus *bus,
for (i = 0; i < bus->dev_count; i++) {
struct kvm_io_device *pos = bus->devs[i];
if (pos->in_range(pos, addr, len, is_write))
if (kvm_iodevice_in_range(pos, addr, len, is_write))
return pos;
}