Re: [PATCH v6 07/17] add minimal virtio support for devtree virtio-mmio

Paolo Bonzini
2014-07-11T09:28:03Z

Il 11/07/2014 11:08, Andrew Jones ha scritto:
>> > lib/arm/virtio.c
>> >
>> > where virtio_bind is in lib/arm/virtio.c.
>> >
> Well, virtio_bind will still need to be in lib/virtio.c, but just as
> a wrapper to arch_virtio_bind.

Ok, that's just a naming thing.

> And, I'm inclined to keep virtio_bind_busses
> in arm's arch_virtio_bind.

Why? To support virtio-pci in the future? It seems like a good thing
to have (future support for virtio-pci) but even then you'd have only
two tests and that's already the exception. The common case would be
just one. You could write that as

struct virtio_device *arch_virtio_bind(u32 devid)
{
struct virtio_device *vdev;

vdev = arch_virtio_mmio_bind(devid);
if (!vdev)
vdev = arch_virtio_pci_bind(devid);
return vdev;
}

(I don't see kvm-unit-tests using ACPI in the future. Having DT+ACPI x
mmio+pci would be a good reason to have the array, but even then it's
premature and these are unit tests not an OS...).

Paolo