From patchwork Thu Jun 27 11:03:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 18150 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f200.google.com (mail-ve0-f200.google.com [209.85.128.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5308C23910 for ; Thu, 27 Jun 2013 11:03:52 +0000 (UTC) Received: by mail-ve0-f200.google.com with SMTP id m1sf984869ves.7 for ; Thu, 27 Jun 2013 04:03:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=b/pl8gYlSK6f6C41aMf4Mh5UKXfd5OrhvOykkcz2OGc=; b=oAVOVxSL5Qi1ZIyzvEJDyBmCzm5E9eEbjih2eADX26OWWGa9sf/MBayob7h0J8uquj Iy3EB+hSzuhwWwbuBQ8uaUO11fuq38ODLVjV5e2f7vjkP/h37IJQS+d9+8tlyVH03ysu IBORDTSh3kxDPekdhq8GpXV2KAeaAFLUcjmQTCxNeI9Z7r/77alHztcuByHVQHKZENTv fRYBTxahMP8LnMfXeiFsLgeJGoQRgqu/sB8nEMPw6OPf1htGKq8eDgLkUf67Ai4p1AGp DfN7LB58Fai4ZW0/eYfmMOrsEobVRGSE1ALxgZTY5yYVtp0LMR5xAb2OibnSjXfpDtRO JW5Q== X-Received: by 10.224.59.205 with SMTP id m13mr8478740qah.7.1372331031131; Thu, 27 Jun 2013 04:03:51 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.34.130 with SMTP id z2ls823118qei.98.gmail; Thu, 27 Jun 2013 04:03:51 -0700 (PDT) X-Received: by 10.58.251.144 with SMTP id zk16mr3249467vec.37.1372331031000; Thu, 27 Jun 2013 04:03:51 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id j7si634896vci.81.2013.06.27.04.03.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 27 Jun 2013 04:03:50 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id hz11so207196vcb.38 for ; Thu, 27 Jun 2013 04:03:50 -0700 (PDT) X-Received: by 10.220.70.140 with SMTP id d12mr3336814vcj.15.1372331030868; Thu, 27 Jun 2013 04:03:50 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.165.8 with SMTP id yu8csp143357veb; Thu, 27 Jun 2013 04:03:50 -0700 (PDT) X-Received: by 10.194.109.104 with SMTP id hr8mr5824648wjb.32.1372331029670; Thu, 27 Jun 2013 04:03:49 -0700 (PDT) Received: from mnementh.archaic.org.uk (1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id w1si828859wjw.83.2013.06.27.04.03.48 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 27 Jun 2013 04:03:49 -0700 (PDT) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1Us9zM-0000zU-Bx; Thu, 27 Jun 2013 12:03:44 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Evgeny Voevodin , Maksim Kozlov , Igor Mitsyanko , Dmitry Solodkiy , Paolo Bonzini , Peter Chubb , Gerd Hoffmann , Jean-Christophe DUBOIS Subject: [PATCH] Avoid use of QOM type name macros in VMStateDescriptions Date: Thu, 27 Jun 2013 12:03:44 +0100 Message-Id: <1372331024-3783-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQlqWeFduwNJxrHMfZD6vcFlXeTB/EuIlp5C2xU+p4z+S7VggBRAViWgF8Bgh+U9cA+XaPaI X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- 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. 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. 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(-) 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 = { }; static const VMStateDescription exynos4210_i2c_vmstate = { - .name = TYPE_EXYNOS4_I2C, + .name = "exynos4210.i2c", .version_id = 1, .minimum_version_id = 1, .fields = (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) } static const VMStateDescription vmstate_pvscsi = { - .name = TYPE_PVSCSI, + .name = "pvscsi", .version_id = 0, .minimum_version_id = 0, .minimum_version_id_old = 0, 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 = { }; 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, 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; 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, 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) } static VMStateDescription passthru_vmstate = { - .name = PASSTHRU_DEV_NAME, + .name = "ccid-card-passthru", .version_id = 1, .minimum_version_id = 1, .fields = (VMStateField[]) { diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.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 = { }; static VMStateDescription ccid_vmstate = { - .name = CCID_DEV_NAME, + .name = "usb-ccid", .version_id = 1, .minimum_version_id = 1, .post_load = ccid_post_load,