From patchwork Thu Jul 2 07:42:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 490488 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 463241402A9 for ; Thu, 2 Jul 2015 17:47:31 +1000 (AEST) Received: from localhost ([::1]:35047 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAZDV-0000zL-CV for incoming@patchwork.ozlabs.org; Thu, 02 Jul 2015 03:47:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41016) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAZ9A-0001kb-LT for qemu-devel@nongnu.org; Thu, 02 Jul 2015 03:43:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZAZ95-0006cw-2N for qemu-devel@nongnu.org; Thu, 02 Jul 2015 03:43:00 -0400 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:47995) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAZ94-0006ca-H0 for qemu-devel@nongnu.org; Thu, 02 Jul 2015 03:42:54 -0400 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 2 Jul 2015 08:42:52 +0100 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp16.uk.ibm.com (192.168.101.146) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 2 Jul 2015 08:42:49 +0100 X-Helo: d06dlp01.portsmouth.uk.ibm.com X-MailFrom: cornelia.huck@de.ibm.com X-RcptTo: qemu-devel@nongnu.org Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 43C1A17D8063 for ; Thu, 2 Jul 2015 08:44:04 +0100 (BST) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t627gpfM34078774 for ; Thu, 2 Jul 2015 07:42:51 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t627goHK010724 for ; Thu, 2 Jul 2015 01:42:50 -0600 Received: from gondolin.ibm.com (sig-9-81-25-227.evts.uk.ibm.com [9.81.25.227]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t627gUiT009937; Thu, 2 Jul 2015 01:42:49 -0600 From: Cornelia Huck To: peter.maydell@linaro.org Date: Thu, 2 Jul 2015 09:42:25 +0200 Message-Id: <1435822945-30232-12-git-send-email-cornelia.huck@de.ibm.com> X-Mailer: git-send-email 2.4.5 In-Reply-To: <1435822945-30232-1-git-send-email-cornelia.huck@de.ibm.com> References: <1435822945-30232-1-git-send-email-cornelia.huck@de.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15070207-0025-0000-0000-000005D3A36F X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 195.75.94.112 Cc: agraf@suse.de, Juan Quintela , qemu-devel@nongnu.org, "Dr. David Alan Gilbert" , borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com, "Jason J. Herne" , Boris Fiuczynski , Cornelia Huck Subject: [Qemu-devel] [PULL for-2.4 11/11] s390x/migration: Introduce 2.4 machine X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Christian Borntraeger The section footer changes commit f68945d42bab ("Add a protective section footer") and commit 37fb569c0198 ("Disable section footers on older machine types") broke migration for any non-versioned machines. This pinpoints a problem of s390-ccw machines: it needs to be versioned to be compatible with future changes in common code data structures such as section footers. Let's introduce a version scheme for s390-ccw-virtio machines. We will use the old s390-ccw-virtio name as alias to the latest version as all existing libvirt XML for the ccw type were expanded by libvirt to that name. The only downside of this patch is, that the old alias s390-ccw will no longer be available as machines can have only one alias, but it should not really matter. Cc: Dr. David Alan Gilbert Cc: Juan Quintela Cc: Boris Fiuczynski Cc: Jason J. Herne Signed-off-by: Christian Borntraeger Message-Id: <1435742217-62246-1-git-send-email-borntraeger@de.ibm.com> Reviewed-by: Juan Quintela Signed-off-by: Cornelia Huck --- hw/s390x/s390-virtio-ccw.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index c574988..3d20d6a 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -204,9 +204,6 @@ static void ccw_machine_class_init(ObjectClass *oc, void *data) MachineClass *mc = MACHINE_CLASS(oc); NMIClass *nc = NMI_CLASS(oc); - mc->name = "s390-ccw-virtio"; - mc->alias = "s390-ccw"; - mc->desc = "VirtIO-ccw based S390 machine"; mc->init = ccw_init; mc->block_default_type = IF_VIRTIO; mc->no_cdrom = 1; @@ -216,7 +213,6 @@ static void ccw_machine_class_init(ObjectClass *oc, void *data) mc->no_sdcard = 1; mc->use_sclp = 1; mc->max_cpus = 255; - mc->is_default = 1; nc->nmi_monitor_handler = s390_nmi; } @@ -272,6 +268,7 @@ static inline void s390_machine_initfn(Object *obj) static const TypeInfo ccw_machine_info = { .name = TYPE_S390_CCW_MACHINE, .parent = TYPE_MACHINE, + .abstract = true, .instance_size = sizeof(S390CcwMachineState), .instance_init = s390_machine_initfn, .class_init = ccw_machine_class_init, @@ -281,9 +278,26 @@ static const TypeInfo ccw_machine_info = { }, }; +static void ccw_machine_2_4_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc = MACHINE_CLASS(oc); + + mc->name = "s390-ccw-virtio-2.4"; + mc->alias = "s390-ccw-virtio"; + mc->desc = "VirtIO-ccw based S390 machine v2.4"; + mc->is_default = 1; +} + +static const TypeInfo ccw_machine_2_4_info = { + .name = TYPE_S390_CCW_MACHINE "2.4", + .parent = TYPE_S390_CCW_MACHINE, + .class_init = ccw_machine_2_4_class_init, +}; + static void ccw_machine_register_types(void) { type_register_static(&ccw_machine_info); + type_register_static(&ccw_machine_2_4_info); } type_init(ccw_machine_register_types)