qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, jasowang@redhat.com, rth@twiddle.net,
	Alexander Graf <agraf@suse.de>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: [Qemu-devel] [PATCH 08/10] piix: Add kvmclock_enabled, pci_enabled globals
Date: Fri, 15 May 2015 14:18:59 -0300	[thread overview]
Message-ID: <1431710341-24696-9-git-send-email-ehabkost@redhat.com> (raw)
In-Reply-To: <1431710341-24696-1-git-send-email-ehabkost@redhat.com>

This looks like a step backwards, but it will allow pc-0.1[0123] and
isapc to follow the same compat+init pattern used by the other
machine-types, allowing us to generate all init function using the same
macro later.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 hw/i386/pc_piix.c | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 052fca2..cdc0443 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -59,6 +59,7 @@ static const int ide_iobase[MAX_IDE_BUS] = { 0x1f0, 0x170 };
 static const int ide_iobase2[MAX_IDE_BUS] = { 0x3f6, 0x376 };
 static const int ide_irq[MAX_IDE_BUS] = { 14, 15 };
 
+static bool pci_enabled = true;
 static bool has_acpi_build = true;
 static bool rsdp_in_ram = true;
 static int legacy_acpi_table_size;
@@ -71,11 +72,10 @@ static bool smbios_uuid_encoded = true;
  */
 static bool gigabyte_align = true;
 static bool has_reserved_memory = true;
+static bool kvmclock_enabled = true;
 
 /* PC hardware initialisation */
-static void pc_init1(MachineState *machine,
-                     int pci_enabled,
-                     int kvmclock_enabled)
+static void pc_init1(MachineState *machine)
 {
     PCMachineState *pc_machine = PC_MACHINE(machine);
     MemoryRegion *system_memory = get_system_memory();
@@ -307,7 +307,7 @@ static void pc_init1(MachineState *machine,
 
 static void pc_init_pci(MachineState *machine)
 {
-    pc_init1(machine, 1, 1);
+    pc_init1(machine);
 }
 
 static void pc_compat_2_3(MachineState *machine)
@@ -430,6 +430,13 @@ static void pc_init_pci_2_2(MachineState *machine)
     pc_init_pci(machine);
 }
 
+/* PC compat function for pc-0.10 to pc-0.13 */
+static void pc_compat_0_13(MachineState *machine)
+{
+    pc_compat_1_2(machine);
+    kvmclock_enabled = false;
+}
+
 static void pc_init_pci_2_1(MachineState *machine)
 {
     pc_compat_2_1(machine);
@@ -482,12 +489,13 @@ static void pc_init_pci_1_2(MachineState *machine)
 /* PC init function for pc-0.10 to pc-0.13 */
 static void pc_init_pci_no_kvmclock(MachineState *machine)
 {
-    pc_compat_1_2(machine);
-    pc_init1(machine, 1, 0);
+    pc_compat_0_13(machine);
+    pc_init_pci(machine);
 }
 
 static void pc_init_isa(MachineState *machine)
 {
+    pci_enabled = false;
     has_acpi_build = false;
     smbios_defaults = false;
     gigabyte_align = false;
@@ -500,7 +508,7 @@ static void pc_init_isa(MachineState *machine)
     }
     x86_cpu_compat_kvm_no_autoenable(FEAT_KVM, 1 << KVM_FEATURE_PV_EOI);
     enable_compat_apic_id_mode();
-    pc_init1(machine, 0, 1);
+    pc_init1(machine);
 }
 
 #ifdef CONFIG_XEN
-- 
2.1.0

  parent reply	other threads:[~2015-05-15 17:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-15 17:18 [Qemu-devel] [PATCH 00/10] pc: Don't use QEMUMachine, simplify compat+init code Eduardo Habkost
2015-05-15 17:18 ` [Qemu-devel] [PATCH 01/10] pc: Define MACHINE_OPTIONS macros consistently for all machines Eduardo Habkost
2015-05-15 17:18 ` [Qemu-devel] [PATCH 02/10] pc: Define machines using a DEFINE_PC_MACHINE macro Eduardo Habkost
2015-05-15 17:18 ` [Qemu-devel] [PATCH 03/10] pc: Convert *_MACHINE_OPTIONS macros into functions Eduardo Habkost
2015-05-15 17:18 ` [Qemu-devel] [PATCH 04/10] pc: Move compat_props setting inside *_machine_options() functions Eduardo Habkost
2015-05-15 17:18 ` [Qemu-devel] [PATCH 05/10] pc: Don't use QEMUMachine anymore Eduardo Habkost
2015-05-15 17:18 ` [Qemu-devel] [PATCH 06/10] pc: Remove qemu_register_pc_machine() function Eduardo Habkost
2015-05-15 17:18 ` [Qemu-devel] [PATCH 07/10] machine: Remove unused fields from QEMUMachine Eduardo Habkost
2015-05-15 17:18 ` Eduardo Habkost [this message]
2015-05-15 17:19 ` [Qemu-devel] [PATCH 09/10] piix: Eliminate pc_init_pci() Eduardo Habkost
2015-05-15 17:19 ` [Qemu-devel] [PATCH 10/10] pc: Generate init functions with a macro Eduardo Habkost

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=1431710341-24696-9-git-send-email-ehabkost@redhat.com \
    --to=ehabkost@redhat.com \
    --cc=agraf@suse.de \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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).