mirror of
https://github.com/qemu/qemu.git
synced 2025-08-01 02:05:48 +00:00
pc: Don't explode QEMUMachineInitArgs into local variables needlessly
Don't explode when the variable is used just a few times, and never changed. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
5650f5f48b
commit
3b6fb9cab2
@ -53,12 +53,6 @@ static bool has_pci_info = true;
|
|||||||
/* PC hardware initialisation */
|
/* PC hardware initialisation */
|
||||||
static void pc_q35_init(QEMUMachineInitArgs *args)
|
static void pc_q35_init(QEMUMachineInitArgs *args)
|
||||||
{
|
{
|
||||||
ram_addr_t ram_size = args->ram_size;
|
|
||||||
const char *cpu_model = args->cpu_model;
|
|
||||||
const char *kernel_filename = args->kernel_filename;
|
|
||||||
const char *kernel_cmdline = args->kernel_cmdline;
|
|
||||||
const char *initrd_filename = args->initrd_filename;
|
|
||||||
const char *boot_device = args->boot_device;
|
|
||||||
ram_addr_t below_4g_mem_size, above_4g_mem_size;
|
ram_addr_t below_4g_mem_size, above_4g_mem_size;
|
||||||
Q35PCIHost *q35_host;
|
Q35PCIHost *q35_host;
|
||||||
PCIHostState *phb;
|
PCIHostState *phb;
|
||||||
@ -86,17 +80,17 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
|
|||||||
object_property_add_child(qdev_get_machine(), "icc-bridge",
|
object_property_add_child(qdev_get_machine(), "icc-bridge",
|
||||||
OBJECT(icc_bridge), NULL);
|
OBJECT(icc_bridge), NULL);
|
||||||
|
|
||||||
pc_cpus_init(cpu_model, icc_bridge);
|
pc_cpus_init(args->cpu_model, icc_bridge);
|
||||||
pc_acpi_init("q35-acpi-dsdt.aml");
|
pc_acpi_init("q35-acpi-dsdt.aml");
|
||||||
|
|
||||||
kvmclock_create();
|
kvmclock_create();
|
||||||
|
|
||||||
if (ram_size >= 0xb0000000) {
|
if (args->ram_size >= 0xb0000000) {
|
||||||
above_4g_mem_size = ram_size - 0xb0000000;
|
above_4g_mem_size = args->ram_size - 0xb0000000;
|
||||||
below_4g_mem_size = 0xb0000000;
|
below_4g_mem_size = 0xb0000000;
|
||||||
} else {
|
} else {
|
||||||
above_4g_mem_size = 0;
|
above_4g_mem_size = 0;
|
||||||
below_4g_mem_size = ram_size;
|
below_4g_mem_size = args->ram_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* pci enabled */
|
/* pci enabled */
|
||||||
@ -115,8 +109,10 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
|
|||||||
|
|
||||||
/* allocate ram and load rom/bios */
|
/* allocate ram and load rom/bios */
|
||||||
if (!xen_enabled()) {
|
if (!xen_enabled()) {
|
||||||
pc_memory_init(get_system_memory(), kernel_filename, kernel_cmdline,
|
pc_memory_init(get_system_memory(),
|
||||||
initrd_filename, below_4g_mem_size, above_4g_mem_size,
|
args->kernel_filename, args->kernel_cmdline,
|
||||||
|
args->initrd_filename,
|
||||||
|
below_4g_mem_size, above_4g_mem_size,
|
||||||
rom_memory, &ram_memory, guest_info);
|
rom_memory, &ram_memory, guest_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -204,7 +200,7 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
|
|||||||
0xb100),
|
0xb100),
|
||||||
8, NULL, 0);
|
8, NULL, 0);
|
||||||
|
|
||||||
pc_cmos_init(below_4g_mem_size, above_4g_mem_size, boot_device,
|
pc_cmos_init(below_4g_mem_size, above_4g_mem_size, args->boot_device,
|
||||||
floppy, idebus[0], idebus[1], rtc_state);
|
floppy, idebus[0], idebus[1], rtc_state);
|
||||||
|
|
||||||
/* the rest devices to which pci devfn is automatically assigned */
|
/* the rest devices to which pci devfn is automatically assigned */
|
||||||
|
Loading…
Reference in New Issue
Block a user