[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 3/4] qdev: Simplify the SysBusDeviceClass::in
From: |
Eduardo Habkost |
Subject: |
Re: [Qemu-devel] [PATCH v3 3/4] qdev: Simplify the SysBusDeviceClass::init path |
Date: |
Mon, 7 May 2018 18:30:11 -0300 |
User-agent: |
Mutt/1.9.2 (2017-12-15) |
On Fri, Apr 20, 2018 at 09:22:55AM +0200, Markus Armbruster wrote:
> Philippe Mathieu-Daudé <address@hidden> writes:
>
> > On 04/19/2018 06:27 PM, Philippe Mathieu-Daudé wrote:
> >> The SysBusDevice is the last DeviceClass::init user.
> >>
> >> Instead of using
> >> SysBusDeviceClass::realize
> >> -> DeviceClass::realize
> >> -> DeviceClass::init
> >> -> sysbus_device_init
> >> -> SysBusDeviceClass::init
> >>
> >> Simplify the path by directly calling SysBusDeviceClass::init
> >> in SysBusDeviceClass::realize:
> >>
> >> SysBusDeviceClass::realize
> >> -> SysBusDeviceClass::init
> >>
> >> Finally, remove the DeviceClass::init, there are no more users.
> >>
> >> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> >> ---
> >> include/hw/qdev-core.h | 2 --
> >> hw/core/qdev.c | 14 --------------
> >> hw/core/sysbus.c | 15 ++++++++++-----
> >> 3 files changed, 10 insertions(+), 21 deletions(-)
> >>
> >> diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
> >> index 9453588160..6f60748043 100644
> >> --- a/include/hw/qdev-core.h
> >> +++ b/include/hw/qdev-core.h
> >> @@ -29,7 +29,6 @@ typedef enum DeviceCategory {
> >> DEVICE_CATEGORY_MAX
> >> } DeviceCategory;
> >>
> >> -typedef int (*qdev_initfn)(DeviceState *dev);
> >> typedef int (*qdev_event)(DeviceState *dev);
> >> typedef void (*DeviceRealize)(DeviceState *dev, Error **errp);
> >> typedef void (*DeviceUnrealize)(DeviceState *dev, Error **errp);
> >> @@ -124,7 +123,6 @@ typedef struct DeviceClass {
> >> const struct VMStateDescription *vmsd;
> >>
> >> /* Private to qdev / bus. */
> >> - qdev_initfn init; /* TODO remove, once users are converted to realize
> >> */
> >
> > The DeviceClass documentation (top of this file) is now out of date :(
> >
> > If the maintainer taking this series prefer a respin, I plan to only
> > remove the 'init' references in the big comment.
>
> I'd move the actual removal into the next and final patch. Lets us fix
> up the comment in one go.
I'd prefer a respin, so we can ensure the documentation is
updated and the removal of DeviceClass::init and
DeviceClass::exit are done in the same patch.
(Sorry for taking so long to reply.)
--
Eduardo
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [PATCH v3 3/4] qdev: Simplify the SysBusDeviceClass::init path,
Eduardo Habkost <=