From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44408) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0qzK-0007xd-OT for qemu-devel@nongnu.org; Sun, 21 Jul 2013 06:35:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V0qzJ-0005Kw-Dj for qemu-devel@nongnu.org; Sun, 21 Jul 2013 06:35:38 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44102 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0qzI-0005Kp-SE for qemu-devel@nongnu.org; Sun, 21 Jul 2013 06:35:37 -0400 Message-ID: <51EBB975.6030500@suse.de> Date: Sun, 21 Jul 2013 12:35:33 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <2c400ea6690e0951a4aeae6f06a78081788d3a25.1372673778.git.hutao@cn.fujitsu.com> In-Reply-To: <2c400ea6690e0951a4aeae6f06a78081788d3a25.1372673778.git.hutao@cn.fujitsu.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 25/26] ioapic: use realize for ioapic List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hu Tao Cc: qemu-devel Am 01.07.2013 12:18, schrieb Hu Tao: > Signed-off-by: Hu Tao > --- > hw/intc/ioapic_common.c | 12 +++++------- > 1 file changed, 5 insertions(+), 7 deletions(-) >=20 > diff --git a/hw/intc/ioapic_common.c b/hw/intc/ioapic_common.c > index 5c5bb3c..5dc1f1e 100644 > --- a/hw/intc/ioapic_common.c > +++ b/hw/intc/ioapic_common.c > @@ -57,23 +57,22 @@ static int ioapic_dispatch_post_load(void *opaque, = int version_id) > return 0; > } > =20 > -static int ioapic_init_common(SysBusDevice *dev) > +static void ioapic_common_realize(DeviceState *dev, Error **errp) > { > IOAPICCommonState *s =3D IOAPIC_COMMON(dev); > IOAPICCommonClass *info; > static int ioapic_no; > =20 > if (ioapic_no >=3D MAX_IOAPICS) { > - return -1; > + error_setg(errp, "invalid ioapic number: %d", ioapic_no); Since the ioapic number was not chosen by the user, I have changed this similar to the preceding error message, referring to the maximum instead. Andreas > + return; > } > =20 > info =3D IOAPIC_COMMON_GET_CLASS(s); > info->init(s, ioapic_no); > =20 > - sysbus_init_mmio(&s->busdev, &s->io_memory); > + sysbus_init_mmio(SYS_BUS_DEVICE(s), &s->io_memory); > ioapic_no++; > - > - return 0; > } > =20 > static const VMStateDescription vmstate_ioapic_common =3D { > @@ -95,10 +94,9 @@ static const VMStateDescription vmstate_ioapic_commo= n =3D { > =20 > static void ioapic_common_class_init(ObjectClass *klass, void *data) > { > - SysBusDeviceClass *sc =3D SYS_BUS_DEVICE_CLASS(klass); > DeviceClass *dc =3D DEVICE_CLASS(klass); > =20 > - sc->init =3D ioapic_init_common; > + dc->realize =3D ioapic_common_realize; > dc->vmsd =3D &vmstate_ioapic_common; > dc->no_user =3D 1; > } >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg