From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47042) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtBw4-0008HF-PQ for qemu-devel@nongnu.org; Sun, 30 Jun 2013 03:20:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UtBw3-00071X-7Q for qemu-devel@nongnu.org; Sun, 30 Jun 2013 03:20:36 -0400 Received: from cantor2.suse.de ([195.135.220.15]:42662 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtBw2-000717-N0 for qemu-devel@nongnu.org; Sun, 30 Jun 2013 03:20:34 -0400 Message-ID: <51CFDC3A.5090509@suse.de> Date: Sun, 30 Jun 2013 09:20:26 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1372331024-3783-1-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1372331024-3783-1-git-send-email-peter.maydell@linaro.org> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] Avoid use of QOM type name macros in VMStateDescriptions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Peter Crosthwaite , Igor Mitsyanko , Evgeny Voevodin , patches@linaro.org, Hu Tao , qemu-devel@nongnu.org, Jean-Christophe DUBOIS , Peter Chubb , Dmitry Solodkiy , Anthony Liguori , Paolo Bonzini , Maksim Kozlov , Gerd Hoffmann Am 27.06.2013 13:03, schrieb Peter Maydell: > The name field in a VMStateDescription is part of the migration state > versioning, so changing it will break migration. It's therefore a > bad idea to use a QOM typename macro to initialize it, because in > general we're free to rename QOM types as part of code refactoring > and cleanup. For the handful of devices that were doing this by > mistake, replace the QOM typenames with the corresponding literal > strings. >=20 > Signed-off-by: Peter Maydell > --- > As per recent discussion. There are also a few devices which use > the typename in memory_region_init_io(). Since that is suboptimal > but not a problem in the way that possible migration breaks would > be, I haven't fixed those since they'd just clash with Paolo's > memory-region-owner patches. >=20 > The one I didn't touch was hw/usb/host-linux.c, since that changes > the QOM typename and the VMStateDescription name depending on > whether QEMU was built with CONFIG_USB_LIBUSB defined or not. > That seems a bit fishy to me but I've left it alone. >=20 > hw/i2c/exynos4210_i2c.c | 2 +- > hw/scsi/vmw_pvscsi.c | 2 +- > hw/timer/imx_epit.c | 2 +- > hw/timer/imx_gpt.c | 2 +- > hw/usb/ccid-card-passthru.c | 2 +- > hw/usb/dev-smartcard-reader.c | 2 +- > 6 files changed, 6 insertions(+), 6 deletions(-) >=20 > diff --git a/hw/i2c/exynos4210_i2c.c b/hw/i2c/exynos4210_i2c.c > index 196f889..a75abef 100644 > --- a/hw/i2c/exynos4210_i2c.c > +++ b/hw/i2c/exynos4210_i2c.c > @@ -271,7 +271,7 @@ static const MemoryRegionOps exynos4210_i2c_ops =3D= { > }; > =20 > static const VMStateDescription exynos4210_i2c_vmstate =3D { > - .name =3D TYPE_EXYNOS4_I2C, > + .name =3D "exynos4210.i2c", > .version_id =3D 1, > .minimum_version_id =3D 1, > .fields =3D (VMStateField[]) { > diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c > index 7cf4044..f2f0c00 100644 > --- a/hw/scsi/vmw_pvscsi.c > +++ b/hw/scsi/vmw_pvscsi.c > @@ -1136,7 +1136,7 @@ pvscsi_post_load(void *opaque, int version_id) > } > =20 > static const VMStateDescription vmstate_pvscsi =3D { > - .name =3D TYPE_PVSCSI, > + .name =3D "pvscsi", > .version_id =3D 0, > .minimum_version_id =3D 0, > .minimum_version_id_old =3D 0, Apparently someone confused TypeInfo and VMStateDescription here, the TypeInfo .name is by contrast not using the constant - fixing up. Rest is verified to match constants. Applied to my new qom-next staging tree: https://github.com/afaerber/qemu-cpu/commits/qom-next Andreas > diff --git a/hw/timer/imx_epit.c b/hw/timer/imx_epit.c > index 7cdb006..8cefd74a 100644 > --- a/hw/timer/imx_epit.c > +++ b/hw/timer/imx_epit.c > @@ -370,7 +370,7 @@ static const MemoryRegionOps imx_epit_ops =3D { > }; > =20 > static const VMStateDescription vmstate_imx_timer_epit =3D { > - .name =3D TYPE_IMX_EPIT, > + .name =3D "imx.epit", > .version_id =3D 2, > .minimum_version_id =3D 2, > .minimum_version_id_old =3D 2, > diff --git a/hw/timer/imx_gpt.c b/hw/timer/imx_gpt.c > index de53b13..eebd2b7 100644 > --- a/hw/timer/imx_gpt.c > +++ b/hw/timer/imx_gpt.c > @@ -142,7 +142,7 @@ typedef struct { > } IMXGPTState; > =20 > static const VMStateDescription vmstate_imx_timer_gpt =3D { > - .name =3D TYPE_IMX_GPT, > + .name =3D "imx.gpt", > .version_id =3D 3, > .minimum_version_id =3D 3, > .minimum_version_id_old =3D 3, > diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c > index 01c7e6f..5f01ff1 100644 > --- a/hw/usb/ccid-card-passthru.c > +++ b/hw/usb/ccid-card-passthru.c > @@ -364,7 +364,7 @@ static int passthru_exitfn(CCIDCardState *base) > } > =20 > static VMStateDescription passthru_vmstate =3D { > - .name =3D PASSTHRU_DEV_NAME, > + .name =3D "ccid-card-passthru", > .version_id =3D 1, > .minimum_version_id =3D 1, > .fields =3D (VMStateField[]) { > diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reade= r.c > index 125cc2c..b33eb25 100644 > --- a/hw/usb/dev-smartcard-reader.c > +++ b/hw/usb/dev-smartcard-reader.c > @@ -1397,7 +1397,7 @@ static VMStateDescription usb_device_vmstate =3D = { > }; > =20 > static VMStateDescription ccid_vmstate =3D { > - .name =3D CCID_DEV_NAME, > + .name =3D "usb-ccid", > .version_id =3D 1, > .minimum_version_id =3D 1, > .post_load =3D ccid_post_load, >=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