[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 21/26] kvmclock: use realize for kvmclock
From: |
Eduardo Habkost |
Subject: |
Re: [Qemu-devel] [PATCH 21/26] kvmclock: use realize for kvmclock |
Date: |
Tue, 25 Jun 2013 14:45:55 -0300 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Tue, Jun 25, 2013 at 10:20:08AM +0800, Hu Tao wrote:
[...]
> > Is TYPE_SYS_BUS_DEVICE guaranteed to never override ->realize() itself?
> >
> > From DeviceClass documentation:
> >
> > * If a type derived directly from TYPE_DEVICE implements @realize, it does
> > * not need to implement @init and therefore does not need to store and call
> > * #DeviceClass' default @realize callback.
> > * For other types consult the documentation and implementation of the
> > * respective parent types.
> >
> > The problem is that there's no documentation about ->realize() on
> > SysBusDeviceClass. Can we please explicitly document SysBusDeviceClass
> > expectations about ->realize() first, before making those changes?
>
> IIUC, subclass's overriding ->realize should call parent's ->realize at
> some point. Peter Crosthwaite has a patchset to access a object's parent
> class at http://lists.nongnu.org/archive/html/qemu-devel/2013-06/msg02982.html
>
> Regarding SysBusDevice::init and SysBusDevice::realize, I think it's the
> same as in the case of DeviceClass. If you agree I'll document it as in
> DeviceClass.
I believe it is reasonable to document that SysBusDevice subclasses
don't need to call the parent ->realize() method, like on DeviceClass.
This is exactly what this patch set does, after all, and I haven't seen
anybody complaining about it yet.
--
Eduardo
- [Qemu-devel] [PATCH 06/26] q35: use type-safe cast instead of directly access of parent dev, (continued)
- [Qemu-devel] [PATCH 06/26] q35: use type-safe cast instead of directly access of parent dev, Hu Tao, 2013/06/22
- [Qemu-devel] [PATCH 15/26] fwcfg: use realize for fwcfg, Hu Tao, 2013/06/22
- [Qemu-devel] [PATCH 16/26] fwcfg: QOM'ify some more, Hu Tao, 2013/06/22
- [Qemu-devel] [PATCH 17/26] scsi esp: use realize for scsi esp, Hu Tao, 2013/06/22
- [Qemu-devel] [PATCH 13/26] ahci: use realize for ahci, Hu Tao, 2013/06/22
- [Qemu-devel] [PATCH 21/26] kvmclock: use realize for kvmclock, Hu Tao, 2013/06/22
[Qemu-devel] [PATCH 19/26] hpet: use realize for hpet, Hu Tao, 2013/06/22
[Qemu-devel] [PATCH 18/26] scsi esp: QOM'ify some more, Hu Tao, 2013/06/22
[Qemu-devel] [PATCH 22/26] kvmclock: QOM'ify some more, Hu Tao, 2013/06/22
[Qemu-devel] [PATCH 25/26] isa bus: use realize for isa bus, Hu Tao, 2013/06/22
[Qemu-devel] [PATCH 23/26] kvmvapic realize, Hu Tao, 2013/06/22
[Qemu-devel] [PATCH 26/26] ehci: use realize for ehci, Hu Tao, 2013/06/22