From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46601) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gP7Lv-0005nn-Mu for qemu-devel@nongnu.org; Tue, 20 Nov 2018 09:50:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gP7Lu-0001QX-SY for qemu-devel@nongnu.org; Tue, 20 Nov 2018 09:50:11 -0500 Received: from mail-oi1-x244.google.com ([2607:f8b0:4864:20::244]:43080) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gP7Lu-0001QP-Oa for qemu-devel@nongnu.org; Tue, 20 Nov 2018 09:50:10 -0500 Received: by mail-oi1-x244.google.com with SMTP id u18so1665643oie.10 for ; Tue, 20 Nov 2018 06:50:10 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20181119120820.29878-21-maozhongyi@cmss.chinamobile.com> References: <20181119120820.29878-1-maozhongyi@cmss.chinamobile.com> <20181119120820.29878-21-maozhongyi@cmss.chinamobile.com> From: Peter Maydell Date: Tue, 20 Nov 2018 14:49:49 +0000 Message-ID: Content-Type: text/plain; charset="UTF-8" Subject: Re: [Qemu-devel] [PATCH 20/22] xen_backend: Convert sysbus init function to realize function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mao Zhongyi Cc: QEMU Developers , Anthony PERARD , "open list:X86" , Stefano Stabellini , Zhang Shengju On 19 November 2018 at 12:08, Mao Zhongyi 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 > Signed-off-by: Zhang Shengju > --- > 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