From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKZjd-0007Fx-SA for qemu-devel@nongnu.org; Wed, 29 Jul 2015 18:22:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZKZjY-0003eF-SA for qemu-devel@nongnu.org; Wed, 29 Jul 2015 18:22:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34939) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKZjY-0003dU-MZ for qemu-devel@nongnu.org; Wed, 29 Jul 2015 18:21:56 -0400 Message-ID: <55B95202.4060607@redhat.com> Date: Wed, 29 Jul 2015 18:21:54 -0400 From: John Snow MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v1 1/3] ahci: Separate the AHCI state structure into the header List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alistair Francis , qemu-devel@nongnu.org, peter.maydell@linaro.org Cc: saipava@xilinx.com, edgar.iglesias@xilinx.com, afaerber@suse.de On 07/27/2015 02:37 PM, Alistair Francis wrote: > Pull the AHCI state structure out into the header. This allows > other containers to access the struct. This is required to add > the device to modern SoC containers. >=20 Is there a reason this structure needs to be directly inlined into XlnxZynqMPState, instead of using e.g. qdev_create/object_property_add_child and letting SysbusAHCIState be the business of ahci.c? Asking as a bit of a qdev outsider. --js > Signed-off-by: Alistair Francis > Reviewed-by: Sai Pavan Boddu > --- > hw/ide/ahci.c | 13 ------------- > hw/ide/ahci.h | 14 ++++++++++++++ > 2 files changed, 14 insertions(+), 13 deletions(-) >=20 > diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c > index 48749c1..02d85fa 100644 > --- a/hw/ide/ahci.c > +++ b/hw/ide/ahci.c > @@ -25,7 +25,6 @@ > #include > #include > #include > -#include > =20 > #include "qemu/error-report.h" > #include "sysemu/block-backend.h" > @@ -1625,18 +1624,6 @@ const VMStateDescription vmstate_ahci =3D { > }, > }; > =20 > -#define TYPE_SYSBUS_AHCI "sysbus-ahci" > -#define SYSBUS_AHCI(obj) OBJECT_CHECK(SysbusAHCIState, (obj), TYPE_SYS= BUS_AHCI) > - > -typedef struct SysbusAHCIState { > - /*< private >*/ > - SysBusDevice parent_obj; > - /*< public >*/ > - > - AHCIState ahci; > - uint32_t num_ports; > -} SysbusAHCIState; > - > static const VMStateDescription vmstate_sysbus_ahci =3D { > .name =3D "sysbus-ahci", > .fields =3D (VMStateField[]) { > diff --git a/hw/ide/ahci.h b/hw/ide/ahci.h > index 68d5074..5ab8ea4 100644 > --- a/hw/ide/ahci.h > +++ b/hw/ide/ahci.h > @@ -24,6 +24,8 @@ > #ifndef HW_IDE_AHCI_H > #define HW_IDE_AHCI_H > =20 > +#include > + > #define AHCI_MEM_BAR_SIZE 0x1000 > #define AHCI_MAX_PORTS 32 > #define AHCI_MAX_SG 168 /* hardware max is 64K */ > @@ -369,4 +371,16 @@ void ahci_reset(AHCIState *s); > =20 > void ahci_ide_create_devs(PCIDevice *dev, DriveInfo **hd); > =20 > +#define TYPE_SYSBUS_AHCI "sysbus-ahci" > +#define SYSBUS_AHCI(obj) OBJECT_CHECK(SysbusAHCIState, (obj), TYPE_SYS= BUS_AHCI) > + > +typedef struct SysbusAHCIState { > + /*< private >*/ > + SysBusDevice parent_obj; > + /*< public >*/ > + > + AHCIState ahci; > + uint32_t num_ports; > +} SysbusAHCIState; > + > #endif /* HW_IDE_AHCI_H */ >=20