From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: aliguori@us.ibm.com, agraf@suse.de, blauwirbel@gmail.com,
qemu-ppc@nongnu.org, aviksil@linux.vnet.ibm.com
Subject: [Qemu-devel] [PATCH 1/6] pc: Don't prematurely explode QEMUMachineInitArgs
Date: Fri, 14 Jun 2013 13:40:37 +0200 [thread overview]
Message-ID: <1371210042-15337-2-git-send-email-armbru@redhat.com> (raw)
In-Reply-To: <1371210042-15337-1-git-send-email-armbru@redhat.com>
Don't explode QEMUMachineInitArgs before passing it to pc_init1().
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
hw/i386/pc_piix.c | 59 ++++++++++++-------------------------------------------
1 file changed, 13 insertions(+), 46 deletions(-)
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index d618570..25bd2da 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -59,14 +59,9 @@ static const int ide_irq[MAX_IDE_BUS] = { 14, 15 };
static bool has_pvpanic = true;
/* PC hardware initialisation */
-static void pc_init1(MemoryRegion *system_memory,
+static void pc_init1(QEMUMachineInitArgs *args,
+ MemoryRegion *system_memory,
MemoryRegion *system_io,
- 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,
int pci_enabled,
int kvmclock_enabled)
{
@@ -95,19 +90,19 @@ static void pc_init1(MemoryRegion *system_memory,
object_property_add_child(qdev_get_machine(), "icc-bridge",
OBJECT(icc_bridge), NULL);
- pc_cpus_init(cpu_model, icc_bridge);
+ pc_cpus_init(args->cpu_model, icc_bridge);
pc_acpi_init("acpi-dsdt.aml");
if (kvm_enabled() && kvmclock_enabled) {
kvmclock_create();
}
- if (ram_size >= QEMU_BELOW_4G_RAM_END ) {
- above_4g_mem_size = ram_size - QEMU_BELOW_4G_RAM_END;
+ if (args->ram_size >= QEMU_BELOW_4G_RAM_END) {
+ above_4g_mem_size = args->ram_size - QEMU_BELOW_4G_RAM_END;
below_4g_mem_size = QEMU_BELOW_4G_RAM_END;
} else {
above_4g_mem_size = 0;
- below_4g_mem_size = ram_size;
+ below_4g_mem_size = args->ram_size;
}
if (pci_enabled) {
@@ -122,7 +117,8 @@ static void pc_init1(MemoryRegion *system_memory,
/* allocate ram and load rom/bios */
if (!xen_enabled()) {
fw_cfg = pc_memory_init(system_memory,
- kernel_filename, kernel_cmdline, initrd_filename,
+ args->kernel_filename, args->kernel_cmdline,
+ args->initrd_filename,
below_4g_mem_size, above_4g_mem_size,
rom_memory, &ram_memory);
}
@@ -138,7 +134,7 @@ static void pc_init1(MemoryRegion *system_memory,
if (pci_enabled) {
pci_bus = i440fx_init(&i440fx_state, &piix3_devfn, &isa_bus, gsi,
- system_memory, system_io, ram_size,
+ system_memory, system_io, args->ram_size,
below_4g_mem_size,
0x100000000ULL - below_4g_mem_size,
0x100000000ULL + above_4g_mem_size,
@@ -203,7 +199,7 @@ static void pc_init1(MemoryRegion *system_memory,
}
}
- 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);
if (pci_enabled && usb_enabled(false)) {
@@ -233,17 +229,7 @@ static void pc_init1(MemoryRegion *system_memory,
static void pc_init_pci(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;
- pc_init1(get_system_memory(),
- get_system_io(),
- ram_size, boot_device,
- kernel_filename, kernel_cmdline,
- initrd_filename, cpu_model, 1, 1);
+ pc_init1(args, get_system_memory(), get_system_io(), 1, 1);
}
static void pc_init_pci_1_4(QEMUMachineInitArgs *args)
@@ -281,40 +267,21 @@ static void pc_init_pci_1_0(QEMUMachineInitArgs *args)
/* PC init function for pc-0.10 to pc-0.13, and reused by xenfv */
static void pc_init_pci_no_kvmclock(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;
has_pvpanic = false;
disable_kvm_pv_eoi();
enable_compat_apic_id_mode();
- pc_init1(get_system_memory(),
- get_system_io(),
- ram_size, boot_device,
- kernel_filename, kernel_cmdline,
- initrd_filename, cpu_model, 1, 0);
+ pc_init1(args, get_system_memory(), get_system_io(), 1, 0);
}
static void pc_init_isa(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;
has_pvpanic = false;
if (cpu_model == NULL)
cpu_model = "486";
disable_kvm_pv_eoi();
enable_compat_apic_id_mode();
- pc_init1(get_system_memory(),
- get_system_io(),
- ram_size, boot_device,
- kernel_filename, kernel_cmdline,
- initrd_filename, cpu_model, 0, 1);
+ pc_init1(args, get_system_memory(), get_system_io(), 0, 1);
}
#ifdef CONFIG_XEN
--
1.7.11.7
next prev parent reply other threads:[~2013-06-14 11:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-14 11:40 [Qemu-devel] [PATCH 0/6] Clean up bogus default boot order Markus Armbruster
2013-06-14 11:40 ` Markus Armbruster [this message]
2013-06-14 11:40 ` [Qemu-devel] [PATCH 2/6] pc: Don't explode QEMUMachineInitArgs into local variables needlessly Markus Armbruster
2013-06-14 11:40 ` [Qemu-devel] [PATCH 3/6] sun4: Don't prematurely explode QEMUMachineInitArgs Markus Armbruster
2013-06-14 11:40 ` [Qemu-devel] [PATCH 4/6] ppc: Don't explode QEMUMachineInitArgs into local variables needlessly Markus Armbruster
2013-06-14 11:40 ` [Qemu-devel] [PATCH 5/6] ppc: Don't duplicate QEMUMachineInitArgs in PPCE500Params Markus Armbruster
2013-06-14 11:40 ` [Qemu-devel] [PATCH 6/6] hw: Clean up bogus default boot order Markus Armbruster
2013-06-14 11:49 ` [Qemu-devel] [PATCH 0/6] " Alexander Graf
2013-06-14 12:11 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1371210042-15337-2-git-send-email-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=agraf@suse.de \
--cc=aliguori@us.ibm.com \
--cc=aviksil@linux.vnet.ibm.com \
--cc=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).