Patchwork [1/3] pc: add compat machine types for 0.14 and 0.15

login
register
mail settings
Submitter Alexander Graf
Date June 14, 2011, 3:29 p.m.
Message ID <1308065389-11945-2-git-send-email-agraf@suse.de>
Download mbox | patch
Permalink /patch/100360/
State New
Headers show

Comments

Alexander Graf - June 14, 2011, 3:29 p.m.
We change virtual hardware from time to time, so in order to ensure that
the guest doesn't get confused, we have compatibility machines for the PC
machine.

This patch adds compatibility definitions for 0.14 and 0.15 versions.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 hw/pc_piix.c |   32 +++++++++++++++++++++++++++++++-
 1 files changed, 31 insertions(+), 1 deletions(-)

Patch

diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 9a22a8a..3b3ef84 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -213,6 +213,18 @@  static void pc_init_pci(ram_addr_t ram_size,
              initrd_filename, cpu_model, 1, 1);
 }
 
+static void pc_init_pci_014(ram_addr_t ram_size,
+                            const char *boot_device,
+                            const char *kernel_filename,
+                            const char *kernel_cmdline,
+                            const char *initrd_filename,
+                            const char *cpu_model)
+{
+    pc_init1(ram_size, boot_device,
+             kernel_filename, kernel_cmdline,
+             initrd_filename, cpu_model, 1, 1);
+}
+
 static void pc_init_pci_no_kvmclock(ram_addr_t ram_size,
                                     const char *boot_device,
                                     const char *kernel_filename,
@@ -258,7 +270,7 @@  static void pc_xen_hvm_init(ram_addr_t ram_size,
 #endif
 
 static QEMUMachine pc_machine = {
-    .name = "pc-0.14",
+    .name = "pc-0.16",
     .alias = "pc",
     .desc = "Standard PC",
     .init = pc_init_pci,
@@ -266,6 +278,22 @@  static QEMUMachine pc_machine = {
     .is_default = 1,
 };
 
+static QEMUMachine pc_machine_v0_15 = {
+    .name = "pc-0.15",
+    .desc = "Standard PC",
+    .init = pc_init_pci_014,
+    .max_cpus = 255,
+    .is_default = 1,
+};
+
+static QEMUMachine pc_machine_v0_14 = {
+    .name = "pc-0.14",
+    .desc = "Standard PC",
+    .init = pc_init_pci_014,
+    .max_cpus = 255,
+    .is_default = 1,
+};
+
 static QEMUMachine pc_machine_v0_13 = {
     .name = "pc-0.13",
     .desc = "Standard PC",
@@ -434,6 +462,8 @@  static QEMUMachine xenfv_machine = {
 static void pc_machine_init(void)
 {
     qemu_register_machine(&pc_machine);
+    qemu_register_machine(&pc_machine_v0_15);
+    qemu_register_machine(&pc_machine_v0_14);
     qemu_register_machine(&pc_machine_v0_13);
     qemu_register_machine(&pc_machine_v0_12);
     qemu_register_machine(&pc_machine_v0_11);