[Spice-devel] [PATCH 31/35] [rhel6 compat] add rhel6.0.0 machine type
alexl at redhat.com
alexl at redhat.com
Thu Sep 9 10:16:14 PDT 2010
From: Gerd Hoffmann <kraxel at redhat.com>
---
hw/pc_piix.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 56 insertions(+), 0 deletions(-)
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 12359a7..ef746d3 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"
#define MAX_IDE_BUS 2
@@ -328,6 +329,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);
@@ -335,6 +390,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);
--
1.7.0.1
More information about the Spice-devel
mailing list