From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Anthony Liguori" <aliguori@us.ibm.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Andreas Färber" <afaerber@suse.de>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: [Qemu-devel] [PATCH 6/6] pc_piix: Pass QEMUMachineInitArgs to pc_init1()
Date: Tue, 20 Aug 2013 17:49:05 -0300 [thread overview]
Message-ID: <1377031745-3654-7-git-send-email-ehabkost@redhat.com> (raw)
In-Reply-To: <1377031745-3654-1-git-send-email-ehabkost@redhat.com>
This makes the code much simpler.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
hw/i386/pc_piix.c | 47 ++++++++++++-----------------------------------
1 file changed, 12 insertions(+), 35 deletions(-)
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 3e77dfd..decbd61 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -60,17 +60,18 @@ static bool has_pvpanic;
static bool has_pci_info = true;
/* PC hardware initialisation */
-static void pc_init1(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,
+static void pc_init1(QEMUMachineInitArgs *args,
int pci_enabled,
int kvmclock_enabled)
{
MemoryRegion *system_memory = get_system_memory();
MemoryRegion *system_io = get_system_io();
+ 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;
int i;
ram_addr_t below_4g_mem_size, above_4g_mem_size;
PCIBus *pci_bus;
@@ -236,15 +237,7 @@ static void pc_init1(ram_addr_t ram_size,
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(ram_size, boot_device,
- kernel_filename, kernel_cmdline,
- initrd_filename, cpu_model, 1, 1);
+ pc_init1(args, 1, 1);
}
static void pc_compat_1_6(QEMUMachineInitArgs *args)
@@ -313,36 +306,20 @@ static void pc_init_pci_1_2(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_pci_info = false;
disable_kvm_pv_eoi();
enable_compat_apic_id_mode();
- pc_init1(ram_size, boot_device,
- kernel_filename, kernel_cmdline,
- initrd_filename, cpu_model, 1, 0);
+ pc_init1(args, 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_pci_info = false;
- if (cpu_model == NULL)
- cpu_model = "486";
+ if (args->cpu_model == NULL)
+ args->cpu_model = "486";
disable_kvm_pv_eoi();
enable_compat_apic_id_mode();
- pc_init1(ram_size, boot_device,
- kernel_filename, kernel_cmdline,
- initrd_filename, cpu_model, 0, 1);
+ pc_init1(args, 0, 1);
}
#ifdef CONFIG_XEN
--
1.8.3.1
next prev parent reply other threads:[~2013-08-20 20:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-20 20:48 [Qemu-devel] [PATCH 0/6] pc init & compat function cleanup Eduardo Habkost
2013-08-20 20:49 ` [Qemu-devel] [PATCH 1/6] pc: cleanup 1.4 compat support Eduardo Habkost
2013-08-20 20:49 ` [Qemu-devel] [PATCH 2/6] pc: Kill pc_init_pci_1_0() Eduardo Habkost
2013-08-20 20:49 ` [Qemu-devel] [PATCH 3/6] pc: Create pc_compat_*() functions Eduardo Habkost
2013-08-20 20:49 ` [Qemu-devel] [PATCH 4/6] pc: pc_compat_1_4() now can call pc_compat_1_5() Eduardo Habkost
2013-08-20 20:49 ` [Qemu-devel] [PATCH 5/6] pc_piix: Kill pc_init1() memory region args Eduardo Habkost
2013-08-20 20:49 ` Eduardo Habkost [this message]
2013-08-21 13:11 ` [Qemu-devel] [PATCH 6/6] pc_piix: Pass QEMUMachineInitArgs to pc_init1() Markus Armbruster
2013-08-21 13:33 ` Eduardo Habkost
2013-08-20 21:12 ` [Qemu-devel] [PATCH 0/6] pc init & compat function cleanup Michael S. Tsirkin
2013-08-20 21:20 ` Michael S. Tsirkin
2013-08-21 12:30 ` Eduardo Habkost
2013-08-21 12:41 ` Michael S. Tsirkin
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=1377031745-3654-7-git-send-email-ehabkost@redhat.com \
--to=ehabkost@redhat.com \
--cc=afaerber@suse.de \
--cc=aliguori@us.ibm.com \
--cc=kraxel@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@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).