aboutsummaryrefslogtreecommitdiff
path: root/hw/i386/pc_q35.c
diff options
context:
space:
mode:
authorMarcel Apfelbaum <marcel.a@redhat.com>2014-05-07 17:42:57 +0300
committerAndreas Färber <afaerber@suse.de>2014-05-28 17:35:01 +0200
commit3ef9622182e598392855931e7a0437d3855cef5e (patch)
tree87765046f480836eb65ecbcd293cade13518c62f /hw/i386/pc_q35.c
parent0380aef323154205a7d838fb9953423621290d41 (diff)
machine: Conversion of QEMUMachineInitArgs to MachineState
Total removal of QEMUMachineInitArgs struct. QEMUMachineInitArgs's fields are copied into MachineState. Removed duplicated fields from MachineState. All the other changes are only mechanical refactoring, no semantic changes. Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> (s390) Reviewed-by: Michael S. Tsirkin <mst@redhat.com> (PC) [AF: Renamed ms -> machine, use MACHINE_GET_CLASS()] Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/i386/pc_q35.c')
-rw-r--r--hw/i386/pc_q35.c67
1 files changed, 34 insertions, 33 deletions
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 9517ec653f..b3c02c163d 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -59,7 +59,7 @@ static bool smbios_legacy_mode;
static bool gigabyte_align = true;
/* PC hardware initialisation */
-static void pc_q35_init(QEMUMachineInitArgs *args)
+static void pc_q35_init(MachineState *machine)
{
ram_addr_t below_4g_mem_size, above_4g_mem_size;
Q35PCIHost *q35_host;
@@ -93,7 +93,7 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
object_property_add_child(qdev_get_machine(), "icc-bridge",
OBJECT(icc_bridge), NULL);
- pc_cpus_init(args->cpu_model, icc_bridge);
+ pc_cpus_init(machine->cpu_model, icc_bridge);
pc_acpi_init("q35-acpi-dsdt.aml");
kvmclock_create();
@@ -107,13 +107,13 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
* For old machine types, use whatever split we used historically to avoid
* breaking migration.
*/
- if (args->ram_size >= 0xb0000000) {
+ if (machine->ram_size >= 0xb0000000) {
ram_addr_t lowmem = gigabyte_align ? 0x80000000 : 0xb0000000;
- above_4g_mem_size = args->ram_size - lowmem;
+ above_4g_mem_size = machine->ram_size - lowmem;
below_4g_mem_size = lowmem;
} else {
above_4g_mem_size = 0;
- below_4g_mem_size = args->ram_size;
+ below_4g_mem_size = machine->ram_size;
}
/* pci enabled */
@@ -132,16 +132,17 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
guest_info->has_acpi_build = has_acpi_build;
if (smbios_defaults) {
+ MachineClass *mc = MACHINE_GET_CLASS(machine);
/* These values are guest ABI, do not change */
smbios_set_defaults("QEMU", "Standard PC (Q35 + ICH9, 2009)",
- args->machine->name, smbios_legacy_mode);
+ mc->name, smbios_legacy_mode);
}
/* allocate ram and load rom/bios */
if (!xen_enabled()) {
pc_memory_init(get_system_memory(),
- args->kernel_filename, args->kernel_cmdline,
- args->initrd_filename,
+ machine->kernel_filename, machine->kernel_cmdline,
+ machine->initrd_filename,
below_4g_mem_size, above_4g_mem_size,
rom_memory, &ram_memory, guest_info);
}
@@ -230,7 +231,7 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
0xb100),
8, NULL, 0);
- pc_cmos_init(below_4g_mem_size, above_4g_mem_size, args->boot_order,
+ pc_cmos_init(below_4g_mem_size, above_4g_mem_size, machine->boot_order,
floppy, idebus[0], idebus[1], rtc_state);
/* the rest devices to which pci devfn is automatically assigned */
@@ -241,68 +242,68 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
}
}
-static void pc_compat_2_0(QEMUMachineInitArgs *args)
+static void pc_compat_2_0(MachineState *machine)
{
smbios_legacy_mode = true;
}
-static void pc_compat_1_7(QEMUMachineInitArgs *args)
+static void pc_compat_1_7(MachineState *machine)
{
- pc_compat_2_0(args);
+ pc_compat_2_0(machine);
smbios_defaults = false;
gigabyte_align = false;
option_rom_has_mr = true;
x86_cpu_compat_disable_kvm_features(FEAT_1_ECX, CPUID_EXT_X2APIC);
}
-static void pc_compat_1_6(QEMUMachineInitArgs *args)
+static void pc_compat_1_6(MachineState *machine)
{
- pc_compat_1_7(args);
+ pc_compat_1_7(machine);
has_pci_info = false;
rom_file_has_mr = false;
has_acpi_build = false;
}
-static void pc_compat_1_5(QEMUMachineInitArgs *args)
+static void pc_compat_1_5(MachineState *machine)
{
- pc_compat_1_6(args);
+ pc_compat_1_6(machine);
}
-static void pc_compat_1_4(QEMUMachineInitArgs *args)
+static void pc_compat_1_4(MachineState *machine)
{
- pc_compat_1_5(args);
+ pc_compat_1_5(machine);
x86_cpu_compat_set_features("n270", FEAT_1_ECX, 0, CPUID_EXT_MOVBE);
x86_cpu_compat_set_features("Westmere", FEAT_1_ECX, 0, CPUID_EXT_PCLMULQDQ);
}
-static void pc_q35_init_2_0(QEMUMachineInitArgs *args)
+static void pc_q35_init_2_0(MachineState *machine)
{
- pc_compat_2_0(args);
- pc_q35_init(args);
+ pc_compat_2_0(machine);
+ pc_q35_init(machine);
}
-static void pc_q35_init_1_7(QEMUMachineInitArgs *args)
+static void pc_q35_init_1_7(MachineState *machine)
{
- pc_compat_1_7(args);
- pc_q35_init(args);
+ pc_compat_1_7(machine);
+ pc_q35_init(machine);
}
-static void pc_q35_init_1_6(QEMUMachineInitArgs *args)
+static void pc_q35_init_1_6(MachineState *machine)
{
- pc_compat_1_6(args);
- pc_q35_init(args);
+ pc_compat_1_6(machine);
+ pc_q35_init(machine);
}
-static void pc_q35_init_1_5(QEMUMachineInitArgs *args)
+static void pc_q35_init_1_5(MachineState *machine)
{
- pc_compat_1_5(args);
- pc_q35_init(args);
+ pc_compat_1_5(machine);
+ pc_q35_init(machine);
}
-static void pc_q35_init_1_4(QEMUMachineInitArgs *args)
+static void pc_q35_init_1_4(MachineState *machine)
{
- pc_compat_1_4(args);
- pc_q35_init(args);
+ pc_compat_1_4(machine);
+ pc_q35_init(machine);
}
#define PC_Q35_MACHINE_OPTIONS \