From patchwork Tue Jan 15 16:29:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 212223 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 107E02C0085 for ; Wed, 16 Jan 2013 03:29:53 +1100 (EST) Received: from localhost ([::1]:38862 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tv9OZ-0004AV-7F for incoming@patchwork.ozlabs.org; Tue, 15 Jan 2013 11:29:51 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56435) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tv9OJ-0003q5-6W for qemu-devel@nongnu.org; Tue, 15 Jan 2013 11:29:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tv9OH-00081d-FZ for qemu-devel@nongnu.org; Tue, 15 Jan 2013 11:29:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:61514) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tv9OH-000817-8u for qemu-devel@nongnu.org; Tue, 15 Jan 2013 11:29:33 -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 r0FGTTB9022986 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 15 Jan 2013 11:29:30 -0500 Received: from yakj.usersys.redhat.com (ovpn-112-29.ams2.redhat.com [10.36.112.29]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r0FGTRCP005947; Tue, 15 Jan 2013 11:29:28 -0500 Message-ID: <50F583E6.1040907@redhat.com> Date: Tue, 15 Jan 2013 17:29:26 +0100 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Cole Robinson References: <20121212223919.GA3190@amt.cnet> <50F4D0BC.9020207@redhat.com> In-Reply-To: <50F4D0BC.9020207@redhat.com> 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: Anthony Liguori , Marcelo Tosatti , 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 Il 15/01/2013 04:45, Cole Robinson ha scritto: > 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: > > > 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 = { > > > 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 Let's look at the source to reconstruct the changes. In qemu-kvm-0.15.1 (Fedora 16), file hw/vga_int.h, we had #define VGA_RAM_SIZE (16 * 1024 * 1024) In qemu-0.15.1, same file, we had #define VGA_RAM_SIZE (8192 * 1024) The same holds all the way back to 0.9, which had them in hw/pc.h. hw/vga-pci.c in qemu-kvm-1.2 and qemu-1.2 had both this line: DEFINE_PROP_UINT32("vgamem_mb", PCIVGAState, vga.vram_size_mb, 16), but hw/cirrus_vga.c had respectively: #define VGA_RAM_SIZE (16384 * 1024) #define VGA_RAM_SIZE (8192 * 1024) So the right patch for downstreams that used qemu-kvm is this: i.e. use 16 MB for all machine types and all cards. The latter should probably be pushed into 1.4 with compat properties for 1.3. At this point, you need to remove the compat property as in the pc_piix.c above. Paolo diff --git a/hw/pc_piix.c b/hw/pc_piix.c index 85529b2..c29ea0d 100644 --- a/hw/pc_piix.c +++ b/hw/pc_piix.c @@ -410,22 +410,6 @@ static QEMUMachine pc_machine_v1_2 = { .property = "param_change",\ .value = "off",\ },{\ - .driver = "VGA",\ - .property = "vgamem_mb",\ - .value = stringify(8),\ - },{\ - .driver = "vmware-svga",\ - .property = "vgamem_mb",\ - .value = stringify(8),\ - },{\ - .driver = "qxl-vga",\ - .property = "vgamem_mb",\ - .value = stringify(8),\ - },{\ - .driver = "qxl",\ - .property = "vgamem_mb",\ - .value = stringify(8),\ - },{\ .driver = "virtio-blk-pci",\ .property = "config-wce",\ .value = "off",\ diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c index 9bef96e..8c94428 100644 --- a/hw/cirrus_vga.c +++ b/hw/cirrus_vga.c @@ -2975,7 +2975,7 @@ static int pci_cirrus_vga_initfn(PCIDevice *dev) static Property pci_vga_cirrus_properties[] = { DEFINE_PROP_UINT32("vgamem_mb", struct PCICirrusVGAState, - cirrus_vga.vga.vram_size_mb, 8), + cirrus_vga.vga.vram_size_mb, 16), DEFINE_PROP_END_OF_LIST(), };