Received: from eggs.gnu.org ([2001:4830:134:3::10]:56289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAE8K-0007ZH-Jv for qemu-devel@nongnu.org; Wed, 01 Jul 2015 05:16:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZAE8F-0003tw-BO for qemu-devel@nongnu.org; Wed, 01 Jul 2015 05:16:44 -0400 Received: from e06smtp15.uk.ibm.com ([195.75.94.111]:51033) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAE8F-0003tn-1R for qemu-devel@nongnu.org; Wed, 01 Jul 2015 05:16:39 -0400 Received: from /spool/local by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 1 Jul 2015 10:16:36 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 5615017D8056 for ; Wed, 1 Jul 2015 10:17:46 +0100 (BST) Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t619GX0b30802098 for ; Wed, 1 Jul 2015 09:16:33 GMT Received: from d06av09.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t619GXgB008859 for ; Wed, 1 Jul 2015 03:16:33 -0600 From: Christian Borntraeger Date: Wed, 1 Jul 2015 11:16:57 +0200 Message-Id: <1435742217-62246-1-git-send-email-borntraeger@de.ibm.com> Subject: [Qemu-devel] [PATCH 1/1] s390x/migration: Introduce 2.4 machine List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel Cc: Juan Quintela , Alexander Graf , "Dr. David Alan Gilbert" , Christian Borntraeger , Jens Freimann , "Jason J. Herne" , Boris Fiuczynski , Cornelia Huck 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. While one can argue that section footer should be enabled explicitely for new versions instead of disabled for old ones, this pinpoints to 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 --- 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 47f323b..90bb159 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -159,9 +159,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; @@ -171,7 +168,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; mc->hot_add_cpu = ccw_hot_add_cpu; nc->nmi_monitor_handler = s390_nmi; } @@ -228,6 +224,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, @@ -237,9 +234,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) -- 2.3.0