|
|
9ae3a8 |
From 5c9aa8edab3724f6a361c98247949d5588f18620 Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Markus Armbruster <armbru@redhat.com>
|
|
|
9ae3a8 |
Date: Sat, 2 Nov 2013 10:01:19 +0100
|
|
|
9ae3a8 |
Subject: [PATCH 19/29] pc: Don't explode QEMUMachineInitArgs into local variables needlessly
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Markus Armbruster <armbru@redhat.com>
|
|
|
9ae3a8 |
Message-id: <1383386488-29789-3-git-send-email-armbru@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 55238
|
|
|
9ae3a8 |
O-Subject: [PATCH 7.0 qemu-kvm 02/11] pc: Don't explode QEMUMachineInitArgs into local variables needlessly
|
|
|
9ae3a8 |
Bugzilla: 994490
|
|
|
9ae3a8 |
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
From: Markus Armbruster <armbru@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Don't explode when the variable is used just a few times, and never
|
|
|
9ae3a8 |
changed.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Markus Armbruster <armbru@redhat.com>
|
|
|
9ae3a8 |
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
9ae3a8 |
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
|
|
9ae3a8 |
(cherry picked from commit 3b6fb9cab2e64804cdab5a61d1298ffd8b8dff85)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Conflicts:
|
|
|
9ae3a8 |
hw/i386/pc_q35.c
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
hw/i386/pc_q35.c | 22 +++++++++-------------
|
|
|
9ae3a8 |
1 file changed, 9 insertions(+), 13 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
hw/i386/pc_q35.c | 22 +++++++++-------------
|
|
|
9ae3a8 |
1 files changed, 9 insertions(+), 13 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
|
|
|
9ae3a8 |
index 1c4c8a4..99d3a10 100644
|
|
|
9ae3a8 |
--- a/hw/i386/pc_q35.c
|
|
|
9ae3a8 |
+++ b/hw/i386/pc_q35.c
|
|
|
9ae3a8 |
@@ -51,12 +51,6 @@ static bool has_pvpanic = true;
|
|
|
9ae3a8 |
/* PC hardware initialisation */
|
|
|
9ae3a8 |
static void pc_q35_init(QEMUMachineInitArgs *args)
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
- ram_addr_t ram_size = args->ram_size;
|
|
|
9ae3a8 |
- const char *cpu_model = args->cpu_model;
|
|
|
9ae3a8 |
- const char *kernel_filename = args->kernel_filename;
|
|
|
9ae3a8 |
- const char *kernel_cmdline = args->kernel_cmdline;
|
|
|
9ae3a8 |
- const char *initrd_filename = args->initrd_filename;
|
|
|
9ae3a8 |
- const char *boot_device = args->boot_device;
|
|
|
9ae3a8 |
ram_addr_t below_4g_mem_size, above_4g_mem_size;
|
|
|
9ae3a8 |
Q35PCIHost *q35_host;
|
|
|
9ae3a8 |
PCIBus *host_bus;
|
|
|
9ae3a8 |
@@ -82,17 +76,17 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
|
|
|
9ae3a8 |
object_property_add_child(qdev_get_machine(), "icc-bridge",
|
|
|
9ae3a8 |
OBJECT(icc_bridge), NULL);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
- pc_cpus_init(cpu_model, icc_bridge);
|
|
|
9ae3a8 |
+ pc_cpus_init(args->cpu_model, icc_bridge);
|
|
|
9ae3a8 |
pc_acpi_init("q35-acpi-dsdt.aml");
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
kvmclock_create();
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
- if (ram_size >= 0xb0000000) {
|
|
|
9ae3a8 |
- above_4g_mem_size = ram_size - 0xb0000000;
|
|
|
9ae3a8 |
+ if (args->ram_size >= 0xb0000000) {
|
|
|
9ae3a8 |
+ above_4g_mem_size = args->ram_size - 0xb0000000;
|
|
|
9ae3a8 |
below_4g_mem_size = 0xb0000000;
|
|
|
9ae3a8 |
} else {
|
|
|
9ae3a8 |
above_4g_mem_size = 0;
|
|
|
9ae3a8 |
- below_4g_mem_size = ram_size;
|
|
|
9ae3a8 |
+ below_4g_mem_size = args->ram_size;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
/* pci enabled */
|
|
|
9ae3a8 |
@@ -107,8 +101,10 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
/* allocate ram and load rom/bios */
|
|
|
9ae3a8 |
if (!xen_enabled()) {
|
|
|
9ae3a8 |
- pc_memory_init(get_system_memory(), kernel_filename, kernel_cmdline,
|
|
|
9ae3a8 |
- initrd_filename, below_4g_mem_size, above_4g_mem_size,
|
|
|
9ae3a8 |
+ pc_memory_init(get_system_memory(),
|
|
|
9ae3a8 |
+ args->kernel_filename, args->kernel_cmdline,
|
|
|
9ae3a8 |
+ args->initrd_filename,
|
|
|
9ae3a8 |
+ below_4g_mem_size, above_4g_mem_size,
|
|
|
9ae3a8 |
rom_memory, &ram_memory);
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -193,7 +189,7 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
|
|
|
9ae3a8 |
0xb100),
|
|
|
9ae3a8 |
8, NULL, 0);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
- pc_cmos_init(below_4g_mem_size, above_4g_mem_size, boot_device,
|
|
|
9ae3a8 |
+ pc_cmos_init(below_4g_mem_size, above_4g_mem_size, args->boot_device,
|
|
|
9ae3a8 |
floppy, idebus[0], idebus[1], rtc_state);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
/* the rest devices to which pci devfn is automatically assigned */
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.7.1
|
|
|
9ae3a8 |
|