From patchwork Tue Jan 15 03:45:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 211984 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2CAC02C00A9 for ; Tue, 15 Jan 2013 14:45:32 +1100 (EST) Received: from localhost ([::1]:40950 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuxSs-0004YC-5p for incoming@patchwork.ozlabs.org; Mon, 14 Jan 2013 22:45:30 -0500 Received: from eggs.gnu.org ([208.118.235.92]:43016) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuxSk-0004Y6-B7 for qemu-devel@nongnu.org; Mon, 14 Jan 2013 22:45:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TuxSi-0005lC-QP for qemu-devel@nongnu.org; Mon, 14 Jan 2013 22:45:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:32165) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuxSi-0005l4-I1 for qemu-devel@nongnu.org; Mon, 14 Jan 2013 22:45:20 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0F3jE2G012463 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 14 Jan 2013 22:45:17 -0500 Received: from [10.3.113.142] (ovpn-113-142.phx2.redhat.com [10.3.113.142]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r0F3j0dG012914; Mon, 14 Jan 2013 22:45:01 -0500 Message-ID: <50F4D0BC.9020207@redhat.com> Date: Mon, 14 Jan 2013 22:45:00 -0500 From: Cole Robinson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Marcelo Tosatti References: <20121212223919.GA3190@amt.cnet> In-Reply-To: <20121212223919.GA3190@amt.cnet> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Paolo Bonzini , Anthony Liguori , qemu-devel@nongnu.org Subject: Re: [Qemu-devel] [PATCH] define qemukvm-1.2 machine type 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 On 12/12/2012 05:39 PM, Marcelo Tosatti wrote: > > To allow migration from qemu-kvm-1.2, where cirrus device has 16 megabytes > of RAM. > > Signed-off-by: Marcelo Tosatti > Hi Marcelo, I'm trying to sort through this again. > diff --git a/hw/pc_piix.c b/hw/pc_piix.c > index 19e342a..ead4b6b 100644 > --- a/hw/pc_piix.c > +++ b/hw/pc_piix.c > @@ -347,6 +347,26 @@ static QEMUMachine pc_machine_v1_2 = { > }, > }; > > +#define QEMUKVMPC_COMPAT_1_2 \ > + {\ > + .driver = "cirrus-vga",\ > + .property = "vgamem_mb",\ > + .value = "16",\ > + } > + > +static QEMUMachine qemukvmpc_machine_v1_2 = { > + .name = "qemukvm-pc-1.2", > + .alias = "pc", > + .desc = "Standard PC", > + .init = pc_init_pci, > + .max_cpus = 255, > + .compat_props = (GlobalProperty[]) { > + QEMUKVMPC_COMPAT_1_2, > + PC_COMPAT_1_2, > + { /* end of list */ } > + }, > +}; > + > #define PC_COMPAT_1_1 \ > PC_COMPAT_1_2,\ > {\ > @@ -645,6 +665,7 @@ static QEMUMachine xenfv_machine = { > > static void pc_machine_init(void) > { > + qemu_register_machine(&qemukvmpc_machine_v1_2); > qemu_register_machine(&pc_machine_v1_4); > qemu_register_machine(&pc_machine_v1_3); > qemu_register_machine(&pc_machine_v1_2); > As previously mentioned in the thread, a back compat machine type doesn't help us out in Fedora. For the past 3 years all qemu usage in fedora has been using qemu-kvm.git, so the only incoming migration we care about has to deal with the qemu-kvm migration incompatibilities. Libvirt always specifies an explicit machine type and carries it for the life of the VM. What we want is for 'qemu-kvm-1.2 -M pc-1.2' to migrate seamlessly into 'qemu-1.3+ -M pc-1.2' without the user or libvirt having to change machine type. So what we want to carry in Fedora is: That sticks the cirrus compat block on the end of PC_COMPAT_1_2, which should fix cirrus migration from qemu-kvm for all machine types <= pc-1.2. Obviously this isn't suitable for upstream but we can hide it behind something like ./configure --qemu-kvm-migrate-compat The other migrate bit is the comment you added to hw/acpi_piix4.c: /* qemu-kvm 1.2 uses version 3 but advertised as 2 * To support incoming qemu-kvm 1.2 migration, change version_id * and minimum_version_id to 2 below (which breaks migration from * qemu 1.2). * */ That's a bit more problematic. Upstream has minimum_version_id=3, so if we carry version_id=2 in Fedora, our packages will never be able to migrate to an upstream qemu version, even a VM using pc-1.3 that was added after qemu-kvm was deprecated. Is it safe to just set minimum_version_id=2 in qemu.git and be done with it? It at least doesn't blow up[1] going from qemu-kvm-1.2 -> patched qemu.git, nor qemu-1.2.2 -> patched qemu.git. But admittedly I don't understand the subtleties involved in migration compat. [1] Well, doesn't blow up any more than normal. Migrating stock qemu 1.2.2 -> qemu.git is crashing for me: #0 0x00007ffff24b6e50 in __memcmp_sse4_1 () from /lib64/libc.so.6 #1 0x000055555578c532 in patch_hypercalls (s=0x555556513f10) at /home/crobinso/qemu-clean/hw/i386/../kvmvapic.c:544 #2 vapic_prepare (s=s@entry=0x555556513f10) at /home/crobinso/qemu-clean/hw/i386/../kvmvapic.c:609 #3 0x000055555578c612 in vapic_post_load (opaque=0x555556513f10, version_id=) at /home/crobinso/qemu-clean/hw/i386/../kvmvapic.c:726 #4 0x00005555557ca0b0 in vmstate_load_state (f=f@entry=0x555556636510, vmsd= 0x555555c0a840 , opaque=0x555556513f10, version_id=1) at /home/crobinso/qemu-clean/savevm.c:1451 #5 0x00005555557cac53 in vmstate_load (version_id=, se= 0x555556520da0, f=0x555556636510) at /home/crobinso/qemu-clean/savevm.c:1514 #6 qemu_loadvm_state (f=f@entry=0x555556636510) at /home/crobinso/qemu-clean/savevm.c:1977 #7 0x00005555556fa15e in process_incoming_migration_co (opaque=0x555556636510) at migration.c:97 #8 0x000055555561f82a in coroutine_trampoline (i0=, i1=) at coroutine-ucontext.c:138 #9 0x00007ffff23a16c0 in ?? () from /lib64/libc.so.6 #10 0x00007fffffffd270 in ?? () #11 0x0000000000000000 in ?? () Using: qemu-system-x86_64 -M pc-1.2 -sdl -net none -vga cirrus -enable-kvm -m 2048 -incoming 'exec:cat migrate-to-file.img' Thanks, Cole diff --git a/hw/pc_piix.c b/hw/pc_piix.c index aa3e7f4..b8f5f8a 100644 --- a/hw/pc_piix.c +++ b/hw/pc_piix.c @@ -315,6 +315,10 @@ static QEMUMachine pc_machine_v1_3 = { .driver = "VGA",\ .property = "mmio",\ .value = "off",\ + },{\ + .driver = "cirrus-vga",\ + .property = "vgamem_mb",\ + .value = stringify(8),\ } static QEMUMachine pc_machine_v1_2 = {