On 7 January 2013 18:40,  <fred.kon...@greensocs.com> wrote:
> From: KONRAD Frederic <fred.kon...@greensocs.com>
>
> Introduce virtio-pci-bus, which extends virtio-bus. It is used with virtio-pci
> transport device.
>
> Signed-off-by: KONRAD Frederic <fred.kon...@greensocs.com>

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

Reply via email to