From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:58490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RjiVB-00021e-R1 for qemu-devel@nongnu.org; Sat, 07 Jan 2012 21:28:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RjiVA-0004RO-J6 for qemu-devel@nongnu.org; Sat, 07 Jan 2012 21:28:53 -0500 Received: from cantor2.suse.de ([195.135.220.15]:59911 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RjiVA-0004RK-65 for qemu-devel@nongnu.org; Sat, 07 Jan 2012 21:28:52 -0500 Message-ID: <4F08FF08.1020905@suse.de> Date: Sun, 08 Jan 2012 03:27:20 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1325551939-24749-1-git-send-email-aliguori@us.ibm.com> <1325551939-24749-10-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1325551939-24749-10-git-send-email-aliguori@us.ibm.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 09/30] qdev: move qdev->info to class List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Paolo Bonzini , qemu-devel@nongnu.org, Markus Armbruster Am 03.01.2012 01:51, schrieb Anthony Liguori: > Right now, DeviceInfo acts as the class for qdev. In order to switch t= o a > proper ObjectClass derivative, we need to ween all of the callers off o= f > interacting directly with the info pointer. >=20 > Signed-off-by: Anthony Liguori > --- > diff --git a/hw/ide/piix.c b/hw/ide/piix.c > index 3473345..c0e3450 100644 > --- a/hw/ide/piix.c > +++ b/hw/ide/piix.c > @@ -195,7 +195,6 @@ PCIDevice *pci_piix3_xen_ide_init(PCIBus *bus, Driv= eInfo **hd_table, int devfn) > PCIDevice *dev; > =20 > dev =3D pci_create_simple(bus, devfn, "piix3-ide-xen"); > - dev->qdev.info->unplug =3D pci_piix3_xen_ide_unplug; > pci_ide_create_devs(dev, hd_table); > return dev; > } > @@ -253,6 +252,7 @@ static PCIDeviceInfo piix_ide_info[] =3D { > .qdev.name =3D "piix3-ide-xen", > .qdev.size =3D sizeof(PCIIDEState), > .qdev.no_user =3D 1, > + .qdev.unplug =3D pci_piix3_xen_ide_unplug, > .init =3D pci_piix_ide_initfn, > .vendor_id =3D PCI_VENDOR_ID_INTEL, > .device_id =3D PCI_DEVICE_ID_INTEL_82371SB_1, > diff --git a/hw/pci.c b/hw/pci.c > index fd575ac..64cd08f 100644 > --- a/hw/pci.c > +++ b/hw/pci.c > @@ -1544,7 +1544,9 @@ static int pci_unplug_device(DeviceState *qdev) > void pci_qdev_register(PCIDeviceInfo *info) > { > info->qdev.init =3D pci_qdev_init; > - info->qdev.unplug =3D pci_unplug_device; > + if (!info->qdev.unplug) { > + info->qdev.unplug =3D pci_unplug_device; > + } > info->qdev.exit =3D pci_unregister_device; > info->qdev.bus_info =3D &pci_bus_info; > qdev_register(&info->qdev); Would've been worth its own preparatory patch IMO since going beyond pure qdev_get_info(&dev->qdev)->unplug conversion for piix3-ide-xen. > @@ -1757,10 +1759,10 @@ static int pci_add_option_rom(PCIDevice *pdev, = bool is_default_rom) > size =3D 1 << qemu_fls(size); > } > =20 > - if (pdev->qdev.info->vmsd) > - snprintf(name, sizeof(name), "%s.rom", pdev->qdev.info->vmsd->= name); > + if (qdev_get_info(&pdev->qdev)->vmsd) > + snprintf(name, sizeof(name), "%s.rom", qdev_get_info(&pdev->qd= ev)->vmsd->name); > else > - snprintf(name, sizeof(name), "%s.rom", pdev->qdev.info->name); > + snprintf(name, sizeof(name), "%s.rom", qdev_get_info(&pdev->qd= ev)->name); Add braces while you're touching it? Otherwise mostly mechanical and looks okay: Reviewed-by: Andreas F=E4rber Andreas --=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