218e99
From 9010afecdea6872235b1692c4ee5f04cca2dbcf2 Mon Sep 17 00:00:00 2001
218e99
From: Miroslav Rezanina <mrezanin@redhat.com>
218e99
Date: Wed, 31 Jul 2013 08:02:14 +0200
218e99
Subject: pc: Add machine type "rhel6.0.0"
218e99
218e99
Message-id: <1375201922-6794-3-git-send-email-armbru@redhat.com>
218e99
Patchwork-id: 52821
218e99
O-Subject: [RHEL-7 PATCH v3 02/15] pc: Add machine type "rhel6.0.0"
218e99
Bugzilla: 983991
218e99
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
218e99
RH-Acked-by: Bandan Das <bsd@redhat.com>
218e99
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
218e99
218e99
Make it a copy of upstream's pc-0.12 type.  Change name and desc.
218e99
Collect the scattered compat_props in one place (no functional
218e99
change).  Copy the init function.
218e99
218e99
The next few commits will morph compat_props and init function from
218e99
"same as upstream's pc-0.12" into "compatible with RHEL-6's
218e99
rhel6.0.0".
218e99
218e99
Signed-off-by: Markus Armbruster <armbru@redhat.com>
218e99
218e99
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
218e99
index 070a50d..bdb1b11 100644
218e99
--- a/hw/i386/pc_piix.c
218e99
+++ b/hw/i386/pc_piix.c
218e99
@@ -777,9 +777,252 @@ static QEMUMachine pc_machine_rhel700 = {
218e99
     DEFAULT_MACHINE_OPTIONS,
218e99
 };
218e99
 
218e99
+#define PC_RHEL6_0_COMPAT \
218e99
+    {\
218e99
+        .driver   = "Conroe-" TYPE_X86_CPU,\
218e99
+        .property = "model",\
218e99
+        .value    = stringify(2),\
218e99
+    },{\
218e99
+        .driver   = "Conroe-" TYPE_X86_CPU,\
218e99
+        .property = "level",\
218e99
+        .value    = stringify(2),\
218e99
+    },{\
218e99
+        .driver   = "Penryn-" TYPE_X86_CPU,\
218e99
+        .property = "model",\
218e99
+        .value    = stringify(2),\
218e99
+    },{\
218e99
+        .driver   = "Penryn-" TYPE_X86_CPU,\
218e99
+        .property = "level",\
218e99
+        .value    = stringify(2),\
218e99
+    },{\
218e99
+        .driver   = "Nehalem-" TYPE_X86_CPU,\
218e99
+        .property = "model",\
218e99
+        .value    = stringify(2),\
218e99
+    },{\
218e99
+        .driver   = "Nehalem-" TYPE_X86_CPU,\
218e99
+        .property = "level",\
218e99
+        .value    = stringify(2),\
218e99
+    },{\
218e99
+        .driver   = "scsi-hd",\
218e99
+        .property = "discard_granularity",\
218e99
+        .value    = stringify(0),\
218e99
+    },{\
218e99
+        .driver   = "scsi-cd",\
218e99
+        .property = "discard_granularity",\
218e99
+        .value    = stringify(0),\
218e99
+    },{\
218e99
+        .driver   = "scsi-disk",\
218e99
+        .property = "discard_granularity",\
218e99
+        .value    = stringify(0),\
218e99
+    },{\
218e99
+        .driver   = "ide-hd",\
218e99
+        .property = "discard_granularity",\
218e99
+        .value    = stringify(0),\
218e99
+    },{\
218e99
+        .driver   = "ide-cd",\
218e99
+        .property = "discard_granularity",\
218e99
+        .value    = stringify(0),\
218e99
+    },{\
218e99
+        .driver   = "ide-drive",\
218e99
+        .property = "discard_granularity",\
218e99
+        .value    = stringify(0),\
218e99
+    },{\
218e99
+        .driver   = "virtio-blk-pci",\
218e99
+        .property = "discard_granularity",\
218e99
+        .value    = stringify(0),\
218e99
+    },{\
218e99
+        .driver   = "virtio-serial-pci",\
218e99
+        .property = "vectors",\
218e99
+        /* DEV_NVECTORS_UNSPECIFIED as a uint32_t string */\
218e99
+        .value    = stringify(0xFFFFFFFF),\
218e99
+    },{\
218e99
+        .driver   = "e1000",\
218e99
+        .property = "romfile",\
218e99
+        .value    = "pxe-e1000.rom",\
218e99
+    },{\
218e99
+        .driver   = "ne2k_pci",\
218e99
+        .property = "romfile",\
218e99
+        .value    = "pxe-ne2k_pci.rom",\
218e99
+    },{\
218e99
+        .driver   = "pcnet",\
218e99
+        .property = "romfile",\
218e99
+        .value    = "pxe-pcnet.rom",\
218e99
+    },{\
218e99
+        .driver   = "rtl8139",\
218e99
+        .property = "romfile",\
218e99
+        .value    = "pxe-rtl8139.rom",\
218e99
+    },{\
218e99
+        .driver   = "virtio-net-pci",\
218e99
+        .property = "romfile",\
218e99
+        .value    = "pxe-virtio.rom",\
218e99
+    },{\
218e99
+        .driver   = "486-" TYPE_X86_CPU,\
218e99
+        .property = "model",\
218e99
+        .value    = stringify(0),\
218e99
+    },{\
218e99
+        .driver   = "usb-tablet",\
218e99
+        .property = "usb_version",\
218e99
+        .value    = stringify(1),\
218e99
+    },{\
218e99
+        .driver   = "virtio-net-pci",\
218e99
+        .property = "ctrl_mac_addr",\
218e99
+        .value    = "off",\
218e99
+    },{\
218e99
+        .driver   = "virtio-net-pci",\
218e99
+        .property = "mq",\
218e99
+        .value    = "off",\
218e99
+    },{\
218e99
+        .driver   = "e1000",\
218e99
+        .property = "autonegotiation",\
218e99
+        .value    = "off",\
218e99
+    },{\
218e99
+        .driver   = "nec-usb-xhci",\
218e99
+        .property = "msi",\
218e99
+        .value    = "off",\
218e99
+    },{\
218e99
+        .driver   = "nec-usb-xhci",\
218e99
+        .property = "msix",\
218e99
+        .value    = "off",\
218e99
+    },{\
218e99
+        .driver   = "ivshmem",\
218e99
+        .property = "use64",\
218e99
+        .value    = "0",\
218e99
+    },{\
218e99
+        .driver   = "qxl",\
218e99
+        .property = "revision",\
218e99
+        .value    = stringify(3),\
218e99
+    },{\
218e99
+        .driver   = "qxl-vga",\
218e99
+        .property = "revision",\
218e99
+        .value    = stringify(3),\
218e99
+    },{\
218e99
+        .driver   = "VGA",\
218e99
+        .property = "mmio",\
218e99
+        .value    = "off",\
218e99
+    },{\
218e99
+        .driver   = "virtio-scsi-pci",\
218e99
+        .property = "hotplug",\
218e99
+        .value    = "off",\
218e99
+    },{\
218e99
+        .driver   = "virtio-scsi-pci",\
218e99
+        .property = "param_change",\
218e99
+        .value    = "off",\
218e99
+    },{\
218e99
+        .driver   = "VGA",\
218e99
+        .property = "vgamem_mb",\
218e99
+        .value    = stringify(8),\
218e99
+    },{\
218e99
+        .driver   = "vmware-svga",\
218e99
+        .property = "vgamem_mb",\
218e99
+        .value    = stringify(8),\
218e99
+    },{\
218e99
+        .driver   = "qxl-vga",\
218e99
+        .property = "vgamem_mb",\
218e99
+        .value    = stringify(8),\
218e99
+    },{\
218e99
+        .driver   = "qxl",\
218e99
+        .property = "vgamem_mb",\
218e99
+        .value    = stringify(8),\
218e99
+    },{\
218e99
+        .driver   = "virtio-blk-pci",\
218e99
+        .property = "config-wce",\
218e99
+        .value    = "off",\
218e99
+    },{\
218e99
+        .driver   = "pc-sysfw",\
218e99
+        .property = "rom_only",\
218e99
+        .value    = stringify(1),\
218e99
+    },{\
218e99
+        .driver   = TYPE_ISA_FDC,\
218e99
+        .property = "check_media_rate",\
218e99
+        .value    = "off",\
218e99
+    },{\
218e99
+        .driver   = "virtio-balloon-pci",\
218e99
+        .property = "class",\
218e99
+        .value    = stringify(PCI_CLASS_MEMORY_RAM),\
218e99
+    },{\
218e99
+        .driver   = "apic",\
218e99
+        .property = "vapic",\
218e99
+        .value    = "off",\
218e99
+    },{\
218e99
+        .driver   = TYPE_USB_DEVICE,\
218e99
+        .property = "full-path",\
218e99
+        .value    = "no",\
218e99
+    },{\
218e99
+        .driver   = "virtio-blk-pci",\
218e99
+        .property = "event_idx",\
218e99
+        .value    = "off",\
218e99
+    },{\
218e99
+        .driver   = "virtio-serial-pci",\
218e99
+        .property = "event_idx",\
218e99
+        .value    = "off",\
218e99
+    },{\
218e99
+        .driver   = "virtio-net-pci",\
218e99
+        .property = "event_idx",\
218e99
+        .value    = "off",\
218e99
+    },{\
218e99
+        .driver   = "virtio-balloon-pci",\
218e99
+        .property = "event_idx",\
218e99
+        .value    = "off",\
218e99
+    },{\
218e99
+        .driver   = TYPE_PCI_DEVICE,\
218e99
+        .property = "command_serr_enable",\
218e99
+        .value    = "off",\
218e99
+    },{\
218e99
+        .driver   = "AC97",\
218e99
+        .property = "use_broken_id",\
218e99
+        .value    = stringify(1),\
218e99
+    },{\
218e99
+        .driver   = "virtio-serial-pci",\
218e99
+        .property = "max_ports",\
218e99
+        .value    = stringify(1),\
218e99
+    },{\
218e99
+        .driver   = "virtio-serial-pci",\
218e99
+        .property = "vectors",\
218e99
+        .value    = stringify(0),\
218e99
+    },{\
218e99
+        .driver   = "VGA",\
218e99
+        .property = "rombar",\
218e99
+        .value    = stringify(0),\
218e99
+    },{\
218e99
+        .driver   = "vmware-svga",\
218e99
+        .property = "rombar",\
218e99
+        .value    = stringify(0),\
218e99
+    }
218e99
+
218e99
+static void pc_init_rhel600(QEMUMachineInitArgs *args)
218e99
+{
218e99
+    ram_addr_t ram_size = args->ram_size;
218e99
+    const char *cpu_model = args->cpu_model;
218e99
+    const char *kernel_filename = args->kernel_filename;
218e99
+    const char *kernel_cmdline = args->kernel_cmdline;
218e99
+    const char *initrd_filename = args->initrd_filename;
218e99
+    const char *boot_device = args->boot_device;
218e99
+    has_pvpanic = false;
218e99
+    disable_kvm_pv_eoi();
218e99
+    enable_compat_apic_id_mode();
218e99
+    pc_init1(get_system_memory(),
218e99
+             get_system_io(),
218e99
+             ram_size, boot_device,
218e99
+             kernel_filename, kernel_cmdline,
218e99
+             initrd_filename, cpu_model, 1, 0);
218e99
+}
218e99
+
218e99
+static QEMUMachine pc_machine_rhel600 = {
218e99
+    .name = "rhel6.0.0",
218e99
+    .desc = "RHEL 6.0.0 PC",
218e99
+    .init = pc_init_rhel600,
218e99
+    .max_cpus = 255,
218e99
+    .compat_props = (GlobalProperty[]) {
218e99
+        PC_RHEL6_0_COMPAT,
218e99
+        { /* end of list */ }
218e99
+    },
218e99
+    DEFAULT_MACHINE_OPTIONS,
218e99
+};
218e99
+
218e99
 static void rhel_machine_init(void)
218e99
 {
218e99
     qemu_register_machine(&pc_machine_rhel700);
218e99
+    qemu_register_machine(&pc_machine_rhel600);
218e99
 }
218e99
 
218e99
 machine_init(rhel_machine_init);