[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 03/61] virtio-pci-bus : introduce virtio-pci-bus
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 03/61] virtio-pci-bus : introduce virtio-pci-bus. |
Date: |
Tue, 8 Jan 2013 18:08:06 +0000 |
On 7 January 2013 18:40, <address@hidden> wrote:
> From: KONRAD Frederic <address@hidden>
>
> Introduce virtio-pci-bus, which extends virtio-bus. It is used with virtio-pci
> transport device.
>
> Signed-off-by: KONRAD Frederic <address@hidden>
This isn't quite right, I think (somebody correct me if I'm wrong!)
The virtio-pci-bus subclass doesn't have any state of its own, so it
doesn't need a struct, but it does still want a type, so virtio-pci.h should
have a
typedef VirtioBusClass VirtioPCIBusClass;
typedef VirtioBusState VirtioPCIBusState;
and we then use VirtioPCIBusClass/State where appropriate
(notably in the typeinfo for class/instance size and in the get-class/
class-check/etc macros).
This lets us easily add state later if we need to by turning the
typedef into a typedef'd struct without having to hunt down all
the places that now need to say 'VirtioPCIBus*' rather than
'VirtioBus*'.
-- PMM
[Qemu-devel] [PATCH 02/61] virtio-bus : introduce virtio-bus, fred . konrad, 2013/01/07
[Qemu-devel] [PATCH 04/61] virtio-pci : refactor virtio-pci device., fred . konrad, 2013/01/07