xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/22] QOM'ify SysBusDeviceClass->init
@ 2018-11-19 12:07 Mao Zhongyi
  0 siblings, 0 replies; 4+ messages in thread
From: Mao Zhongyi @ 2018-11-19 12:07 UTC (permalink / raw)
  To: qemu-devel
  Cc: peter.maydell, david, alistair.francis, kraxel, edgar.iglesias,
	gxt, sstabellini, qemu-block, mst, armbru, borntraeger,
	marcel.apfelbaum, anthony.perard, marcandre.lureau, rth, thuth,
	ehabkost, Mao Zhongyi, richard.henderson, chouteau, qemu-s390x,
	qemu-arm, jan.kiszka, xen-devel, david, kwolf, cohuck, f4bug,
	mreitz, michael, qemu-ppc, pbonzini

The SysBusDeviceClass::init() interface is considered
as a legacy interface and there are currently some
efforts going on to get rid of it. Thus convert 
SysBusDeviceClass::init to DeviceClass::realize.

Cc: alistair.francis@wdc.com
Cc: anthony.perard@citrix.com
Cc: armbru@redhat.com
Cc: borntraeger@de.ibm.com
Cc: chouteau@adacore.com
Cc: cohuck@redhat.com
Cc: david@gibson.dropbear.id.au
Cc: david@redhat.com
Cc: edgar.iglesias@gmail.com
Cc: ehabkost@redhat.com
Cc: f4bug@amsat.org
Cc: gxt@mprc.pku.edu.cn
Cc: jan.kiszka@web.de
Cc: kraxel@redhat.com
Cc: kwolf@redhat.com
Cc: marcandre.lureau@redhat.com
Cc: marcel.apfelbaum@gmail.com
Cc: michael@walle.cc
Cc: mreitz@redhat.com
Cc: mst@redhat.com
Cc: pbonzini@redhat.com
Cc: peter.maydell@linaro.org
Cc: peter.maydell@linaro.org                                                                                                                                                                  
Cc: qemu-arm@nongnu.org
Cc: qemu-block@nongnu.org
Cc: qemu-ppc@nongnu.org
Cc: qemu-s390x@nongnu.org
Cc: richard.henderson@linaro.org
Cc: rth@twiddle.net
Cc: sstabellini@kernel.org
Cc: thuth@redhat.com
Cc: xen-devel@lists.xenproject.org

Mao Zhongyi (22):
  musicpal: Convert sysbus init function to realize function
  block/noenand: Convert sysbus init function to realize function
  char/grlib_apbuart: Convert sysbus init function to realize function
  core/empty_slot: Convert sysbus init function to realize function
  display/g364fb: Convert sysbus init function to realize function
  dma/puv3_dma: Convert sysbus init function to realize function
  gpio/puv3_gpio: Convert sysbus init function to realize function
  milkymist-softusb: Convert sysbus init function to realize function
  input/pl050: Convert sysbus init function to realize function
  intc/puv3_intc: Convert sysbus init function to realize function
  milkymist-hpdmc: Convert sysbus init function to realize function
  milkymist-pfpu: Convert sysbus init function to realize function
  puv3_pm.c: Convert sysbus init function to realize function
  nvram/ds1225y: Convert sysbus init function to realize function
  pci-bridge/dec: Convert sysbus init function to realize function
  timer/etraxfs_timer: Convert sysbus init function to realize function
  timer/grlib_gptimer: Convert sysbus init function to realize function
  timer/puv3_ost: Convert sysbus init function to realize function
  usb/tusb6010: Convert sysbus init function to realize function
  xen_backend: Convert sysbus init function to realize function
  event-facility: Change SysBusDeviceClass *sbdc to SysBusDeviceClass
    *sbc
  core/sysbus: remove the SysBusDeviceClass::init path

 hw/arm/musicpal.c            |  9 ++++-----
 hw/block/onenand.c           | 19 ++++++++-----------
 hw/char/grlib_apbuart.c      | 11 ++++-------
 hw/core/empty_slot.c         |  9 ++++-----
 hw/core/sysbus.c             | 15 ---------------
 hw/display/g364fb.c          | 14 +++++---------
 hw/dma/puv3_dma.c            | 10 ++++------
 hw/gpio/puv3_gpio.c          | 28 +++++++++++++---------------
 hw/input/milkymist-softusb.c | 15 ++++++---------
 hw/input/pl050.c             | 10 ++++------
 hw/intc/puv3_intc.c          | 13 +++++--------
 hw/misc/milkymist-hpdmc.c    |  9 +++------
 hw/misc/milkymist-pfpu.c     | 11 ++++-------
 hw/misc/puv3_pm.c            | 10 ++++------
 hw/nvram/ds1225y.c           | 12 +++++-------
 hw/pci-bridge/dec.c          | 11 +++++------
 hw/s390x/event-facility.c    |  4 ++--
 hw/timer/etraxfs_timer.c     | 13 ++++++-------
 hw/timer/grlib_gptimer.c     | 10 ++++------
 hw/timer/puv3_ost.c          | 12 +++++-------
 hw/usb/tusb6010.c            | 13 +++++--------
 hw/xen/xen_backend.c         |  6 ++----
 include/hw/sysbus.h          |  3 ---
 23 files changed, 102 insertions(+), 165 deletions(-)

-- 
2.17.1




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 20/22] xen_backend: Convert sysbus init function to realize function
       [not found] <20181119120820.29878-1-maozhongyi@cmss.chinamobile.com>
@ 2018-11-19 12:08 ` Mao Zhongyi
  2018-11-19 12:27 ` [PATCH 00/22] QOM'ify SysBusDeviceClass->init Cornelia Huck
       [not found] ` <20181119120820.29878-21-maozhongyi@cmss.chinamobile.com>
  2 siblings, 0 replies; 4+ messages in thread
From: Mao Zhongyi @ 2018-11-19 12:08 UTC (permalink / raw)
  To: qemu-devel
  Cc: anthony.perard, xen-devel, sstabellini, Zhang Shengju,
	Mao Zhongyi

Use DeviceClass rather than SysBusDeviceClass in
xen_sysdev_class_init().

Cc: sstabellini@kernel.org
Cc: anthony.perard@citrix.com
Cc: xen-devel@lists.xenproject.org

Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>
Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
---
 hw/xen/xen_backend.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index 9a8e8771ec..73b0ed0169 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -809,9 +809,8 @@ static const TypeInfo xensysbus_info = {
     }
 };
 
-static int xen_sysdev_init(SysBusDevice *dev)
+static void xen_sysdev_realize(DeviceState *dev, Error **errp)
 {
-    return 0;
 }
 
 static Property xen_sysdev_properties[] = {
@@ -821,9 +820,8 @@ static Property xen_sysdev_properties[] = {
 static void xen_sysdev_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
-    SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
 
-    k->init = xen_sysdev_init;
+    dc->realize = xen_sysdev_realize;
     dc->props = xen_sysdev_properties;
     dc->bus_type = TYPE_XENSYSBUS;
 }
-- 
2.17.1




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 00/22] QOM'ify SysBusDeviceClass->init
       [not found] <20181119120820.29878-1-maozhongyi@cmss.chinamobile.com>
  2018-11-19 12:08 ` [PATCH 20/22] xen_backend: Convert sysbus init function to realize function Mao Zhongyi
@ 2018-11-19 12:27 ` Cornelia Huck
       [not found] ` <20181119120820.29878-21-maozhongyi@cmss.chinamobile.com>
  2 siblings, 0 replies; 4+ messages in thread
From: Cornelia Huck @ 2018-11-19 12:27 UTC (permalink / raw)
  To: Mao Zhongyi
  Cc: peter.maydell, david, qemu-devel, alistair.francis, kraxel,
	edgar.iglesias, gxt, sstabellini, qemu-block, mst, armbru,
	borntraeger, marcel.apfelbaum, anthony.perard, marcandre.lureau,
	rth, thuth, ehabkost, richard.henderson, chouteau, qemu-s390x,
	qemu-arm, jan.kiszka, xen-devel, david, kwolf, f4bug, mreitz,
	michael, qemu-ppc, pbonzini

On Mon, 19 Nov 2018 20:07:58 +0800
Mao Zhongyi <maozhongyi@cmss.chinamobile.com> wrote:

> The SysBusDeviceClass::init() interface is considered
> as a legacy interface and there are currently some
> efforts going on to get rid of it. Thus convert 
> SysBusDeviceClass::init to DeviceClass::realize.

In case my comment to the s390 change comes off as negative: I like
getting rid of the legacy interface :)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH 20/22] xen_backend: Convert sysbus init function to realize function
       [not found] ` <20181119120820.29878-21-maozhongyi@cmss.chinamobile.com>
@ 2018-11-20 14:49   ` Peter Maydell
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2018-11-20 14:49 UTC (permalink / raw)
  To: Mao Zhongyi
  Cc: Anthony PERARD, open list:X86, Stefano Stabellini,
	QEMU Developers, Zhang Shengju

On 19 November 2018 at 12:08, Mao Zhongyi
<maozhongyi@cmss.chinamobile.com> wrote:
> Use DeviceClass rather than SysBusDeviceClass in
> xen_sysdev_class_init().
>
> Cc: sstabellini@kernel.org
> Cc: anthony.perard@citrix.com
> Cc: xen-devel@lists.xenproject.org
>
> Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>
> Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
> ---
>  hw/xen/xen_backend.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
> index 9a8e8771ec..73b0ed0169 100644
> --- a/hw/xen/xen_backend.c
> +++ b/hw/xen/xen_backend.c
> @@ -809,9 +809,8 @@ static const TypeInfo xensysbus_info = {
>      }
>  };
>
> -static int xen_sysdev_init(SysBusDevice *dev)
> +static void xen_sysdev_realize(DeviceState *dev, Error **errp)
>  {
> -    return 0;
>  }
>
>  static Property xen_sysdev_properties[] = {
> @@ -821,9 +820,8 @@ static Property xen_sysdev_properties[] = {
>  static void xen_sysdev_class_init(ObjectClass *klass, void *data)
>  {
>      DeviceClass *dc = DEVICE_CLASS(klass);
> -    SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
>
> -    k->init = xen_sysdev_init;
> +    dc->realize = xen_sysdev_realize;
>      dc->props = xen_sysdev_properties;
>      dc->bus_type = TYPE_XENSYSBUS;
>  }

If the realize function doesn't do anything at all, can't
we just omit it ?

thanks
-- PMM

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-11-20 14:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20181119120820.29878-1-maozhongyi@cmss.chinamobile.com>
2018-11-19 12:08 ` [PATCH 20/22] xen_backend: Convert sysbus init function to realize function Mao Zhongyi
2018-11-19 12:27 ` [PATCH 00/22] QOM'ify SysBusDeviceClass->init Cornelia Huck
     [not found] ` <20181119120820.29878-21-maozhongyi@cmss.chinamobile.com>
2018-11-20 14:49   ` [Qemu-devel] [PATCH 20/22] xen_backend: Convert sysbus init function to realize function Peter Maydell
2018-11-19 12:07 [PATCH 00/22] QOM'ify SysBusDeviceClass->init Mao Zhongyi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).