[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH 11/14] pc: pass QEMUMachineInitArgs to pc_memory
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [RFC PATCH 11/14] pc: pass QEMUMachineInitArgs to pc_memory_init |
Date: |
Wed, 11 Dec 2013 13:19:18 +0100 |
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/i386/pc.c | 11 +++++------
hw/i386/pc_piix.c | 8 +++-----
hw/i386/pc_q35.c | 4 +---
include/hw/i386/pc.h | 7 +++----
4 files changed, 12 insertions(+), 18 deletions(-)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 74c1f16..76c47a9 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1148,10 +1148,8 @@ void pc_acpi_init(const char *default_dsdt)
}
}
-FWCfgState *pc_memory_init(MemoryRegion *system_memory,
- const char *kernel_filename,
- const char *kernel_cmdline,
- const char *initrd_filename,
+FWCfgState *pc_memory_init(QEMUMachineInitArgs *args,
+ MemoryRegion *system_memory,
ram_addr_t below_4g_mem_size,
ram_addr_t above_4g_mem_size,
MemoryRegion *rom_memory,
@@ -1163,7 +1161,7 @@ FWCfgState *pc_memory_init(MemoryRegion *system_memory,
MemoryRegion *ram_below_4g, *ram_above_4g;
FWCfgState *fw_cfg;
- linux_boot = (kernel_filename != NULL);
+ linux_boot = (args->kernel_filename != NULL);
/* Allocate RAM. We allocate it as a single memory region and use
* aliases to address portions of it, mostly for backwards compatibility
@@ -1204,7 +1202,8 @@ FWCfgState *pc_memory_init(MemoryRegion *system_memory,
rom_set_fw(fw_cfg);
if (linux_boot) {
- load_linux(fw_cfg, kernel_filename, initrd_filename, kernel_cmdline,
below_4g_mem_size);
+ load_linux(fw_cfg, args->kernel_filename, args->initrd_filename,
+ args->kernel_cmdline, below_4g_mem_size);
}
for (i = 0; i < nb_option_roms; i++) {
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index ab56285..cd3eda1 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -130,11 +130,9 @@ static void pc_init1(QEMUMachineInitArgs *args,
/* allocate ram and load rom/bios */
if (!xen_enabled()) {
- fw_cfg = pc_memory_init(system_memory,
- args->kernel_filename, args->kernel_cmdline,
- args->initrd_filename,
- below_4g_mem_size, above_4g_mem_size,
- rom_memory, &ram_memory, guest_info);
+ fw_cfg = pc_memory_init(args, system_memory,
+ below_4g_mem_size, above_4g_mem_size,
+ rom_memory, &ram_memory, guest_info);
}
gsi_state = g_malloc0(sizeof(*gsi_state));
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 97aa842..c2dcbae 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -115,9 +115,7 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
/* allocate ram and load rom/bios */
if (!xen_enabled()) {
- pc_memory_init(get_system_memory(),
- args->kernel_filename, args->kernel_cmdline,
- args->initrd_filename,
+ pc_memory_init(args, get_system_memory(),
below_4g_mem_size, above_4g_mem_size,
rom_memory, &ram_memory, guest_info);
}
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 09652fb..7dda9a6 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -3,6 +3,7 @@
#include "qemu-common.h"
#include "exec/memory.h"
+#include "hw/boards.h"
#include "hw/isa/isa.h"
#include "hw/block/fdc.h"
#include "net/net.h"
@@ -140,10 +141,8 @@ static inline uint64_t pci_host_get_hole64_size(uint64_t
pci_hole64_size)
void pc_init_pci64_hole(PcPciInfo *pci_info, uint64_t pci_hole64_start,
uint64_t pci_hole64_size);
-FWCfgState *pc_memory_init(MemoryRegion *system_memory,
- const char *kernel_filename,
- const char *kernel_cmdline,
- const char *initrd_filename,
+FWCfgState *pc_memory_init(QEMUMachineInitArgs *args,
+ MemoryRegion *system_memory,
ram_addr_t below_4g_mem_size,
ram_addr_t above_4g_mem_size,
MemoryRegion *rom_memory,
--
1.8.4.2
- Re: [Qemu-devel] [RFC PATCH 04/14] NUMA: convert -numa option to use OptsVisitor, (continued)
- [Qemu-devel] [RFC PATCH 05/14] NUMA: expand MAX_NODES from 64 to 128, Paolo Bonzini, 2013/12/11
- [Qemu-devel] [RFC PATCH 06/14] qapi: add SIZE type parser to string_input_visitor, Paolo Bonzini, 2013/12/11
- [Qemu-devel] [RFC PATCH 07/14] QemuOpts: introduce qemu_find_opts_singleton, Paolo Bonzini, 2013/12/11
- [Qemu-devel] [RFC PATCH 08/14] vl: convert -m to QemuOpts, Paolo Bonzini, 2013/12/11
- [Qemu-devel] [RFC PATCH 09/14] qom: fix leak for objects created with -object, Paolo Bonzini, 2013/12/11
- [Qemu-devel] [RFC PATCH 10/14] qom: catch errors in object_property_add_child, Paolo Bonzini, 2013/12/11
- [Qemu-devel] [RFC PATCH 11/14] pc: pass QEMUMachineInitArgs to pc_memory_init,
Paolo Bonzini <=
- [Qemu-devel] [RFC PATCH 12/14] numa: introduce memory_region_allocate_system_memory, Paolo Bonzini, 2013/12/11
- [Qemu-devel] [RFC PATCH 13/14] add memdev backend infrastructure, Paolo Bonzini, 2013/12/11
- [Qemu-devel] [RFC PATCH 14/14] numa: add -numa node, memdev= option, Paolo Bonzini, 2013/12/11