[Spice-commits] Branch 'spice.kvm.v18' - hw/pc_piix.c

Gerd Hoffmann kraxel at kemper.freedesktop.org
Mon Sep 6 02:28:00 PDT 2010


 hw/pc_piix.c |   56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)

New commits:
commit a3d83de052786854a312b72ca266521cee679759
Author: Gerd Hoffmann <kraxel at redhat.com>
Date:   Mon Sep 6 11:20:19 2010 +0200

    [rhel6 compat] add rhel6.0.0 machine type

diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 3d07ce5..ceea57f 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -35,6 +35,7 @@
 #include "sysemu.h"
 #include "sysbus.h"
 #include "blockdev.h"
+#include "smbios.h"
 
 qemu_irq *ioapic_irq_hack;
 
@@ -347,6 +348,60 @@ static QEMUMachine isapc_machine = {
     .max_cpus = 1,
 };
 
+/* RHEL machine types */
+
+static void rhel_common_init(const char *type1_version,
+                             int legacy_smbios_vendor)
+{
+    char buf[32];
+
+    if (legacy_smbios_vendor) {
+        snprintf(buf, sizeof(buf), "QEMU");
+        smbios_add_field(0, offsetof(struct smbios_type_0, vendor_str),
+                         strlen(buf) + 1, buf);
+    }
+    snprintf(buf, sizeof(buf), "Red Hat");
+    smbios_add_field(1, offsetof(struct smbios_type_1, manufacturer_str),
+                     strlen(buf) + 1, buf);
+    snprintf(buf, sizeof(buf), "KVM");
+    smbios_add_field(1, offsetof(struct smbios_type_1, product_name_str),
+                     strlen(buf) + 1, buf);
+    snprintf(buf, sizeof(buf), type1_version);
+    smbios_add_field(1, offsetof(struct smbios_type_1, version_str),
+                     strlen(buf) + 1, buf);
+    snprintf(buf, sizeof(buf), "Red Hat Enterprise Linux");
+    smbios_add_field(1, offsetof(struct smbios_type_1, family_str),
+                     strlen(buf) + 1, buf);
+}
+
+static void pc_init_rhel600(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)
+{
+    rhel_common_init("RHEL 6.0.0 PC", 0);
+    pc_init_pci(ram_size, boot_device, kernel_filename, kernel_cmdline,
+                initrd_filename, cpu_model);
+}
+
+static QEMUMachine pc_machine_rhel600 = {
+    .name = "rhel6.0.0",
+    .alias = "pc",
+    .desc = "RHEL 6.0.0 PC",
+    .init = pc_init_rhel600,
+    .max_cpus = 255,
+    .compat_props = (GlobalProperty[]) {
+        {
+            .driver   = "qxl",
+            .property = "revision",
+            .value    = "1",
+        },
+        { /* end of list */ }
+    }
+};
+
 static void pc_machine_init(void)
 {
     qemu_register_machine(&pc_machine);
@@ -354,6 +409,7 @@ static void pc_machine_init(void)
     qemu_register_machine(&pc_machine_v0_11);
     qemu_register_machine(&pc_machine_v0_10);
     qemu_register_machine(&isapc_machine);
+    qemu_register_machine(&pc_machine_rhel600);
 }
 
 machine_init(pc_machine_init);


More information about the Spice-commits mailing list