qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/6] pc init & compat function cleanup
@ 2013-08-20 20:48 Eduardo Habkost
  2013-08-20 20:49 ` [Qemu-devel] [PATCH 1/6] pc: cleanup 1.4 compat support Eduardo Habkost
                   ` (7 more replies)
  0 siblings, 8 replies; 13+ messages in thread
From: Eduardo Habkost @ 2013-08-20 20:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Anthony Liguori, Gerd Hoffmann,
	Andreas Färber, Michael S. Tsirkin

This is a follow-up to the patch submitted by Michael (patch 1/6 in this
series), to make the pc compat initialization code simpler and easier to
eventually remove code duplication between pc_piix.c and pc_q35.c.

Eduardo Habkost (5):
  pc: Kill pc_init_pci_1_0()
  pc: Create pc_compat_*() functions
  pc: pc_compat_1_4() now can call pc_compat_1_5()
  pc_piix: Kill pc_init1() memory region args
  pc_piix: Pass QEMUMachineInitArgs to pc_init1()

Michael S. Tsirkin (1):
  pc: cleanup 1.4 compat support

 hw/i386/pc_piix.c | 117 ++++++++++++++++++++++++++----------------------------
 hw/i386/pc_q35.c  |  29 +++++++++++---
 2 files changed, 79 insertions(+), 67 deletions(-)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Qemu-devel] [PATCH 1/6] pc: cleanup 1.4 compat support
  2013-08-20 20:48 [Qemu-devel] [PATCH 0/6] pc init & compat function cleanup Eduardo Habkost
@ 2013-08-20 20:49 ` Eduardo Habkost
  2013-08-20 20:49 ` [Qemu-devel] [PATCH 2/6] pc: Kill pc_init_pci_1_0() Eduardo Habkost
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Eduardo Habkost @ 2013-08-20 20:49 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Anthony Liguori, Gerd Hoffmann,
	Andreas Färber, Michael S. Tsirkin

From: "Michael S. Tsirkin" <mst@redhat.com>

Make 1.4 compat code call the 1.6 one, reducing
code duplication. Add comment explaining why we can't
make 1.4 call 1.5 as usual.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 hw/i386/pc_piix.c | 4 ++--
 hw/i386/pc_q35.c  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 6e1e654..46f1fd7 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -265,8 +265,8 @@ static void pc_init_pci_1_4(QEMUMachineInitArgs *args)
 {
     x86_cpu_compat_set_features("n270", FEAT_1_ECX, 0, CPUID_EXT_MOVBE);
     x86_cpu_compat_set_features("Westmere", FEAT_1_ECX, 0, CPUID_EXT_PCLMULQDQ);
-    has_pci_info = false;
-    pc_init_pci(args);
+    /* 1.5 was special - it enabled pvpanic in builtin machine */
+    pc_init_pci_1_6(args);
 }
 
 static void pc_init_pci_1_3(QEMUMachineInitArgs *args)
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 10e770e..ab0aa70 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -234,8 +234,8 @@ static void pc_q35_init_1_4(QEMUMachineInitArgs *args)
 {
     x86_cpu_compat_set_features("n270", FEAT_1_ECX, 0, CPUID_EXT_MOVBE);
     x86_cpu_compat_set_features("Westmere", FEAT_1_ECX, 0, CPUID_EXT_PCLMULQDQ);
-    has_pci_info = false;
-    pc_q35_init(args);
+    /* 1.5 was special - it enabled pvpanic in builtin machine */
+    pc_q35_init_1_6(args);
 }
 
 static QEMUMachine pc_q35_machine_v1_6 = {
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Qemu-devel] [PATCH 2/6] pc: Kill pc_init_pci_1_0()
  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 ` Eduardo Habkost
  2013-08-20 20:49 ` [Qemu-devel] [PATCH 3/6] pc: Create pc_compat_*() functions Eduardo Habkost
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Eduardo Habkost @ 2013-08-20 20:49 UTC (permalink / raw)
  To: qemu-devel
  Cc: Anthony Liguori, Michael S. Tsirkin, Markus Armbruster,
	Gerd Hoffmann, Paolo Bonzini, Andreas Färber

The pc_init_pci_1_2()/pc_init_pci_1_0() split was made on commit
6fd028f64f662c801fd5a54d0e3a1d2baeee93ea, in preparation for commit
9953f8822cc316eec9962f0a2858c3439a80adec. The latter was reverted, so there's
no reason to keep two separate functions that do exactly the same, anymore.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
---
 hw/i386/pc_piix.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 46f1fd7..17f0daa 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -275,19 +275,13 @@ static void pc_init_pci_1_3(QEMUMachineInitArgs *args)
     pc_init_pci_1_4(args);
 }
 
-/* PC machine init function for pc-1.1 to pc-1.2 */
+/* PC machine init function for pc-0.14 to pc-1.2 */
 static void pc_init_pci_1_2(QEMUMachineInitArgs *args)
 {
     disable_kvm_pv_eoi();
     pc_init_pci_1_3(args);
 }
 
-/* PC machine init function for pc-0.14 to pc-1.0 */
-static void pc_init_pci_1_0(QEMUMachineInitArgs *args)
-{
-    pc_init_pci_1_2(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)
 {
@@ -516,7 +510,7 @@ static QEMUMachine pc_machine_v1_1 = {
 static QEMUMachine pc_machine_v1_0 = {
     .name = "pc-1.0",
     .desc = "Standard PC",
-    .init = pc_init_pci_1_0,
+    .init = pc_init_pci_1_2,
     .max_cpus = 255,
     .compat_props = (GlobalProperty[]) {
         PC_COMPAT_1_0,
@@ -532,7 +526,7 @@ static QEMUMachine pc_machine_v1_0 = {
 static QEMUMachine pc_machine_v0_15 = {
     .name = "pc-0.15",
     .desc = "Standard PC",
-    .init = pc_init_pci_1_0,
+    .init = pc_init_pci_1_2,
     .max_cpus = 255,
     .compat_props = (GlobalProperty[]) {
         PC_COMPAT_0_15,
@@ -565,7 +559,7 @@ static QEMUMachine pc_machine_v0_15 = {
 static QEMUMachine pc_machine_v0_14 = {
     .name = "pc-0.14",
     .desc = "Standard PC",
-    .init = pc_init_pci_1_0,
+    .init = pc_init_pci_1_2,
     .max_cpus = 255,
     .compat_props = (GlobalProperty[]) {
         PC_COMPAT_0_14, 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Qemu-devel] [PATCH 3/6] pc: Create pc_compat_*() functions
  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 ` 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
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Eduardo Habkost @ 2013-08-20 20:49 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Anthony Liguori, Gerd Hoffmann,
	Andreas Färber, Michael S. Tsirkin

Making the older compat functions call the newer compat functions at the
beginning allows the older functions undo what's done by newer compat
functions. e.g.: pc_compat_1_4() will be able to call pc_compat_1_5()
and then set has_pvpanic=false.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 hw/i386/pc_piix.c | 52 +++++++++++++++++++++++++++++++++++++++++-----------
 hw/i386/pc_q35.c  | 31 ++++++++++++++++++++++++-------
 2 files changed, 65 insertions(+), 18 deletions(-)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 17f0daa..22d1204 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -249,37 +249,67 @@ static void pc_init_pci(QEMUMachineInitArgs *args)
              initrd_filename, cpu_model, 1, 1);
 }
 
-static void pc_init_pci_1_6(QEMUMachineInitArgs *args)
+static void pc_compat_1_6(QEMUMachineInitArgs *args)
 {
     has_pci_info = false;
-    pc_init_pci(args);
 }
 
-static void pc_init_pci_1_5(QEMUMachineInitArgs *args)
+static void pc_compat_1_5(QEMUMachineInitArgs *args)
 {
+    pc_compat_1_6(args);
     has_pvpanic = true;
-    pc_init_pci_1_6(args);
 }
 
-static void pc_init_pci_1_4(QEMUMachineInitArgs *args)
+static void pc_compat_1_4(QEMUMachineInitArgs *args)
 {
+    /* 1.5 was special - it enabled pvpanic in builtin machine */
+    pc_compat_1_6(args);
     x86_cpu_compat_set_features("n270", FEAT_1_ECX, 0, CPUID_EXT_MOVBE);
     x86_cpu_compat_set_features("Westmere", FEAT_1_ECX, 0, CPUID_EXT_PCLMULQDQ);
-    /* 1.5 was special - it enabled pvpanic in builtin machine */
-    pc_init_pci_1_6(args);
 }
 
-static void pc_init_pci_1_3(QEMUMachineInitArgs *args)
+static void pc_compat_1_3(QEMUMachineInitArgs *args)
 {
+    pc_compat_1_4(args);
     enable_compat_apic_id_mode();
-    pc_init_pci_1_4(args);
+}
+
+/* PC compat function for pc-0.14 to pc-1.2 */
+static void pc_compat_1_2(QEMUMachineInitArgs *args)
+{
+    pc_compat_1_3(args);
+    disable_kvm_pv_eoi();
+}
+
+static void pc_init_pci_1_6(QEMUMachineInitArgs *args)
+{
+    pc_compat_1_6(args);
+    pc_init_pci(args);
+}
+
+static void pc_init_pci_1_5(QEMUMachineInitArgs *args)
+{
+    pc_compat_1_5(args);
+    pc_init_pci(args);
+}
+
+static void pc_init_pci_1_4(QEMUMachineInitArgs *args)
+{
+    pc_compat_1_4(args);
+    pc_init_pci(args);
+}
+
+static void pc_init_pci_1_3(QEMUMachineInitArgs *args)
+{
+    pc_compat_1_3(args);
+    pc_init_pci(args);
 }
 
 /* PC machine init function for pc-0.14 to pc-1.2 */
 static void pc_init_pci_1_2(QEMUMachineInitArgs *args)
 {
-    disable_kvm_pv_eoi();
-    pc_init_pci_1_3(args);
+    pc_compat_1_2(args);
+    pc_init_pci(args);
 }
 
 /* PC init function for pc-0.10 to pc-0.13, and reused by xenfv */
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index ab0aa70..e29bf86 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -218,24 +218,41 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
     }
 }
 
-static void pc_q35_init_1_6(QEMUMachineInitArgs *args)
+static void pc_compat_1_6(QEMUMachineInitArgs *args)
 {
     has_pci_info = false;
-    pc_q35_init(args);
 }
 
-static void pc_q35_init_1_5(QEMUMachineInitArgs *args)
+static void pc_compat_1_5(QEMUMachineInitArgs *args)
 {
+    pc_compat_1_6(args);
     has_pvpanic = true;
-    pc_q35_init_1_6(args);
 }
 
-static void pc_q35_init_1_4(QEMUMachineInitArgs *args)
+static void pc_compat_1_4(QEMUMachineInitArgs *args)
 {
+    /* 1.5 was special - it enabled pvpanic in builtin machine */
+    pc_compat_1_6(args);
     x86_cpu_compat_set_features("n270", FEAT_1_ECX, 0, CPUID_EXT_MOVBE);
     x86_cpu_compat_set_features("Westmere", FEAT_1_ECX, 0, CPUID_EXT_PCLMULQDQ);
-    /* 1.5 was special - it enabled pvpanic in builtin machine */
-    pc_q35_init_1_6(args);
+}
+
+static void pc_q35_init_1_6(QEMUMachineInitArgs *args)
+{
+    pc_compat_1_6(args);
+    pc_q35_init(args);
+}
+
+static void pc_q35_init_1_5(QEMUMachineInitArgs *args)
+{
+    pc_compat_1_5(args);
+    pc_q35_init(args);
+}
+
+static void pc_q35_init_1_4(QEMUMachineInitArgs *args)
+{
+    pc_compat_1_4(args);
+    pc_q35_init(args);
 }
 
 static QEMUMachine pc_q35_machine_v1_6 = {
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Qemu-devel] [PATCH 4/6] pc: pc_compat_1_4() now can call pc_compat_1_5()
  2013-08-20 20:48 [Qemu-devel] [PATCH 0/6] pc init & compat function cleanup Eduardo Habkost
                   ` (2 preceding siblings ...)
  2013-08-20 20:49 ` [Qemu-devel] [PATCH 3/6] pc: Create pc_compat_*() functions Eduardo Habkost
@ 2013-08-20 20:49 ` Eduardo Habkost
  2013-08-20 20:49 ` [Qemu-devel] [PATCH 5/6] pc_piix: Kill pc_init1() memory region args Eduardo Habkost
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Eduardo Habkost @ 2013-08-20 20:49 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Anthony Liguori, Gerd Hoffmann,
	Andreas Färber, Michael S. Tsirkin

It just needs to set has_pvpanic=false after calling it. This way, it
won't be a special case anymore.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 hw/i386/pc_piix.c | 4 ++--
 hw/i386/pc_q35.c  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 22d1204..e0d2b5f 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -262,8 +262,8 @@ static void pc_compat_1_5(QEMUMachineInitArgs *args)
 
 static void pc_compat_1_4(QEMUMachineInitArgs *args)
 {
-    /* 1.5 was special - it enabled pvpanic in builtin machine */
-    pc_compat_1_6(args);
+    pc_compat_1_5(args);
+    has_pvpanic = false;
     x86_cpu_compat_set_features("n270", FEAT_1_ECX, 0, CPUID_EXT_MOVBE);
     x86_cpu_compat_set_features("Westmere", FEAT_1_ECX, 0, CPUID_EXT_PCLMULQDQ);
 }
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index e29bf86..c2bb3ec 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -231,8 +231,8 @@ static void pc_compat_1_5(QEMUMachineInitArgs *args)
 
 static void pc_compat_1_4(QEMUMachineInitArgs *args)
 {
-    /* 1.5 was special - it enabled pvpanic in builtin machine */
-    pc_compat_1_6(args);
+    pc_compat_1_5(args);
+    has_pvpanic = false;
     x86_cpu_compat_set_features("n270", FEAT_1_ECX, 0, CPUID_EXT_MOVBE);
     x86_cpu_compat_set_features("Westmere", FEAT_1_ECX, 0, CPUID_EXT_PCLMULQDQ);
 }
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Qemu-devel] [PATCH 5/6] pc_piix: Kill pc_init1() memory region args
  2013-08-20 20:48 [Qemu-devel] [PATCH 0/6] pc init & compat function cleanup Eduardo Habkost
                   ` (3 preceding siblings ...)
  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 ` Eduardo Habkost
  2013-08-20 20:49 ` [Qemu-devel] [PATCH 6/6] pc_piix: Pass QEMUMachineInitArgs to pc_init1() Eduardo Habkost
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Eduardo Habkost @ 2013-08-20 20:49 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Anthony Liguori, Gerd Hoffmann,
	Andreas Färber, Michael S. Tsirkin

All callers always use the same values (get_system_memory(),
get_system_io()), so the parameters are pointless.

If one day we decide to eliminate get_system_memory() and
get_system_io(), we will be able to do that more easily by adding the
values to struct QEMUMachineInitArgs.

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

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index e0d2b5f..3e77dfd 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -60,9 +60,7 @@ static bool has_pvpanic;
 static bool has_pci_info = true;
 
 /* PC hardware initialisation */
-static void pc_init1(MemoryRegion *system_memory,
-                     MemoryRegion *system_io,
-                     ram_addr_t ram_size,
+static void pc_init1(ram_addr_t ram_size,
                      const char *boot_device,
                      const char *kernel_filename,
                      const char *kernel_cmdline,
@@ -71,6 +69,8 @@ static void pc_init1(MemoryRegion *system_memory,
                      int pci_enabled,
                      int kvmclock_enabled)
 {
+    MemoryRegion *system_memory = get_system_memory();
+    MemoryRegion *system_io = get_system_io();
     int i;
     ram_addr_t below_4g_mem_size, above_4g_mem_size;
     PCIBus *pci_bus;
@@ -242,9 +242,7 @@ static void pc_init_pci(QEMUMachineInitArgs *args)
     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,
+    pc_init1(ram_size, boot_device,
              kernel_filename, kernel_cmdline,
              initrd_filename, cpu_model, 1, 1);
 }
@@ -324,9 +322,7 @@ static void pc_init_pci_no_kvmclock(QEMUMachineInitArgs *args)
     has_pci_info = false;
     disable_kvm_pv_eoi();
     enable_compat_apic_id_mode();
-    pc_init1(get_system_memory(),
-             get_system_io(),
-             ram_size, boot_device,
+    pc_init1(ram_size, boot_device,
              kernel_filename, kernel_cmdline,
              initrd_filename, cpu_model, 1, 0);
 }
@@ -344,9 +340,7 @@ static void pc_init_isa(QEMUMachineInitArgs *args)
         cpu_model = "486";
     disable_kvm_pv_eoi();
     enable_compat_apic_id_mode();
-    pc_init1(get_system_memory(),
-             get_system_io(),
-             ram_size, boot_device,
+    pc_init1(ram_size, boot_device,
              kernel_filename, kernel_cmdline,
              initrd_filename, cpu_model, 0, 1);
 }
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Qemu-devel] [PATCH 6/6] pc_piix: Pass QEMUMachineInitArgs to pc_init1()
  2013-08-20 20:48 [Qemu-devel] [PATCH 0/6] pc init & compat function cleanup Eduardo Habkost
                   ` (4 preceding siblings ...)
  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
  2013-08-21 13:11   ` Markus Armbruster
  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
  7 siblings, 1 reply; 13+ messages in thread
From: Eduardo Habkost @ 2013-08-20 20:49 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Anthony Liguori, Gerd Hoffmann,
	Andreas Färber, Michael S. Tsirkin

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

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [Qemu-devel] [PATCH 0/6] pc init & compat function cleanup
  2013-08-20 20:48 [Qemu-devel] [PATCH 0/6] pc init & compat function cleanup Eduardo Habkost
                   ` (5 preceding siblings ...)
  2013-08-20 20:49 ` [Qemu-devel] [PATCH 6/6] pc_piix: Pass QEMUMachineInitArgs to pc_init1() Eduardo Habkost
@ 2013-08-20 21:12 ` Michael S. Tsirkin
  2013-08-20 21:20 ` Michael S. Tsirkin
  7 siblings, 0 replies; 13+ messages in thread
From: Michael S. Tsirkin @ 2013-08-20 21:12 UTC (permalink / raw)
  To: Eduardo Habkost
  Cc: Paolo Bonzini, Anthony Liguori, Gerd Hoffmann, qemu-devel,
	Andreas Färber

On Tue, Aug 20, 2013 at 05:48:59PM -0300, Eduardo Habkost wrote:
> This is a follow-up to the patch submitted by Michael (patch 1/6 in this
> series), to make the pc compat initialization code simpler and easier to
> eventually remove code duplication between pc_piix.c and pc_q35.c.

OK, patch 1/6 is on my tree (needed for the loader
future proofing thing) so unless someone objects
I'll put this series on my tree as well.

> Eduardo Habkost (5):
>   pc: Kill pc_init_pci_1_0()
>   pc: Create pc_compat_*() functions
>   pc: pc_compat_1_4() now can call pc_compat_1_5()
>   pc_piix: Kill pc_init1() memory region args
>   pc_piix: Pass QEMUMachineInitArgs to pc_init1()
> 
> Michael S. Tsirkin (1):
>   pc: cleanup 1.4 compat support
> 
>  hw/i386/pc_piix.c | 117 ++++++++++++++++++++++++++----------------------------
>  hw/i386/pc_q35.c  |  29 +++++++++++---
>  2 files changed, 79 insertions(+), 67 deletions(-)
> 
> -- 
> 1.8.3.1

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Qemu-devel] [PATCH 0/6] pc init & compat function cleanup
  2013-08-20 20:48 [Qemu-devel] [PATCH 0/6] pc init & compat function cleanup Eduardo Habkost
                   ` (6 preceding siblings ...)
  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
  7 siblings, 1 reply; 13+ messages in thread
From: Michael S. Tsirkin @ 2013-08-20 21:20 UTC (permalink / raw)
  To: Eduardo Habkost
  Cc: Paolo Bonzini, Anthony Liguori, Gerd Hoffmann, qemu-devel,
	Andreas Färber

On Tue, Aug 20, 2013 at 05:48:59PM -0300, Eduardo Habkost wrote:
> This is a follow-up to the patch submitted by Michael (patch 1/6 in this
> series), to make the pc compat initialization code simpler and easier to
> eventually remove code duplication between pc_piix.c and pc_q35.c.

Eduardo this does not seem to apply to either master or my tree.
Could you rebase and make it apply to my tree?
git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git  pci

> Eduardo Habkost (5):
>   pc: Kill pc_init_pci_1_0()
>   pc: Create pc_compat_*() functions
>   pc: pc_compat_1_4() now can call pc_compat_1_5()
>   pc_piix: Kill pc_init1() memory region args
>   pc_piix: Pass QEMUMachineInitArgs to pc_init1()
> 
> Michael S. Tsirkin (1):
>   pc: cleanup 1.4 compat support
> 
>  hw/i386/pc_piix.c | 117 ++++++++++++++++++++++++++----------------------------
>  hw/i386/pc_q35.c  |  29 +++++++++++---
>  2 files changed, 79 insertions(+), 67 deletions(-)
> 
> -- 
> 1.8.3.1

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Qemu-devel] [PATCH 0/6] pc init & compat function cleanup
  2013-08-20 21:20 ` Michael S. Tsirkin
@ 2013-08-21 12:30   ` Eduardo Habkost
  2013-08-21 12:41     ` Michael S. Tsirkin
  0 siblings, 1 reply; 13+ messages in thread
From: Eduardo Habkost @ 2013-08-21 12:30 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Paolo Bonzini, Anthony Liguori, Gerd Hoffmann, qemu-devel,
	Andreas Färber

On Wed, Aug 21, 2013 at 12:20:32AM +0300, Michael S. Tsirkin wrote:
> On Tue, Aug 20, 2013 at 05:48:59PM -0300, Eduardo Habkost wrote:
> > This is a follow-up to the patch submitted by Michael (patch 1/6 in this
> > series), to make the pc compat initialization code simpler and easier to
> > eventually remove code duplication between pc_piix.c and pc_q35.c.
> 
> Eduardo this does not seem to apply to either master or my tree.
> Could you rebase and make it apply to my tree?
> git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git  pci

For reference, I have used commit
f202039811d8746b0586d2fd5f61de6c8cf68056 as base. I could apply the
series cleanly (copying from my qemu-devel mailbox and not my git tree,
just in case) on top of current master (commit
ecfe10c9a6f9bc77d0e4b7eb5d0f5d61e8fbaed8).

But there are some conflicts with your pci tree, I will make a rebased
version.

> 
> > Eduardo Habkost (5):
> >   pc: Kill pc_init_pci_1_0()
> >   pc: Create pc_compat_*() functions
> >   pc: pc_compat_1_4() now can call pc_compat_1_5()
> >   pc_piix: Kill pc_init1() memory region args
> >   pc_piix: Pass QEMUMachineInitArgs to pc_init1()
> > 
> > Michael S. Tsirkin (1):
> >   pc: cleanup 1.4 compat support
> > 
> >  hw/i386/pc_piix.c | 117 ++++++++++++++++++++++++++----------------------------
> >  hw/i386/pc_q35.c  |  29 +++++++++++---
> >  2 files changed, 79 insertions(+), 67 deletions(-)
> > 
> > -- 
> > 1.8.3.1

-- 
Eduardo

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Qemu-devel] [PATCH 0/6] pc init & compat function cleanup
  2013-08-21 12:30   ` Eduardo Habkost
@ 2013-08-21 12:41     ` Michael S. Tsirkin
  0 siblings, 0 replies; 13+ messages in thread
From: Michael S. Tsirkin @ 2013-08-21 12:41 UTC (permalink / raw)
  To: Eduardo Habkost
  Cc: Paolo Bonzini, Anthony Liguori, Gerd Hoffmann, qemu-devel,
	Andreas Färber

On Wed, Aug 21, 2013 at 09:30:38AM -0300, Eduardo Habkost wrote:
> On Wed, Aug 21, 2013 at 12:20:32AM +0300, Michael S. Tsirkin wrote:
> > On Tue, Aug 20, 2013 at 05:48:59PM -0300, Eduardo Habkost wrote:
> > > This is a follow-up to the patch submitted by Michael (patch 1/6 in this
> > > series), to make the pc compat initialization code simpler and easier to
> > > eventually remove code duplication between pc_piix.c and pc_q35.c.
> > 
> > Eduardo this does not seem to apply to either master or my tree.
> > Could you rebase and make it apply to my tree?
> > git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git  pci
> 
> For reference, I have used commit
> f202039811d8746b0586d2fd5f61de6c8cf68056 as base. I could apply the
> series cleanly (copying from my qemu-devel mailbox and not my git tree,
> just in case) on top of current master (commit
> ecfe10c9a6f9bc77d0e4b7eb5d0f5d61e8fbaed8).

Weird, all I have is:
$ git log --oneline ecfe10c9a6f9bc77d0e4b7eb5d0f5d61e8fbaed8..
4b38e98 q35: Add PCIe switch to example q35 configuration
04920fc loader: store FW CFG ROM files in RAM
0851c9f arch_init: align MR size to target page size
c0b4cc1 pc: cleanup 1.4 compat support


> But there are some conflicts with your pci tree, I will make a rebased
> version.

Pls do.

> > 
> > > Eduardo Habkost (5):
> > >   pc: Kill pc_init_pci_1_0()
> > >   pc: Create pc_compat_*() functions
> > >   pc: pc_compat_1_4() now can call pc_compat_1_5()
> > >   pc_piix: Kill pc_init1() memory region args
> > >   pc_piix: Pass QEMUMachineInitArgs to pc_init1()
> > > 
> > > Michael S. Tsirkin (1):
> > >   pc: cleanup 1.4 compat support
> > > 
> > >  hw/i386/pc_piix.c | 117 ++++++++++++++++++++++++++----------------------------
> > >  hw/i386/pc_q35.c  |  29 +++++++++++---
> > >  2 files changed, 79 insertions(+), 67 deletions(-)
> > > 
> > > -- 
> > > 1.8.3.1
> 
> -- 
> Eduardo

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Qemu-devel] [PATCH 6/6] pc_piix: Pass QEMUMachineInitArgs to pc_init1()
  2013-08-20 20:49 ` [Qemu-devel] [PATCH 6/6] pc_piix: Pass QEMUMachineInitArgs to pc_init1() Eduardo Habkost
@ 2013-08-21 13:11   ` Markus Armbruster
  2013-08-21 13:33     ` Eduardo Habkost
  0 siblings, 1 reply; 13+ messages in thread
From: Markus Armbruster @ 2013-08-21 13:11 UTC (permalink / raw)
  To: Eduardo Habkost
  Cc: Anthony Liguori, Michael S. Tsirkin, qemu-devel, Gerd Hoffmann,
	Paolo Bonzini, Andreas Färber

Eduardo Habkost <ehabkost@redhat.com> writes:

> This makes the code much simpler.
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

Conflicts with my "[PATCH v4 1/6] pc: Don't prematurely explode
QEMUMachineInitArgs".

Which is still awaiting maintainer attention after almost ten weeks,
three rebases, and various Reviewed-by and Acked-by.  Just sayin' :)

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Qemu-devel] [PATCH 6/6] pc_piix: Pass QEMUMachineInitArgs to pc_init1()
  2013-08-21 13:11   ` Markus Armbruster
@ 2013-08-21 13:33     ` Eduardo Habkost
  0 siblings, 0 replies; 13+ messages in thread
From: Eduardo Habkost @ 2013-08-21 13:33 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: Anthony Liguori, Michael S. Tsirkin, qemu-devel, Gerd Hoffmann,
	Paolo Bonzini, Andreas Färber

On Wed, Aug 21, 2013 at 03:11:19PM +0200, Markus Armbruster wrote:
> Eduardo Habkost <ehabkost@redhat.com> writes:
> 
> > This makes the code much simpler.
> >
> > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> 
> Conflicts with my "[PATCH v4 1/6] pc: Don't prematurely explode
> QEMUMachineInitArgs".
> 
> Which is still awaiting maintainer attention after almost ten weeks,
> three rebases, and various Reviewed-by and Acked-by.  Just sayin' :)

Something similar happened to me when I tried to change PC code before.
Most (or all?) times I managed to get PC changes included were when I
was lucky enough to be touching CPU code at the same time, so the
changes were pulled through Andreas' tree.

Now it looks like the changes are going to get through only because they
are going through Michael's pci tree.

It looks like PC changes are getting through only when other maintainers
take care of them. Do we have a PC maintainer?

-- 
Eduardo

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2013-08-21 13:33 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [Qemu-devel] [PATCH 6/6] pc_piix: Pass QEMUMachineInitArgs to pc_init1() Eduardo Habkost
2013-08-21 13:11   ` 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

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).