From patchwork Wed Jul 28 12:42:23 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jes Sorensen X-Patchwork-Id: 114754 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6SCgg0A021122 for ; Wed, 28 Jul 2010 12:42:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751444Ab0G1Mmd (ORCPT ); Wed, 28 Jul 2010 08:42:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50793 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751158Ab0G1Mmb (ORCPT ); Wed, 28 Jul 2010 08:42:31 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6SCgTPX009917 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 28 Jul 2010 08:42:29 -0400 Received: from localhost.localdomain ([10.3.121.7]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6SCgQTp015728; Wed, 28 Jul 2010 08:42:28 -0400 From: Jes.Sorensen@redhat.com To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, anthony@codemonkey.ws, avi@redhat.com Subject: [PATCH 1/2] Set a default CPU type for compat PC machine defs. Date: Wed, 28 Jul 2010 14:42:23 +0200 Message-Id: <1280320944-5560-2-git-send-email-Jes.Sorensen@redhat.com> In-Reply-To: <1280320944-5560-1-git-send-email-Jes.Sorensen@redhat.com> References: <1280320944-5560-1-git-send-email-Jes.Sorensen@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 28 Jul 2010 12:42:55 +0000 (UTC) diff --git a/hw/boards.h b/hw/boards.h index 6f0f0d7..932bc23 100644 --- a/hw/boards.h +++ b/hw/boards.h @@ -19,6 +19,7 @@ typedef struct QEMUMachine { QEMUMachineInitFunc *init; int use_scsi; int max_cpus; + const char *def_cpu_model; unsigned int no_serial:1, no_parallel:1, use_virtcon:1, diff --git a/hw/pc_piix.c b/hw/pc_piix.c index 812ddfd..51742a0 100644 --- a/hw/pc_piix.c +++ b/hw/pc_piix.c @@ -223,6 +223,11 @@ static QEMUMachine pc_machine_v0_12 = { .desc = "Standard PC", .init = pc_init_pci, .max_cpus = 255, +#ifdef TARGET_X86_64 + .def_cpu_model = "qemu64", +#else + .def_cpu_model = "qemu32", +#endif .compat_props = (GlobalProperty[]) { { .driver = "virtio-serial-pci", @@ -242,6 +247,11 @@ static QEMUMachine pc_machine_v0_11 = { .desc = "Standard PC, qemu 0.11", .init = pc_init_pci, .max_cpus = 255, +#ifdef TARGET_X86_64 + .def_cpu_model = "qemu64", +#else + .def_cpu_model = "qemu32", +#endif .compat_props = (GlobalProperty[]) { { .driver = "virtio-blk-pci", @@ -277,6 +287,11 @@ static QEMUMachine pc_machine_v0_10 = { .desc = "Standard PC, qemu 0.10", .init = pc_init_pci, .max_cpus = 255, +#ifdef TARGET_X86_64 + .def_cpu_model = "qemu64", +#else + .def_cpu_model = "qemu32", +#endif .compat_props = (GlobalProperty[]) { { .driver = "virtio-blk-pci", diff --git a/vl.c b/vl.c index ba6ee11..ca2c509 100644 --- a/vl.c +++ b/vl.c @@ -2868,6 +2868,8 @@ int main(int argc, char **argv, char **envp) } qemu_add_globals(); + if ((cpu_model == NULL) && (machine->def_cpu_model)) + cpu_model = machine->def_cpu_model; machine->init(ram_size, boot_devices, kernel_filename, kernel_cmdline, initrd_filename, cpu_model);