From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=49196 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oe5xw-0005mY-Ly for qemu-devel@nongnu.org; Wed, 28 Jul 2010 08:42:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oe5xv-0006zH-A6 for qemu-devel@nongnu.org; Wed, 28 Jul 2010 08:42:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15545) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oe5xv-0006zA-1Z for qemu-devel@nongnu.org; Wed, 28 Jul 2010 08:42:31 -0400 From: Jes.Sorensen@redhat.com 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> Subject: [Qemu-devel] [PATCH 1/2] Set a default CPU type for compat PC machine defs. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, avi@redhat.com From: Jes Sorensen This allows for changing the default CPU type on the current PC definition without breaking legacy mode. Signed-off-by: Jes Sorensen --- hw/boards.h | 1 + hw/pc_piix.c | 15 +++++++++++++++ vl.c | 2 ++ 3 files changed, 18 insertions(+), 0 deletions(-) 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); -- 1.7.1.1