9ae3a8
From fce3651ee99dd18501b9302d72cd8c0af098a235 Mon Sep 17 00:00:00 2001
9ae3a8
From: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
Date: Wed, 31 Jul 2013 08:05:58 +0200
9ae3a8
Subject: pc: Add machine type "rhel6.4.0"
9ae3a8
9ae3a8
Message-id: <1375201922-6794-14-git-send-email-armbru@redhat.com>
9ae3a8
Patchwork-id: 52820
9ae3a8
O-Subject: [RHEL-7 PATCH v3 13/15] pc: Add machine type "rhel6.4.0"
9ae3a8
Bugzilla: 983991
9ae3a8
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
RH-Acked-by: Bandan Das <bsd@redhat.com>
9ae3a8
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
9ae3a8
Match RHEL-6's set_cpu_model_level() by equivalent compat_props model
9ae3a8
and level.
9ae3a8
9ae3a8
Match RHEL-6's compat_props qxl.revision, qxl-vga.revision,
9ae3a8
virtio-scsi-pci.hotplug, virtio-scsi-pci.param_change.
9ae3a8
9ae3a8
RHEL-6's non-upstream USB.create_unique_serial will be covered
9ae3a8
separately (either bug 953304 or a new one).
9ae3a8
9ae3a8
RHEL-6's non-upstream isa-fdc.migrate_dir isn't needed.  RHEL-6 has it
9ae3a8
to enable migration back to RHEL-6.3 (see qemu-kvm-rhel6 commit
9ae3a8
a214015), which isn't relevant in RHEL-7.
9ae3a8
9ae3a8
Match RHEL-6's non-upstream e1000.x-__com_redhat_rhel630_compat by
9ae3a8
upstream's e1000.autonegotiation, as follows.
9ae3a8
9ae3a8
Upstream commit 2af234e disables auto-negotiation for older machine
9ae3a8
types, by defining property e1000.autonegotiation and putting it into
9ae3a8
suitable compat_props.  The corresponding RHEL-6 commit da4452c does
9ae3a8
not add this property.  Instead, it reuses
9ae3a8
e1000.x-__com_redhat_rhel630_compat, with the sense reverted.  This
9ae3a8
turns autonegotiation off for rhel6.3.0 and older.
9ae3a8
9ae3a8
RHEL-7 inherits the upstream solution.  We need to set
9ae3a8
e1000.autonegotiation for exactly the machine types where
9ae3a8
e1000.x-__com_redhat_rhel630_compat is on in RHEL-6, namely rhel6.3.0
9ae3a8
and older.
9ae3a8
9ae3a8
Match RHEL-6's disable_kvm_pv_eoi().
9ae3a8
9ae3a8
Match RHEL-6's compat_contiguous_apic_ids by upstream's
9ae3a8
enable_compat_apic_id_mode().
9ae3a8
9ae3a8
RHEL-6's set_pmu_passthrough() and disable_tsc_deadline() will be
9ae3a8
covered separately (bug 918907).
9ae3a8
9ae3a8
Signed-off-by: Markus Armbruster <armbru@redhat.com>
9ae3a8
9ae3a8
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
9ae3a8
index dff2543..a922645 100644
9ae3a8
--- a/hw/i386/pc_piix.c
9ae3a8
+++ b/hw/i386/pc_piix.c
9ae3a8
@@ -777,32 +777,8 @@ static QEMUMachine pc_machine_rhel700 = {
9ae3a8
     DEFAULT_MACHINE_OPTIONS,
9ae3a8
 };
9ae3a8
 
9ae3a8
-#define PC_RHEL6_3_COMPAT \
9ae3a8
+#define PC_RHEL6_4_COMPAT \
9ae3a8
     {\
9ae3a8
-        .driver   = "Conroe-" TYPE_X86_CPU,\
9ae3a8
-        .property = "model",\
9ae3a8
-        .value    = stringify(2),\
9ae3a8
-    },{\
9ae3a8
-        .driver   = "Conroe-" TYPE_X86_CPU,\
9ae3a8
-        .property = "level",\
9ae3a8
-        .value    = stringify(2),\
9ae3a8
-    },{\
9ae3a8
-        .driver   = "Penryn-" TYPE_X86_CPU,\
9ae3a8
-        .property = "model",\
9ae3a8
-        .value    = stringify(2),\
9ae3a8
-    },{\
9ae3a8
-        .driver   = "Penryn-" TYPE_X86_CPU,\
9ae3a8
-        .property = "level",\
9ae3a8
-        .value    = stringify(2),\
9ae3a8
-    },{\
9ae3a8
-        .driver   = "Nehalem-" TYPE_X86_CPU,\
9ae3a8
-        .property = "model",\
9ae3a8
-        .value    = stringify(2),\
9ae3a8
-    },{\
9ae3a8
-        .driver   = "Nehalem-" TYPE_X86_CPU,\
9ae3a8
-        .property = "level",\
9ae3a8
-        .value    = stringify(2),\
9ae3a8
-    },{\
9ae3a8
         .driver   = "scsi-hd",\
9ae3a8
         .property = "discard_granularity",\
9ae3a8
         .value    = stringify(0),\
9ae3a8
@@ -864,30 +840,10 @@ static QEMUMachine pc_machine_rhel700 = {
9ae3a8
         .property = "mq",\
9ae3a8
         .value    = "off",\
9ae3a8
     },{\
9ae3a8
-        .driver   = "e1000",\
9ae3a8
-        .property = "autonegotiation",\
9ae3a8
-        .value    = "off",\
9ae3a8
-    },{\
9ae3a8
-        .driver   = "qxl",\
9ae3a8
-        .property = "revision",\
9ae3a8
-        .value    = stringify(3),\
9ae3a8
-    },{\
9ae3a8
-        .driver   = "qxl-vga",\
9ae3a8
-        .property = "revision",\
9ae3a8
-        .value    = stringify(3),\
9ae3a8
-    },{\
9ae3a8
         .driver   = "VGA",\
9ae3a8
         .property = "mmio",\
9ae3a8
         .value    = "off",\
9ae3a8
     },{\
9ae3a8
-        .driver   = "virtio-scsi-pci",\
9ae3a8
-        .property = "hotplug",\
9ae3a8
-        .value    = "off",\
9ae3a8
-    },{\
9ae3a8
-        .driver   = "virtio-scsi-pci",\
9ae3a8
-        .property = "param_change",\
9ae3a8
-        .value    = "off",\
9ae3a8
-    },{\
9ae3a8
         .driver   = "virtio-blk-pci",\
9ae3a8
         .property = "config-wce",\
9ae3a8
         .value    = "off",\
9ae3a8
@@ -909,12 +865,77 @@ static QEMUMachine pc_machine_rhel700 = {
9ae3a8
         .value    = stringify(1),\
9ae3a8
     }
9ae3a8
 
9ae3a8
-static void pc_init_rhel630(QEMUMachineInitArgs *args)
9ae3a8
+static void pc_init_rhel640(QEMUMachineInitArgs *args)
9ae3a8
 {
9ae3a8
     has_pvpanic = false;
9ae3a8
+    pc_init_rhel700(args);
9ae3a8
+}
9ae3a8
+
9ae3a8
+static QEMUMachine pc_machine_rhel640 = {
9ae3a8
+    .name = "rhel6.4.0",
9ae3a8
+    .desc = "RHEL 6.4.0 PC",
9ae3a8
+    .init = pc_init_rhel640,
9ae3a8
+    .max_cpus = 255,
9ae3a8
+    .compat_props = (GlobalProperty[]) {
9ae3a8
+        PC_RHEL6_4_COMPAT,
9ae3a8
+        { /* end of list */ }
9ae3a8
+    },
9ae3a8
+    DEFAULT_MACHINE_OPTIONS,
9ae3a8
+};
9ae3a8
+
9ae3a8
+#define PC_RHEL6_3_COMPAT \
9ae3a8
+    PC_RHEL6_4_COMPAT,\
9ae3a8
+    {\
9ae3a8
+        .driver   = "Conroe-" TYPE_X86_CPU,\
9ae3a8
+        .property = "model",\
9ae3a8
+        .value    = stringify(2),\
9ae3a8
+    },{\
9ae3a8
+        .driver   = "Conroe-" TYPE_X86_CPU,\
9ae3a8
+        .property = "level",\
9ae3a8
+        .value    = stringify(2),\
9ae3a8
+    },{\
9ae3a8
+        .driver   = "Penryn-" TYPE_X86_CPU,\
9ae3a8
+        .property = "model",\
9ae3a8
+        .value    = stringify(2),\
9ae3a8
+    },{\
9ae3a8
+        .driver   = "Penryn-" TYPE_X86_CPU,\
9ae3a8
+        .property = "level",\
9ae3a8
+        .value    = stringify(2),\
9ae3a8
+    },{\
9ae3a8
+        .driver   = "Nehalem-" TYPE_X86_CPU,\
9ae3a8
+        .property = "model",\
9ae3a8
+        .value    = stringify(2),\
9ae3a8
+    },{\
9ae3a8
+        .driver   = "Nehalem-" TYPE_X86_CPU,\
9ae3a8
+        .property = "level",\
9ae3a8
+        .value    = stringify(2),\
9ae3a8
+    },{\
9ae3a8
+        .driver   = "e1000",\
9ae3a8
+        .property = "autonegotiation",\
9ae3a8
+        .value    = "off",\
9ae3a8
+    },{\
9ae3a8
+        .driver   = "qxl",\
9ae3a8
+        .property = "revision",\
9ae3a8
+        .value    = stringify(3),\
9ae3a8
+    },{\
9ae3a8
+        .driver   = "qxl-vga",\
9ae3a8
+        .property = "revision",\
9ae3a8
+        .value    = stringify(3),\
9ae3a8
+    },{\
9ae3a8
+        .driver   = "virtio-scsi-pci",\
9ae3a8
+        .property = "hotplug",\
9ae3a8
+        .value    = "off",\
9ae3a8
+    },{\
9ae3a8
+        .driver   = "virtio-scsi-pci",\
9ae3a8
+        .property = "param_change",\
9ae3a8
+        .value    = "off",\
9ae3a8
+    }
9ae3a8
+
9ae3a8
+static void pc_init_rhel630(QEMUMachineInitArgs *args)
9ae3a8
+{
9ae3a8
     disable_kvm_pv_eoi();
9ae3a8
     enable_compat_apic_id_mode();
9ae3a8
-    pc_init_rhel700(args);
9ae3a8
+    pc_init_rhel640(args);
9ae3a8
 }
9ae3a8
 
9ae3a8
 static QEMUMachine pc_machine_rhel630 = {
9ae3a8
@@ -1030,6 +1051,7 @@ static QEMUMachine pc_machine_rhel600 = {
9ae3a8
 static void rhel_machine_init(void)
9ae3a8
 {
9ae3a8
     qemu_register_machine(&pc_machine_rhel700);
9ae3a8
+    qemu_register_machine(&pc_machine_rhel640);
9ae3a8
     qemu_register_machine(&pc_machine_rhel630);
9ae3a8
     qemu_register_machine(&pc_machine_rhel620);
9ae3a8
     qemu_register_machine(&pc_machine_rhel610);