]> git.proxmox.com Git - qemu.git/commitdiff
hw: Avoid use of QOM type name macros in VMStateDescriptions
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 27 Jun 2013 11:03:44 +0000 (12:03 +0100)
committerAndreas Färber <afaerber@suse.de>
Mon, 22 Jul 2013 22:37:32 +0000 (00:37 +0200)
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.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
[AF: Use TYPE_PVSCSI for TypeInfo instead]
Signed-off-by: Andreas Färber <afaerber@suse.de>
hw/i2c/exynos4210_i2c.c
hw/scsi/vmw_pvscsi.c
hw/timer/imx_epit.c
hw/timer/imx_gpt.c
hw/usb/ccid-card-passthru.c
hw/usb/dev-smartcard-reader.c

index 52bffa50100229e4e915bd60ac28c0c249df4f27..42f5e8949697393bdfe522ecf88fc2a1ba350ef9 100644 (file)
@@ -271,7 +271,7 @@ static const MemoryRegionOps exynos4210_i2c_ops = {
 };
 
 static const VMStateDescription exynos4210_i2c_vmstate = {
-    .name = TYPE_EXYNOS4_I2C,
+    .name = "exynos4210.i2c",
     .version_id = 1,
     .minimum_version_id = 1,
     .fields = (VMStateField[]) {
index 97d3aa3e6f073f5604165ddcdf3b97be64e528d7..e1074e1d8d29b998ed2679658466a9e8612db456 100644 (file)
@@ -1136,7 +1136,7 @@ pvscsi_post_load(void *opaque, int version_id)
 }
 
 static const VMStateDescription vmstate_pvscsi = {
-    .name = TYPE_PVSCSI,
+    .name = "pvscsi",
     .version_id = 0,
     .minimum_version_id = 0,
     .minimum_version_id_old = 0,
@@ -1201,7 +1201,7 @@ static void pvscsi_class_init(ObjectClass *klass, void *data)
 }
 
 static const TypeInfo pvscsi_info = {
-    .name          = "pvscsi",
+    .name          = TYPE_PVSCSI,
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PVSCSIState),
     .class_init    = pvscsi_class_init,
index e24e0c49169e99cdb8ad0850df49a25b9ae631bc..117dc7bcbb7553777112fd486ca58e35a9f30f2e 100644 (file)
@@ -370,7 +370,7 @@ static const MemoryRegionOps imx_epit_ops = {
 };
 
 static const VMStateDescription vmstate_imx_timer_epit = {
-    .name = TYPE_IMX_EPIT,
+    .name = "imx.epit",
     .version_id = 2,
     .minimum_version_id = 2,
     .minimum_version_id_old = 2,
index 97fbebbe80de9ce4aa76218b2196e5e2c7ec4ba6..87db0e195c109a443e9074c706c014861c8e5e76 100644 (file)
@@ -142,7 +142,7 @@ typedef struct {
 } IMXGPTState;
 
 static const VMStateDescription vmstate_imx_timer_gpt = {
-    .name = TYPE_IMX_GPT,
+    .name = "imx.gpt",
     .version_id = 3,
     .minimum_version_id = 3,
     .minimum_version_id_old = 3,
index 01c7e6f20dedd79b4d2ec01ec49b64869bc0a045..5f01ff1e16c14430dfb1b6d7c40bdf7c65bfe81e 100644 (file)
@@ -364,7 +364,7 @@ static int passthru_exitfn(CCIDCardState *base)
 }
 
 static VMStateDescription passthru_vmstate = {
-    .name = PASSTHRU_DEV_NAME,
+    .name = "ccid-card-passthru",
     .version_id = 1,
     .minimum_version_id = 1,
     .fields = (VMStateField[]) {
index 125cc2c22195f775cef6538fd7e29adcc6045e4e..b33eb25b39c6db02e3ec6db8e434c6667cb72fde 100644 (file)
@@ -1397,7 +1397,7 @@ static VMStateDescription usb_device_vmstate = {
 };
 
 static VMStateDescription ccid_vmstate = {
-    .name = CCID_DEV_NAME,
+    .name = "usb-ccid",
     .version_id = 1,
     .minimum_version_id = 1,
     .post_load = ccid_post_load,