All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/18] hw: Clean up hw/i386 headers (and few alpha/hppa)
@ 2020-02-28 11:46 Philippe Mathieu-Daudé
  2020-02-28 11:46 ` [PATCH v2 01/18] vl: Add missing "hw/boards.h" include Philippe Mathieu-Daudé
                   ` (19 more replies)
  0 siblings, 20 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-28 11:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Paolo Bonzini, Philippe Mathieu-Daudé,
	Michael S. Tsirkin

[Rebased since v1]:
https://www.mail-archive.com/qemu-block@nongnu.org/msg57485.html

This is a follow-up of Markus's cleanup series:
Tame a few "touch this, recompile the world"
https://www.mail-archive.com/qemu-devel@nongnu.org/msg635748.html

This part is mostly restricted to X86, but since some file from the
Alpha/PA-RISC machines include "hw/i386/pc.h" I had to fix them
too.

Eventually I'll succeed at removing hw/i386/ dependency on non-X86
platforms (Quest I started 2 years ago...).

Regards,

Phil.

Philippe Mathieu-Daudé (18):
  vl: Add missing "hw/boards.h" include
  hw/southbridge/ich9: Removed unused headers
  hw/i386/ioapic_internal: Remove unused "hw/i386/ioapic.h" header
  hw/timer: Remove unused "ui/console.h" header
  hw/usb/dev-storage: Remove unused "ui/console.h" header
  hw/i386/intel_iommu: Remove unused includes
  hw/alpha/alpha_sys: Remove unused "hw/ide.h" header
  hw/alpha/dp264: Include "net/net.h"
  hw/hppa/machine: Include "net/net.h"
  hw/acpi/cpu_hotplug: Include "hw/pci/pci.h"
  hw/timer/hpet: Include "exec/address-spaces.h"
  hw/pci-host/q35: Include "qemu/range.h"
  hw/i2c/smbus_ich9: Include "qemu/range.h"
  hw/pci-host/piix: Include "qemu/range.h"
  hw/acpi: Include "hw/mem/nvdimm.h"
  hw/i386: Include "hw/mem/nvdimm.h"
  hw/pci-host/q35: Remove unused includes
  hw/i386/pc: Clean up includes

 hw/alpha/alpha_sys.h              |  1 -
 include/hw/i386/ich9.h            |  1 -
 include/hw/i386/intel_iommu.h     |  4 ----
 include/hw/i386/ioapic_internal.h |  1 -
 include/hw/i386/pc.h              | 11 +++--------
 include/hw/pci-host/q35.h         |  8 +-------
 hw/acpi/cpu_hotplug.c             |  1 +
 hw/acpi/ich9.c                    |  2 +-
 hw/acpi/piix4.c                   |  1 +
 hw/alpha/dp264.c                  |  1 +
 hw/hppa/machine.c                 |  1 +
 hw/i2c/smbus_ich9.c               |  1 +
 hw/i386/acpi-build.c              |  1 +
 hw/i386/pc.c                      |  1 +
 hw/i386/pc_piix.c                 |  1 +
 hw/i386/pc_q35.c                  |  1 +
 hw/isa/lpc_ich9.c                 |  1 -
 hw/pci-host/i440fx.c              |  1 +
 hw/pci-host/q35.c                 |  1 +
 hw/rtc/twl92230.c                 |  1 -
 hw/timer/hpet.c                   |  2 +-
 hw/usb/dev-storage.c              |  1 -
 softmmu/vl.c                      |  1 +
 23 files changed, 18 insertions(+), 27 deletions(-)

-- 
2.21.1



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

* [PATCH v2 01/18] vl: Add missing "hw/boards.h" include
  2020-02-28 11:46 [PATCH v2 00/18] hw: Clean up hw/i386 headers (and few alpha/hppa) Philippe Mathieu-Daudé
@ 2020-02-28 11:46 ` Philippe Mathieu-Daudé
  2020-02-28 11:46 ` [PATCH v2 02/18] hw/southbridge/ich9: Removed unused headers Philippe Mathieu-Daudé
                   ` (18 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-28 11:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Paolo Bonzini, John Snow,
	Philippe Mathieu-Daudé,
	Michael S. Tsirkin

vl.c calls machine_usb() declared in "hw/boards.h". Include it.

This fixes (when modifying unrelated headers):

  vl.c:1283:10: error: implicit declaration of function 'machine_usb' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
      if (!machine_usb(current_machine)) {
           ^
  vl.c:1283:10: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
  vl.c:1283:22: error: use of undeclared identifier 'current_machine'
      if (!machine_usb(current_machine)) {
                       ^

Acked-by: John Snow <jsnow@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 softmmu/vl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/softmmu/vl.c b/softmmu/vl.c
index 16ff5a16a3..20b7201451 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -25,6 +25,7 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/units.h"
+#include "hw/boards.h"
 #include "hw/qdev-properties.h"
 #include "qapi/error.h"
 #include "qemu-version.h"
-- 
2.21.1



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

* [PATCH v2 02/18] hw/southbridge/ich9: Removed unused headers
  2020-02-28 11:46 [PATCH v2 00/18] hw: Clean up hw/i386 headers (and few alpha/hppa) Philippe Mathieu-Daudé
  2020-02-28 11:46 ` [PATCH v2 01/18] vl: Add missing "hw/boards.h" include Philippe Mathieu-Daudé
@ 2020-02-28 11:46 ` Philippe Mathieu-Daudé
  2020-02-28 11:46 ` [PATCH v2 03/18] hw/i386/ioapic_internal: Remove unused "hw/i386/ioapic.h" header Philippe Mathieu-Daudé
                   ` (17 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-28 11:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, qemu-trivial, Philippe Mathieu-Daudé,
	Igor Mammedov, Paolo Bonzini, John Snow

The ICH9 chipset is not X86/PC specific.

These files don't use anything declared by the "hw/i386/pc.h"
or "hw/i386/ioapic.h" headers. Remove them.

Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 include/hw/i386/ich9.h | 1 -
 hw/acpi/ich9.c         | 1 -
 hw/isa/lpc_ich9.c      | 1 -
 3 files changed, 3 deletions(-)

diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h
index 72e803f6e2..a98d10b252 100644
--- a/include/hw/i386/ich9.h
+++ b/include/hw/i386/ich9.h
@@ -5,7 +5,6 @@
 #include "hw/sysbus.h"
 #include "hw/i386/pc.h"
 #include "hw/isa/apm.h"
-#include "hw/i386/ioapic.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pcie_host.h"
 #include "hw/pci/pci_bridge.h"
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index 2034dd749e..fdd0a6c79e 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -27,7 +27,6 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qapi/visitor.h"
-#include "hw/i386/pc.h"
 #include "hw/pci/pci.h"
 #include "migration/vmstate.h"
 #include "qemu/timer.h"
diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c
index f85b484eac..cb79616ced 100644
--- a/hw/isa/lpc_ich9.c
+++ b/hw/isa/lpc_ich9.c
@@ -37,7 +37,6 @@
 #include "migration/vmstate.h"
 #include "hw/irq.h"
 #include "hw/isa/apm.h"
-#include "hw/i386/ioapic.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_bridge.h"
 #include "hw/i386/ich9.h"
-- 
2.21.1



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

* [PATCH v2 03/18] hw/i386/ioapic_internal: Remove unused "hw/i386/ioapic.h" header
  2020-02-28 11:46 [PATCH v2 00/18] hw: Clean up hw/i386 headers (and few alpha/hppa) Philippe Mathieu-Daudé
  2020-02-28 11:46 ` [PATCH v2 01/18] vl: Add missing "hw/boards.h" include Philippe Mathieu-Daudé
  2020-02-28 11:46 ` [PATCH v2 02/18] hw/southbridge/ich9: Removed unused headers Philippe Mathieu-Daudé
@ 2020-02-28 11:46 ` Philippe Mathieu-Daudé
  2020-02-28 11:46 ` [PATCH v2 04/18] hw/timer: Remove unused "ui/console.h" header Philippe Mathieu-Daudé
                   ` (16 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-28 11:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, qemu-trivial, Philippe Mathieu-Daudé,
	Paolo Bonzini, John Snow

The "ioapic_internal.h" does not use anything from
"hw/i386/ioapic.h", remove it.

Acked-by: John Snow <jsnow@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 include/hw/i386/ioapic_internal.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/hw/i386/ioapic_internal.h b/include/hw/i386/ioapic_internal.h
index d46c87c510..fe06938bda 100644
--- a/include/hw/i386/ioapic_internal.h
+++ b/include/hw/i386/ioapic_internal.h
@@ -23,7 +23,6 @@
 #define QEMU_IOAPIC_INTERNAL_H
 
 #include "exec/memory.h"
-#include "hw/i386/ioapic.h"
 #include "hw/sysbus.h"
 #include "qemu/notify.h"
 
-- 
2.21.1



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

* [PATCH v2 04/18] hw/timer: Remove unused "ui/console.h" header
  2020-02-28 11:46 [PATCH v2 00/18] hw: Clean up hw/i386 headers (and few alpha/hppa) Philippe Mathieu-Daudé
                   ` (2 preceding siblings ...)
  2020-02-28 11:46 ` [PATCH v2 03/18] hw/i386/ioapic_internal: Remove unused "hw/i386/ioapic.h" header Philippe Mathieu-Daudé
@ 2020-02-28 11:46 ` Philippe Mathieu-Daudé
  2020-02-28 11:46 ` [PATCH v2 05/18] hw/usb/dev-storage: " Philippe Mathieu-Daudé
                   ` (15 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-28 11:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Michael S. Tsirkin, qemu-trivial, John Snow,
	Philippe Mathieu-Daudé,
	open list:nSeries, Paolo Bonzini

The timer models don't need anything from "ui/console.h".
Remove it.

Acked-by: John Snow <jsnow@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/rtc/twl92230.c | 1 -
 hw/timer/hpet.c   | 1 -
 2 files changed, 2 deletions(-)

diff --git a/hw/rtc/twl92230.c b/hw/rtc/twl92230.c
index 63bd13d2ca..d0011be89e 100644
--- a/hw/rtc/twl92230.c
+++ b/hw/rtc/twl92230.c
@@ -27,7 +27,6 @@
 #include "migration/qemu-file-types.h"
 #include "migration/vmstate.h"
 #include "sysemu/sysemu.h"
-#include "ui/console.h"
 #include "qemu/bcd.h"
 #include "qemu/module.h"
 
diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c
index 8dbcbdca16..4f30dd50a4 100644
--- a/hw/timer/hpet.c
+++ b/hw/timer/hpet.c
@@ -27,7 +27,6 @@
 #include "qemu/osdep.h"
 #include "hw/i386/pc.h"
 #include "hw/irq.h"
-#include "ui/console.h"
 #include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "qemu/timer.h"
-- 
2.21.1



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

* [PATCH v2 05/18] hw/usb/dev-storage: Remove unused "ui/console.h" header
  2020-02-28 11:46 [PATCH v2 00/18] hw: Clean up hw/i386 headers (and few alpha/hppa) Philippe Mathieu-Daudé
                   ` (3 preceding siblings ...)
  2020-02-28 11:46 ` [PATCH v2 04/18] hw/timer: Remove unused "ui/console.h" header Philippe Mathieu-Daudé
@ 2020-02-28 11:46 ` Philippe Mathieu-Daudé
  2020-02-28 13:19   ` Gerd Hoffmann
  2020-02-28 11:46 ` [PATCH v2 06/18] hw/i386/intel_iommu: Remove unused includes Philippe Mathieu-Daudé
                   ` (14 subsequent siblings)
  19 siblings, 1 reply; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-28 11:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, qemu-trivial, Philippe Mathieu-Daudé,
	Gerd Hoffmann, Paolo Bonzini, John Snow

The USB models related to storage don't need anything from
"ui/console.h". Remove it.

Acked-by: John Snow <jsnow@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/usb/dev-storage.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c
index 90da008df1..4883c1d89e 100644
--- a/hw/usb/dev-storage.c
+++ b/hw/usb/dev-storage.c
@@ -17,7 +17,6 @@
 #include "desc.h"
 #include "hw/qdev-properties.h"
 #include "hw/scsi/scsi.h"
-#include "ui/console.h"
 #include "migration/vmstate.h"
 #include "monitor/monitor.h"
 #include "sysemu/sysemu.h"
-- 
2.21.1



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

* [PATCH v2 06/18] hw/i386/intel_iommu: Remove unused includes
  2020-02-28 11:46 [PATCH v2 00/18] hw: Clean up hw/i386 headers (and few alpha/hppa) Philippe Mathieu-Daudé
                   ` (4 preceding siblings ...)
  2020-02-28 11:46 ` [PATCH v2 05/18] hw/usb/dev-storage: " Philippe Mathieu-Daudé
@ 2020-02-28 11:46 ` Philippe Mathieu-Daudé
  2020-02-28 11:46 ` [PATCH v2 07/18] hw/alpha/alpha_sys: Remove unused "hw/ide.h" header Philippe Mathieu-Daudé
                   ` (13 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-28 11:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, qemu-trivial, Philippe Mathieu-Daudé,
	Paolo Bonzini, John Snow

intel_iommu.h does not use any of these includes, remove them.

Acked-by: John Snow <jsnow@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 include/hw/i386/intel_iommu.h | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/include/hw/i386/intel_iommu.h b/include/hw/i386/intel_iommu.h
index 66b931e526..a1c4afcda5 100644
--- a/include/hw/i386/intel_iommu.h
+++ b/include/hw/i386/intel_iommu.h
@@ -22,11 +22,7 @@
 #ifndef INTEL_IOMMU_H
 #define INTEL_IOMMU_H
 
-#include "sysemu/dma.h"
 #include "hw/i386/x86-iommu.h"
-#include "hw/i386/ioapic.h"
-#include "hw/pci/msi.h"
-#include "hw/sysbus.h"
 #include "qemu/iova-tree.h"
 
 #define TYPE_INTEL_IOMMU_DEVICE "intel-iommu"
-- 
2.21.1



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

* [PATCH v2 07/18] hw/alpha/alpha_sys: Remove unused "hw/ide.h" header
  2020-02-28 11:46 [PATCH v2 00/18] hw: Clean up hw/i386 headers (and few alpha/hppa) Philippe Mathieu-Daudé
                   ` (5 preceding siblings ...)
  2020-02-28 11:46 ` [PATCH v2 06/18] hw/i386/intel_iommu: Remove unused includes Philippe Mathieu-Daudé
@ 2020-02-28 11:46 ` Philippe Mathieu-Daudé
  2020-02-28 11:46 ` [PATCH v2 08/18] hw/alpha/dp264: Include "net/net.h" Philippe Mathieu-Daudé
                   ` (12 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-28 11:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, qemu-trivial, Philippe Mathieu-Daudé,
	Paolo Bonzini, John Snow, Richard Henderson

alpha_sys.h does not use anything from the "hw/ide.h" header.
Remove it.

Acked-by: John Snow <jsnow@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/alpha/alpha_sys.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/alpha/alpha_sys.h b/hw/alpha/alpha_sys.h
index bc0a286226..e2c02e2bbe 100644
--- a/hw/alpha/alpha_sys.h
+++ b/hw/alpha/alpha_sys.h
@@ -6,7 +6,6 @@
 #include "target/alpha/cpu-qom.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_host.h"
-#include "hw/ide.h"
 #include "hw/boards.h"
 #include "hw/intc/i8259.h"
 
-- 
2.21.1



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

* [PATCH v2 08/18] hw/alpha/dp264: Include "net/net.h"
  2020-02-28 11:46 [PATCH v2 00/18] hw: Clean up hw/i386 headers (and few alpha/hppa) Philippe Mathieu-Daudé
                   ` (6 preceding siblings ...)
  2020-02-28 11:46 ` [PATCH v2 07/18] hw/alpha/alpha_sys: Remove unused "hw/ide.h" header Philippe Mathieu-Daudé
@ 2020-02-28 11:46 ` Philippe Mathieu-Daudé
  2020-02-28 11:46 ` [PATCH v2 09/18] hw/hppa/machine: " Philippe Mathieu-Daudé
                   ` (11 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-28 11:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, qemu-trivial, Philippe Mathieu-Daudé,
	Paolo Bonzini, John Snow, Richard Henderson

hw/alpha/dp264.c uses NICInfo variables which are declared in
"net/net.h". Include it.

This fixes (when modifying unrelated headers):

  hw/alpha/dp264.c:89:21: error: use of undeclared identifier 'nb_nics'
      for (i = 0; i < nb_nics; i++) {
                      ^
  hw/alpha/dp264.c:90:30: error: use of undeclared identifier 'nd_table'
          pci_nic_init_nofail(&nd_table[i], pci_bus, "e1000", NULL);
                               ^

Acked-by: John Snow <jsnow@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/alpha/dp264.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
index 8d71a30617..e264c783c1 100644
--- a/hw/alpha/dp264.c
+++ b/hw/alpha/dp264.c
@@ -21,6 +21,7 @@
 #include "hw/dma/i8257.h"
 #include "net/net.h"
 #include "qemu/cutils.h"
+#include "net/net.h"
 
 #define MAX_IDE_BUS 2
 
-- 
2.21.1



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

* [PATCH v2 09/18] hw/hppa/machine: Include "net/net.h"
  2020-02-28 11:46 [PATCH v2 00/18] hw: Clean up hw/i386 headers (and few alpha/hppa) Philippe Mathieu-Daudé
                   ` (7 preceding siblings ...)
  2020-02-28 11:46 ` [PATCH v2 08/18] hw/alpha/dp264: Include "net/net.h" Philippe Mathieu-Daudé
@ 2020-02-28 11:46 ` Philippe Mathieu-Daudé
  2020-02-28 11:46 ` [PATCH v2 10/18] hw/acpi/cpu_hotplug: Include "hw/pci/pci.h" Philippe Mathieu-Daudé
                   ` (10 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-28 11:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, qemu-trivial, Philippe Mathieu-Daudé,
	Helge Deller, Paolo Bonzini, John Snow, Richard Henderson

hw/hppa/machine.c uses NICInfo variables which are declared in
"net/net.h". Include it.

This fixes (when modifying unrelated headers):

  hw/hppa/machine.c:126:21: error: use of undeclared identifier 'nb_nics'
      for (i = 0; i < nb_nics; i++) {
                      ^
  hw/hppa/machine.c:127:30: error: use of undeclared identifier 'nd_table'
          pci_nic_init_nofail(&nd_table[i], pci_bus, "e1000", NULL);
                               ^

Acked-by: John Snow <jsnow@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/hppa/machine.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
index 67181e75ba..d1e59a97f6 100644
--- a/hw/hppa/machine.c
+++ b/hw/hppa/machine.c
@@ -22,6 +22,7 @@
 #include "qapi/error.h"
 #include "net/net.h"
 #include "qemu/log.h"
+#include "net/net.h"
 
 #define MAX_IDE_BUS 2
 
-- 
2.21.1



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

* [PATCH v2 10/18] hw/acpi/cpu_hotplug: Include "hw/pci/pci.h"
  2020-02-28 11:46 [PATCH v2 00/18] hw: Clean up hw/i386 headers (and few alpha/hppa) Philippe Mathieu-Daudé
                   ` (8 preceding siblings ...)
  2020-02-28 11:46 ` [PATCH v2 09/18] hw/hppa/machine: " Philippe Mathieu-Daudé
@ 2020-02-28 11:46 ` Philippe Mathieu-Daudé
  2020-02-28 11:46 ` [PATCH v2 11/18] hw/timer/hpet: Include "exec/address-spaces.h" Philippe Mathieu-Daudé
                   ` (9 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-28 11:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, qemu-trivial, Philippe Mathieu-Daudé,
	Igor Mammedov, Paolo Bonzini, John Snow

hw/acpi/cpu_hotplug.c calls pci_address_space_io(). Include
"hw/pci/pci.h" which declares it.

This fixes (when modifying unrelated headers):

  hw/acpi/cpu_hotplug.c:103:28: error: implicit declaration of function 'pci_address_space_io' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
      MemoryRegion *parent = pci_address_space_io(PCI_DEVICE(gpe_cpu->device));
                             ^

Acked-by: John Snow <jsnow@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/acpi/cpu_hotplug.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/acpi/cpu_hotplug.c b/hw/acpi/cpu_hotplug.c
index 9c3bcc84de..3e687d227a 100644
--- a/hw/acpi/cpu_hotplug.c
+++ b/hw/acpi/cpu_hotplug.c
@@ -14,6 +14,7 @@
 #include "qapi/error.h"
 #include "hw/core/cpu.h"
 #include "hw/i386/pc.h"
+#include "hw/pci/pci.h"
 #include "qemu/error-report.h"
 
 #define CPU_EJECT_METHOD "CPEJ"
-- 
2.21.1



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

* [PATCH v2 11/18] hw/timer/hpet: Include "exec/address-spaces.h"
  2020-02-28 11:46 [PATCH v2 00/18] hw: Clean up hw/i386 headers (and few alpha/hppa) Philippe Mathieu-Daudé
                   ` (9 preceding siblings ...)
  2020-02-28 11:46 ` [PATCH v2 10/18] hw/acpi/cpu_hotplug: Include "hw/pci/pci.h" Philippe Mathieu-Daudé
@ 2020-02-28 11:46 ` Philippe Mathieu-Daudé
  2020-02-28 11:46 ` [PATCH v2 12/18] hw/pci-host/q35: Include "qemu/range.h" Philippe Mathieu-Daudé
                   ` (8 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-28 11:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Paolo Bonzini, John Snow,
	Philippe Mathieu-Daudé,
	Michael S. Tsirkin

hw/timer/hpet.c calls address_space_stl_le() declared in
"exec/address-spaces.h". Include it.

This fixes (when modifying unrelated headers):

  hw/timer/hpet.c:210:31: error: use of undeclared identifier 'address_space_memory'
          address_space_stl_le(&address_space_memory, timer->fsb >> 32,
                               ^~~~~~~~~~~~~~~~~~~~

Acked-by: John Snow <jsnow@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/timer/hpet.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c
index 4f30dd50a4..380acfa7c8 100644
--- a/hw/timer/hpet.c
+++ b/hw/timer/hpet.c
@@ -36,6 +36,7 @@
 #include "hw/rtc/mc146818rtc_regs.h"
 #include "migration/vmstate.h"
 #include "hw/timer/i8254.h"
+#include "exec/address-spaces.h"
 
 //#define HPET_DEBUG
 #ifdef HPET_DEBUG
-- 
2.21.1



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

* [PATCH v2 12/18] hw/pci-host/q35: Include "qemu/range.h"
  2020-02-28 11:46 [PATCH v2 00/18] hw: Clean up hw/i386 headers (and few alpha/hppa) Philippe Mathieu-Daudé
                   ` (10 preceding siblings ...)
  2020-02-28 11:46 ` [PATCH v2 11/18] hw/timer/hpet: Include "exec/address-spaces.h" Philippe Mathieu-Daudé
@ 2020-02-28 11:46 ` Philippe Mathieu-Daudé
  2020-02-28 11:46 ` [PATCH v2 13/18] hw/i2c/smbus_ich9: " Philippe Mathieu-Daudé
                   ` (7 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-28 11:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, qemu-trivial, Philippe Mathieu-Daudé,
	Paolo Bonzini, John Snow

The MCHPCIState structure uses the Range type which is declared in
"qemu/range.h". Include it.

This fixes (when modifying unrelated headers):

  In file included from hw/pci-host/q35.c:32:
  include/hw/pci-host/q35.h:57:11: error: field has incomplete type 'Range' (aka 'struct Range')
      Range pci_hole;
            ^
  include/qemu/typedefs.h:116:16: note: forward declaration of 'struct Range'
  typedef struct Range Range;
                 ^

Acked-by: John Snow <jsnow@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 include/hw/pci-host/q35.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/hw/pci-host/q35.h b/include/hw/pci-host/q35.h
index 976fbae599..47086c645e 100644
--- a/include/hw/pci-host/q35.h
+++ b/include/hw/pci-host/q35.h
@@ -33,6 +33,7 @@
 #include "hw/pci-host/pam.h"
 #include "hw/i386/intel_iommu.h"
 #include "qemu/units.h"
+#include "qemu/range.h"
 
 #define TYPE_Q35_HOST_DEVICE "q35-pcihost"
 #define Q35_HOST_DEVICE(obj) \
-- 
2.21.1



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

* [PATCH v2 13/18] hw/i2c/smbus_ich9: Include "qemu/range.h"
  2020-02-28 11:46 [PATCH v2 00/18] hw: Clean up hw/i386 headers (and few alpha/hppa) Philippe Mathieu-Daudé
                   ` (11 preceding siblings ...)
  2020-02-28 11:46 ` [PATCH v2 12/18] hw/pci-host/q35: Include "qemu/range.h" Philippe Mathieu-Daudé
@ 2020-02-28 11:46 ` Philippe Mathieu-Daudé
  2020-02-28 11:46 ` [PATCH v2 14/18] hw/pci-host/piix: " Philippe Mathieu-Daudé
                   ` (6 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-28 11:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, qemu-trivial, Philippe Mathieu-Daudé,
	Paolo Bonzini, John Snow

hw/i2c/smbus_ich9.c calls range_covers_byte(). Include "qemu/range.h"
which declares it.

This fixes (when modifying unrelated headers):

  hw/i2c/smbus_ich9.c:66:9: error: implicit declaration of function 'range_covers_byte' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
      if (range_covers_byte(address, len, ICH9_SMB_HOSTC)) {
          ^

Acked-by: John Snow <jsnow@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/i2c/smbus_ich9.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/i2c/smbus_ich9.c b/hw/i2c/smbus_ich9.c
index fd50fb851a..48f1ff4191 100644
--- a/hw/i2c/smbus_ich9.c
+++ b/hw/i2c/smbus_ich9.c
@@ -21,6 +21,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/range.h"
 #include "hw/i2c/pm_smbus.h"
 #include "hw/pci/pci.h"
 #include "migration/vmstate.h"
-- 
2.21.1



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

* [PATCH v2 14/18] hw/pci-host/piix: Include "qemu/range.h"
  2020-02-28 11:46 [PATCH v2 00/18] hw: Clean up hw/i386 headers (and few alpha/hppa) Philippe Mathieu-Daudé
                   ` (12 preceding siblings ...)
  2020-02-28 11:46 ` [PATCH v2 13/18] hw/i2c/smbus_ich9: " Philippe Mathieu-Daudé
@ 2020-02-28 11:46 ` Philippe Mathieu-Daudé
  2020-02-28 11:46 ` [PATCH v2 15/18] hw/acpi: Include "hw/mem/nvdimm.h" Philippe Mathieu-Daudé
                   ` (5 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-28 11:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, qemu-trivial, Philippe Mathieu-Daudé,
	Paolo Bonzini, John Snow

hw/pci-host/piix.c calls various functions from the Range API.
Include "qemu/range.h" which declares them.

This fixes (when modifying unrelated headers):

  hw/pci-host/i440fx.c:54:11: error: field has incomplete type 'Range' (aka 'struct Range')
      Range pci_hole;
           ^
  include/qemu/typedefs.h:116:16: note: forward declaration of 'struct Range'
  typedef struct Range Range;
                 ^
  hw/pci-host/i440fx.c:126:9: error: implicit declaration of function 'ranges_overlap' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
      if (ranges_overlap(address, len, I440FX_PAM, I440FX_PAM_SIZE) ||
          ^
  hw/pci-host/i440fx.c:126:9: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
  hw/pci-host/i440fx.c:127:9: error: implicit declaration of function 'range_covers_byte' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
          range_covers_byte(address, len, I440FX_SMRAM)) {
          ^
  hw/pci-host/i440fx.c:127:9: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
  hw/pci-host/i440fx.c:189:13: error: implicit declaration of function 'range_is_empty' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
      val64 = range_is_empty(&s->pci_hole) ? 0 : range_lob(&s->pci_hole);
              ^

Acked-by: John Snow <jsnow@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/pci-host/i440fx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c
index 11050a0f8b..d980c97049 100644
--- a/hw/pci-host/i440fx.c
+++ b/hw/pci-host/i440fx.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/range.h"
 #include "hw/i386/pc.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_host.h"
-- 
2.21.1



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

* [PATCH v2 15/18] hw/acpi: Include "hw/mem/nvdimm.h"
  2020-02-28 11:46 [PATCH v2 00/18] hw: Clean up hw/i386 headers (and few alpha/hppa) Philippe Mathieu-Daudé
                   ` (13 preceding siblings ...)
  2020-02-28 11:46 ` [PATCH v2 14/18] hw/pci-host/piix: " Philippe Mathieu-Daudé
@ 2020-02-28 11:46 ` Philippe Mathieu-Daudé
  2020-02-28 11:46 ` [PATCH v2 16/18] hw/i386: " Philippe Mathieu-Daudé
                   ` (4 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-28 11:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aleksandar Markovic, Michael S. Tsirkin, qemu-trivial,
	Philippe Mathieu-Daudé,
	Igor Mammedov, Paolo Bonzini, John Snow, Aurelien Jarno

Both ich9.c and piix4.c use methods/definitions declared in the
NVDIMM device header. Include it.

This fixes (when modifying unrelated headers):

  hw/acpi/ich9.c:507:46: error: use of undeclared identifier 'TYPE_NVDIMM'
        if (object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM)) {
                                             ^
  hw/acpi/ich9.c:508:13: error: implicit declaration of function 'nvdimm_acpi_plug_cb' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
            nvdimm_acpi_plug_cb(hotplug_dev, dev);
            ^
  hw/acpi/piix4.c:403:46: error: use of undeclared identifier 'TYPE_NVDIMM'
        if (object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM)) {
                                             ^
  hw/acpi/piix4.c:404:13: error: implicit declaration of function 'nvdimm_acpi_plug_cb' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
            nvdimm_acpi_plug_cb(hotplug_dev, dev);
            ^

Acked-by: John Snow <jsnow@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/acpi/ich9.c  | 1 +
 hw/acpi/piix4.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index fdd0a6c79e..4e74284b65 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -39,6 +39,7 @@
 
 #include "hw/i386/ich9.h"
 #include "hw/mem/pc-dimm.h"
+#include "hw/mem/nvdimm.h"
 
 //#define DEBUG
 
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index 6d621c31e7..b84dbba2c3 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -38,6 +38,7 @@
 #include "hw/acpi/cpu.h"
 #include "hw/hotplug.h"
 #include "hw/mem/pc-dimm.h"
+#include "hw/mem/nvdimm.h"
 #include "hw/acpi/memory_hotplug.h"
 #include "hw/acpi/acpi_dev_interface.h"
 #include "hw/xen/xen.h"
-- 
2.21.1



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

* [PATCH v2 16/18] hw/i386: Include "hw/mem/nvdimm.h"
  2020-02-28 11:46 [PATCH v2 00/18] hw: Clean up hw/i386 headers (and few alpha/hppa) Philippe Mathieu-Daudé
                   ` (14 preceding siblings ...)
  2020-02-28 11:46 ` [PATCH v2 15/18] hw/acpi: Include "hw/mem/nvdimm.h" Philippe Mathieu-Daudé
@ 2020-02-28 11:46 ` Philippe Mathieu-Daudé
  2020-02-28 11:46 ` [PATCH v2 17/18] hw/pci-host/q35: Remove unused includes Philippe Mathieu-Daudé
                   ` (3 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-28 11:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: Eduardo Habkost, Michael S. Tsirkin, qemu-trivial,
	Philippe Mathieu-Daudé,
	Igor Mammedov, Paolo Bonzini, John Snow, Richard Henderson

All this files use methods/definitions declared in the NVDIMM
device header. Include it.

This fixes (when modifying unrelated headers):

  hw/i386/acpi-build.c:2733:9: error: implicit declaration of function 'nvdimm_build_acpi' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        nvdimm_build_acpi(table_offsets, tables_blob, tables->linker,
        ^
  hw/i386/pc.c:1996:61: error: use of undeclared identifier 'TYPE_NVDIMM'
    const bool is_nvdimm = object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM);
                                                            ^
  hw/i386/pc.c:2032:55: error: use of undeclared identifier 'TYPE_NVDIMM'
    bool is_nvdimm = object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM);
                                                      ^
  hw/i386/pc.c:2040:9: error: implicit declaration of function 'nvdimm_plug' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        nvdimm_plug(ms->nvdimms_state);
        ^
  hw/i386/pc.c:2040:9: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
        nvdimm_plug(ms->nvdimms_state);
        ^
  hw/i386/pc.c:2065:42: error: use of undeclared identifier 'TYPE_NVDIMM'
    if (object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM)) {
                                         ^
  hw/i386/pc_i440fx.c:307:9: error: implicit declaration of function 'nvdimm_init_acpi_state' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        nvdimm_init_acpi_state(machine->nvdimms_state, system_io,
        ^
  hw/i386/pc_q35.c:332:9: error: implicit declaration of function 'nvdimm_init_acpi_state' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        nvdimm_init_acpi_state(machine->nvdimms_state, system_io,
        ^

Acked-by: John Snow <jsnow@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/i386/acpi-build.c | 1 +
 hw/i386/pc.c         | 1 +
 hw/i386/pc_piix.c    | 1 +
 hw/i386/pc_q35.c     | 1 +
 4 files changed, 4 insertions(+)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 9c4e46fa74..9335a82e9f 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -47,6 +47,7 @@
 #include "hw/rtc/mc146818rtc_regs.h"
 #include "migration/vmstate.h"
 #include "hw/mem/memory-device.h"
+#include "hw/mem/nvdimm.h"
 #include "sysemu/numa.h"
 #include "sysemu/reset.h"
 
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 6ab4acb0c6..362eb2a180 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -76,6 +76,7 @@
 #include "hw/boards.h"
 #include "acpi-build.h"
 #include "hw/mem/pc-dimm.h"
+#include "hw/mem/nvdimm.h"
 #include "qapi/error.h"
 #include "qapi/qapi-visit-common.h"
 #include "qapi/visitor.h"
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index fa12203079..82f1693901 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -60,6 +60,7 @@
 #include "migration/global_state.h"
 #include "migration/misc.h"
 #include "sysemu/numa.h"
+#include "hw/mem/nvdimm.h"
 
 #define MAX_IDE_BUS 2
 
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 84cf925cf4..d37c425e22 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -53,6 +53,7 @@
 #include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "sysemu/numa.h"
+#include "hw/mem/nvdimm.h"
 
 /* ICH9 AHCI has 6 ports */
 #define MAX_SATA_PORTS     6
-- 
2.21.1



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

* [PATCH v2 17/18] hw/pci-host/q35: Remove unused includes
  2020-02-28 11:46 [PATCH v2 00/18] hw: Clean up hw/i386 headers (and few alpha/hppa) Philippe Mathieu-Daudé
                   ` (15 preceding siblings ...)
  2020-02-28 11:46 ` [PATCH v2 16/18] hw/i386: " Philippe Mathieu-Daudé
@ 2020-02-28 11:46 ` Philippe Mathieu-Daudé
  2020-02-28 11:46 ` [PATCH v2 18/18] hw/i386/pc: Clean up includes Philippe Mathieu-Daudé
                   ` (2 subsequent siblings)
  19 siblings, 0 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-28 11:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, qemu-trivial, Philippe Mathieu-Daudé,
	Paolo Bonzini, John Snow

Only q35.c requires declarations from "hw/i386/pc.h", move it there.
Remove all the includes not used by "q35.h".

Acked-by: John Snow <jsnow@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 include/hw/pci-host/q35.h | 7 -------
 hw/pci-host/q35.c         | 1 +
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/include/hw/pci-host/q35.h b/include/hw/pci-host/q35.h
index 47086c645e..070305f83d 100644
--- a/include/hw/pci-host/q35.h
+++ b/include/hw/pci-host/q35.h
@@ -22,16 +22,9 @@
 #ifndef HW_Q35_H
 #define HW_Q35_H
 
-#include "hw/isa/isa.h"
-#include "hw/sysbus.h"
-#include "hw/i386/pc.h"
-#include "hw/isa/apm.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pcie_host.h"
-#include "hw/acpi/acpi.h"
-#include "hw/acpi/ich9.h"
 #include "hw/pci-host/pam.h"
-#include "hw/i386/intel_iommu.h"
 #include "qemu/units.h"
 #include "qemu/range.h"
 
diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
index a9b9ccc876..993f467668 100644
--- a/hw/pci-host/q35.c
+++ b/hw/pci-host/q35.c
@@ -29,6 +29,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/i386/pc.h"
 #include "hw/pci-host/q35.h"
 #include "hw/qdev-properties.h"
 #include "migration/vmstate.h"
-- 
2.21.1



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

* [PATCH v2 18/18] hw/i386/pc: Clean up includes
  2020-02-28 11:46 [PATCH v2 00/18] hw: Clean up hw/i386 headers (and few alpha/hppa) Philippe Mathieu-Daudé
                   ` (16 preceding siblings ...)
  2020-02-28 11:46 ` [PATCH v2 17/18] hw/pci-host/q35: Remove unused includes Philippe Mathieu-Daudé
@ 2020-02-28 11:46 ` Philippe Mathieu-Daudé
  2020-02-29 19:53 ` [PATCH v2 00/18] hw: Clean up hw/i386 headers (and few alpha/hppa) Richard Henderson
  2020-03-09 11:56 ` Laurent Vivier
  19 siblings, 0 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-28 11:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, qemu-trivial, Philippe Mathieu-Daudé,
	Paolo Bonzini, John Snow

Various headers are not required by hw/i386/pc.h:

 - "qemu/range.h"
 - "qemu/bitmap.h"
 - "qemu/module.h"
 - "exec/memory.h"
 - "hw/pci/pci.h"
 - "hw/mem/pc-dimm.h"
 - "hw/mem/nvdimm.h"
 - "net/net.h"

Remove them.

Add 3 headers that were missing:

 - "hw/hotplug.h"

   PCMachineState::acpi_dev is of type HotplugHandler

 - "qemu/notify.h"

   PCMachineState::machine_done is of type Notifier

 - "qapi/qapi-types-common.h"

   PCMachineState::vmport/smm is of type OnOffAuto

Acked-by: John Snow <jsnow@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 include/hw/i386/pc.h | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index d5ac76d54e..6ab6eda046 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -1,20 +1,15 @@
 #ifndef HW_PC_H
 #define HW_PC_H
 
-#include "exec/memory.h"
+#include "qemu/notify.h"
+#include "qapi/qapi-types-common.h"
 #include "hw/boards.h"
 #include "hw/block/fdc.h"
 #include "hw/block/flash.h"
-#include "net/net.h"
 #include "hw/i386/x86.h"
 
-#include "qemu/range.h"
-#include "qemu/bitmap.h"
-#include "qemu/module.h"
-#include "hw/pci/pci.h"
-#include "hw/mem/pc-dimm.h"
-#include "hw/mem/nvdimm.h"
 #include "hw/acpi/acpi_dev_interface.h"
+#include "hw/hotplug.h"
 
 #define HPET_INTCAP "hpet-intcap"
 
-- 
2.21.1



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

* Re: [PATCH v2 05/18] hw/usb/dev-storage: Remove unused "ui/console.h" header
  2020-02-28 11:46 ` [PATCH v2 05/18] hw/usb/dev-storage: " Philippe Mathieu-Daudé
@ 2020-02-28 13:19   ` Gerd Hoffmann
  0 siblings, 0 replies; 22+ messages in thread
From: Gerd Hoffmann @ 2020-02-28 13:19 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-trivial, Paolo Bonzini, John Snow, qemu-devel, Michael S. Tsirkin

On Fri, Feb 28, 2020 at 12:46:36PM +0100, Philippe Mathieu-Daudé wrote:
> The USB models related to storage don't need anything from
> "ui/console.h". Remove it.
> 
> Acked-by: John Snow <jsnow@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Acked-by: Gerd Hoffmann <kraxel@redhat.com>



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

* Re: [PATCH v2 00/18] hw: Clean up hw/i386 headers (and few alpha/hppa)
  2020-02-28 11:46 [PATCH v2 00/18] hw: Clean up hw/i386 headers (and few alpha/hppa) Philippe Mathieu-Daudé
                   ` (17 preceding siblings ...)
  2020-02-28 11:46 ` [PATCH v2 18/18] hw/i386/pc: Clean up includes Philippe Mathieu-Daudé
@ 2020-02-29 19:53 ` Richard Henderson
  2020-03-09 11:56 ` Laurent Vivier
  19 siblings, 0 replies; 22+ messages in thread
From: Richard Henderson @ 2020-02-29 19:53 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: qemu-trivial, Paolo Bonzini, Michael S. Tsirkin

On 2/28/20 3:46 AM, Philippe Mathieu-Daudé wrote:
> Philippe Mathieu-Daudé (18):
>   vl: Add missing "hw/boards.h" include
>   hw/southbridge/ich9: Removed unused headers
>   hw/i386/ioapic_internal: Remove unused "hw/i386/ioapic.h" header
>   hw/timer: Remove unused "ui/console.h" header
>   hw/usb/dev-storage: Remove unused "ui/console.h" header
>   hw/i386/intel_iommu: Remove unused includes
>   hw/alpha/alpha_sys: Remove unused "hw/ide.h" header
>   hw/alpha/dp264: Include "net/net.h"
>   hw/hppa/machine: Include "net/net.h"
>   hw/acpi/cpu_hotplug: Include "hw/pci/pci.h"
>   hw/timer/hpet: Include "exec/address-spaces.h"
>   hw/pci-host/q35: Include "qemu/range.h"
>   hw/i2c/smbus_ich9: Include "qemu/range.h"
>   hw/pci-host/piix: Include "qemu/range.h"
>   hw/acpi: Include "hw/mem/nvdimm.h"
>   hw/i386: Include "hw/mem/nvdimm.h"
>   hw/pci-host/q35: Remove unused includes

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~



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

* Re: [PATCH v2 00/18] hw: Clean up hw/i386 headers (and few alpha/hppa)
  2020-02-28 11:46 [PATCH v2 00/18] hw: Clean up hw/i386 headers (and few alpha/hppa) Philippe Mathieu-Daudé
                   ` (18 preceding siblings ...)
  2020-02-29 19:53 ` [PATCH v2 00/18] hw: Clean up hw/i386 headers (and few alpha/hppa) Richard Henderson
@ 2020-03-09 11:56 ` Laurent Vivier
  19 siblings, 0 replies; 22+ messages in thread
From: Laurent Vivier @ 2020-03-09 11:56 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: qemu-trivial, Paolo Bonzini, Michael S. Tsirkin

Le 28/02/2020 à 12:46, Philippe Mathieu-Daudé a écrit :
> [Rebased since v1]:
> https://www.mail-archive.com/qemu-block@nongnu.org/msg57485.html
> 
> This is a follow-up of Markus's cleanup series:
> Tame a few "touch this, recompile the world"
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg635748.html
> 
> This part is mostly restricted to X86, but since some file from the
> Alpha/PA-RISC machines include "hw/i386/pc.h" I had to fix them
> too.
> 
> Eventually I'll succeed at removing hw/i386/ dependency on non-X86
> platforms (Quest I started 2 years ago...).
> 
> Regards,
> 
> Phil.
> 
> Philippe Mathieu-Daudé (18):
>   vl: Add missing "hw/boards.h" include
>   hw/southbridge/ich9: Removed unused headers
>   hw/i386/ioapic_internal: Remove unused "hw/i386/ioapic.h" header
>   hw/timer: Remove unused "ui/console.h" header
>   hw/usb/dev-storage: Remove unused "ui/console.h" header
>   hw/i386/intel_iommu: Remove unused includes
>   hw/alpha/alpha_sys: Remove unused "hw/ide.h" header
>   hw/alpha/dp264: Include "net/net.h"
>   hw/hppa/machine: Include "net/net.h"
>   hw/acpi/cpu_hotplug: Include "hw/pci/pci.h"
>   hw/timer/hpet: Include "exec/address-spaces.h"
>   hw/pci-host/q35: Include "qemu/range.h"
>   hw/i2c/smbus_ich9: Include "qemu/range.h"
>   hw/pci-host/piix: Include "qemu/range.h"
>   hw/acpi: Include "hw/mem/nvdimm.h"
>   hw/i386: Include "hw/mem/nvdimm.h"
>   hw/pci-host/q35: Remove unused includes
>   hw/i386/pc: Clean up includes
> 
>  hw/alpha/alpha_sys.h              |  1 -
>  include/hw/i386/ich9.h            |  1 -
>  include/hw/i386/intel_iommu.h     |  4 ----
>  include/hw/i386/ioapic_internal.h |  1 -
>  include/hw/i386/pc.h              | 11 +++--------
>  include/hw/pci-host/q35.h         |  8 +-------
>  hw/acpi/cpu_hotplug.c             |  1 +
>  hw/acpi/ich9.c                    |  2 +-
>  hw/acpi/piix4.c                   |  1 +
>  hw/alpha/dp264.c                  |  1 +
>  hw/hppa/machine.c                 |  1 +
>  hw/i2c/smbus_ich9.c               |  1 +
>  hw/i386/acpi-build.c              |  1 +
>  hw/i386/pc.c                      |  1 +
>  hw/i386/pc_piix.c                 |  1 +
>  hw/i386/pc_q35.c                  |  1 +
>  hw/isa/lpc_ich9.c                 |  1 -
>  hw/pci-host/i440fx.c              |  1 +
>  hw/pci-host/q35.c                 |  1 +
>  hw/rtc/twl92230.c                 |  1 -
>  hw/timer/hpet.c                   |  2 +-
>  hw/usb/dev-storage.c              |  1 -
>  softmmu/vl.c                      |  1 +
>  23 files changed, 18 insertions(+), 27 deletions(-)
> 

Series applied to my trivial-patches branch.

Thanks,
Laurent



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

end of thread, other threads:[~2020-03-09 11:57 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-28 11:46 [PATCH v2 00/18] hw: Clean up hw/i386 headers (and few alpha/hppa) Philippe Mathieu-Daudé
2020-02-28 11:46 ` [PATCH v2 01/18] vl: Add missing "hw/boards.h" include Philippe Mathieu-Daudé
2020-02-28 11:46 ` [PATCH v2 02/18] hw/southbridge/ich9: Removed unused headers Philippe Mathieu-Daudé
2020-02-28 11:46 ` [PATCH v2 03/18] hw/i386/ioapic_internal: Remove unused "hw/i386/ioapic.h" header Philippe Mathieu-Daudé
2020-02-28 11:46 ` [PATCH v2 04/18] hw/timer: Remove unused "ui/console.h" header Philippe Mathieu-Daudé
2020-02-28 11:46 ` [PATCH v2 05/18] hw/usb/dev-storage: " Philippe Mathieu-Daudé
2020-02-28 13:19   ` Gerd Hoffmann
2020-02-28 11:46 ` [PATCH v2 06/18] hw/i386/intel_iommu: Remove unused includes Philippe Mathieu-Daudé
2020-02-28 11:46 ` [PATCH v2 07/18] hw/alpha/alpha_sys: Remove unused "hw/ide.h" header Philippe Mathieu-Daudé
2020-02-28 11:46 ` [PATCH v2 08/18] hw/alpha/dp264: Include "net/net.h" Philippe Mathieu-Daudé
2020-02-28 11:46 ` [PATCH v2 09/18] hw/hppa/machine: " Philippe Mathieu-Daudé
2020-02-28 11:46 ` [PATCH v2 10/18] hw/acpi/cpu_hotplug: Include "hw/pci/pci.h" Philippe Mathieu-Daudé
2020-02-28 11:46 ` [PATCH v2 11/18] hw/timer/hpet: Include "exec/address-spaces.h" Philippe Mathieu-Daudé
2020-02-28 11:46 ` [PATCH v2 12/18] hw/pci-host/q35: Include "qemu/range.h" Philippe Mathieu-Daudé
2020-02-28 11:46 ` [PATCH v2 13/18] hw/i2c/smbus_ich9: " Philippe Mathieu-Daudé
2020-02-28 11:46 ` [PATCH v2 14/18] hw/pci-host/piix: " Philippe Mathieu-Daudé
2020-02-28 11:46 ` [PATCH v2 15/18] hw/acpi: Include "hw/mem/nvdimm.h" Philippe Mathieu-Daudé
2020-02-28 11:46 ` [PATCH v2 16/18] hw/i386: " Philippe Mathieu-Daudé
2020-02-28 11:46 ` [PATCH v2 17/18] hw/pci-host/q35: Remove unused includes Philippe Mathieu-Daudé
2020-02-28 11:46 ` [PATCH v2 18/18] hw/i386/pc: Clean up includes Philippe Mathieu-Daudé
2020-02-29 19:53 ` [PATCH v2 00/18] hw: Clean up hw/i386 headers (and few alpha/hppa) Richard Henderson
2020-03-09 11:56 ` Laurent Vivier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.