[Qemu-devel] [PATCH 03/18] hw: move qdev-monitor.o to toplevel directory

2013-03-05 Thread Paolo Bonzini
qdev-monitor.c is the only core qdev file that is not used in
user-mode emulation, and it does not define anything that is used
by hardware models.  Remove it from the hw/ directory and
remove hw/qdev-monitor.h from hw/qdev.h too; this requires
some files to have some new explicitly includes.

Signed-off-by: Paolo Bonzini pbonz...@redhat.com
---
 Makefile.objs   | 1 +
 hw/9pfs/virtio-9p-proxy.c   | 1 +
 hw/Makefile.objs| 1 -
 hw/dataplane/virtio-blk.c   | 2 ++
 hw/dataplane/vring.c| 1 +
 hw/pc87312.c| 1 +
 hw/pc_sysfw.c   | 1 +
 hw/pci/shpc.c   | 3 ++-
 hw/pci/slotid_cap.c | 1 +
 hw/qdev-addr.c  | 1 +
 hw/qdev.c   | 1 +
 hw/qdev.h   | 1 -
 hw/s390x/sclpconsole.c  | 1 +
 hw/usb/dev-network.c| 1 +
 hw/virtio-rng.c | 1 +
 hw/virtio-scsi.c| 1 +
 hw/xilinx.h | 3 ++-
 hw/xilinx_axienet.c | 1 +
 hw/qdev-monitor.h = include/monitor/qdev.h | 3 +--
 monitor.c   | 2 +-
 hw/qdev-monitor.c = qdev-monitor.c | 3 ++-
 util/qemu-config.c  | 1 +
 vl.c| 1 +
 23 files changed, 25 insertions(+), 8 deletions(-)
 rename hw/qdev-monitor.h = include/monitor/qdev.h (80%)
 rename hw/qdev-monitor.c = qdev-monitor.c (99%)

diff --git a/Makefile.objs b/Makefile.objs
index a68cdac..2a8174d 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -51,6 +51,7 @@ ifeq ($(CONFIG_SOFTMMU),y)
 common-obj-y = $(block-obj-y) blockdev.o blockdev-nbd.o block/
 common-obj-y += net/
 common-obj-y += readline.o
+common-obj-y += qdev-monitor.o
 common-obj-$(CONFIG_WIN32) += os-win32.o
 common-obj-$(CONFIG_POSIX) += os-posix.o
 
diff --git a/hw/9pfs/virtio-9p-proxy.c b/hw/9pfs/virtio-9p-proxy.c
index 54e9875..7300279 100644
--- a/hw/9pfs/virtio-9p-proxy.c
+++ b/hw/9pfs/virtio-9p-proxy.c
@@ -13,6 +13,7 @@
 #include sys/un.h
 #include hw/virtio.h
 #include virtio-9p.h
+#include qemu/error-report.h
 #include fsdev/qemu-fsdev.h
 #include virtio-9p-proxy.h
 
diff --git a/hw/Makefile.objs b/hw/Makefile.objs
index 6e2275b..f7ee133 100644
--- a/hw/Makefile.objs
+++ b/hw/Makefile.objs
@@ -190,7 +190,6 @@ common-obj-$(CONFIG_SD) += sd.o
 common-obj-y += bt.o bt-l2cap.o bt-sdp.o bt-hci.o bt-hid.o
 common-obj-y += bt-hci-csr.o
 common-obj-y += ps2.o
-common-obj-y += qdev-monitor.o
 common-obj-y += qdev-properties-system.o
 
 # xen backend driver support
diff --git a/hw/dataplane/virtio-blk.c b/hw/dataplane/virtio-blk.c
index 3f2da22..8588f93 100644
--- a/hw/dataplane/virtio-blk.c
+++ b/hw/dataplane/virtio-blk.c
@@ -16,9 +16,11 @@
 #include qemu/iov.h
 #include event-poll.h
 #include qemu/thread.h
+#include qemu/error-report.h
 #include vring.h
 #include ioq.h
 #include migration/migration.h
+#include block/block.h
 #include hw/virtio-blk.h
 #include hw/dataplane/virtio-blk.h
 
diff --git a/hw/dataplane/vring.c b/hw/dataplane/vring.c
index d5d4ef4..eff5ad8 100644
--- a/hw/dataplane/vring.c
+++ b/hw/dataplane/vring.c
@@ -16,6 +16,7 @@
 
 #include trace.h
 #include hw/dataplane/vring.h
+#include qemu/error-report.h
 
 /* Map the guest's vring to host memory */
 bool vring_setup(Vring *vring, VirtIODevice *vdev, int n)
diff --git a/hw/pc87312.c b/hw/pc87312.c
index 38af4c1..0e9760e 100644
--- a/hw/pc87312.c
+++ b/hw/pc87312.c
@@ -24,6 +24,7 @@
  */
 
 #include pc87312.h
+#include qemu/error-report.h
 #include sysemu/blockdev.h
 #include sysemu/sysemu.h
 #include char/char.h
diff --git a/hw/pc_sysfw.c b/hw/pc_sysfw.c
index 7f6c12c..8b65a7a 100644
--- a/hw/pc_sysfw.c
+++ b/hw/pc_sysfw.c
@@ -24,6 +24,7 @@
  */
 
 #include sysemu/blockdev.h
+#include qemu/error-report.h
 #include sysbus.h
 #include hw.h
 #include pc.h
diff --git a/hw/pci/shpc.c b/hw/pci/shpc.c
index f07266d..d35c2ee 100644
--- a/hw/pci/shpc.c
+++ b/hw/pci/shpc.c
@@ -1,7 +1,8 @@
+#include qemu-common.h
 #include strings.h
 #include stdint.h
 #include qemu/range.h
-#include qemu/range.h
+#include qemu/error-report.h
 #include hw/pci/shpc.h
 #include hw/pci/pci.h
 #include hw/pci/pci_bus.h
diff --git a/hw/pci/slotid_cap.c b/hw/pci/slotid_cap.c
index 99a30f4..62f7bae 100644
--- a/hw/pci/slotid_cap.c
+++ b/hw/pci/slotid_cap.c
@@ -1,5 +1,6 @@
 #include hw/pci/slotid_cap.h
 #include hw/pci/pci.h
+#include qemu/error-report.h
 
 #define SLOTID_CAP_LENGTH 4
 #define SLOTID_NSLOTS_SHIFT (ffs(PCI_SID_ESR_NSLOTS) - 1)
diff --git a/hw/qdev-addr.c b/hw/qdev-addr.c
index b4388f6..fc2c437 100644
--- a/hw/qdev-addr.c
+++ b/hw/qdev-addr.c
@@ -1,6 +1,7 @@
 #include qdev.h
 #include qdev-addr.h
 #include exec/hwaddr.h
+#include qapi/qmp/qerror.h
 #include 

[Qemu-devel] [PATCH 03/18] hw: move qdev-monitor.o to toplevel directory

2013-03-01 Thread Paolo Bonzini
qdev-monitor.c is the only core qdev file that is not used in
user-mode emulation, and it does not define anything that is used
by hardware models.  Remove it from the hw/ directory and
remove hw/qdev-monitor.h from hw/qdev.h too; this requires
some files to have some new explicitly includes.

Signed-off-by: Paolo Bonzini pbonz...@redhat.com
---
 Makefile.objs   | 1 +
 hw/9pfs/virtio-9p-proxy.c   | 1 +
 hw/Makefile.objs| 1 -
 hw/dataplane/virtio-blk.c   | 2 ++
 hw/dataplane/vring.c| 1 +
 hw/pc87312.c| 1 +
 hw/pc_sysfw.c   | 1 +
 hw/pci/shpc.c   | 3 ++-
 hw/pci/slotid_cap.c | 1 +
 hw/qdev-addr.c  | 1 +
 hw/qdev.c   | 1 +
 hw/qdev.h   | 1 -
 hw/s390x/sclpconsole.c  | 1 +
 hw/usb/dev-network.c| 1 +
 hw/virtio-rng.c | 1 +
 hw/virtio-scsi.c| 1 +
 hw/xilinx.h | 3 ++-
 hw/xilinx_axienet.c | 1 +
 hw/qdev-monitor.h = include/monitor/qdev.h | 3 +--
 monitor.c   | 2 +-
 hw/qdev-monitor.c = qdev-monitor.c | 3 ++-
 util/qemu-config.c  | 1 +
 vl.c| 1 +
 23 files changed, 25 insertions(+), 8 deletions(-)
 rename hw/qdev-monitor.h = include/monitor/qdev.h (80%)
 rename hw/qdev-monitor.c = qdev-monitor.c (99%)

diff --git a/Makefile.objs b/Makefile.objs
index a68cdac..2a8174d 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -51,6 +51,7 @@ ifeq ($(CONFIG_SOFTMMU),y)
 common-obj-y = $(block-obj-y) blockdev.o blockdev-nbd.o block/
 common-obj-y += net/
 common-obj-y += readline.o
+common-obj-y += qdev-monitor.o
 common-obj-$(CONFIG_WIN32) += os-win32.o
 common-obj-$(CONFIG_POSIX) += os-posix.o
 
diff --git a/hw/9pfs/virtio-9p-proxy.c b/hw/9pfs/virtio-9p-proxy.c
index 54e9875..7300279 100644
--- a/hw/9pfs/virtio-9p-proxy.c
+++ b/hw/9pfs/virtio-9p-proxy.c
@@ -13,6 +13,7 @@
 #include sys/un.h
 #include hw/virtio.h
 #include virtio-9p.h
+#include qemu/error-report.h
 #include fsdev/qemu-fsdev.h
 #include virtio-9p-proxy.h
 
diff --git a/hw/Makefile.objs b/hw/Makefile.objs
index 6e2275b..f7ee133 100644
--- a/hw/Makefile.objs
+++ b/hw/Makefile.objs
@@ -190,7 +190,6 @@ common-obj-$(CONFIG_SD) += sd.o
 common-obj-y += bt.o bt-l2cap.o bt-sdp.o bt-hci.o bt-hid.o
 common-obj-y += bt-hci-csr.o
 common-obj-y += ps2.o
-common-obj-y += qdev-monitor.o
 common-obj-y += qdev-properties-system.o
 
 # xen backend driver support
diff --git a/hw/dataplane/virtio-blk.c b/hw/dataplane/virtio-blk.c
index 3f2da22..8588f93 100644
--- a/hw/dataplane/virtio-blk.c
+++ b/hw/dataplane/virtio-blk.c
@@ -16,9 +16,11 @@
 #include qemu/iov.h
 #include event-poll.h
 #include qemu/thread.h
+#include qemu/error-report.h
 #include vring.h
 #include ioq.h
 #include migration/migration.h
+#include block/block.h
 #include hw/virtio-blk.h
 #include hw/dataplane/virtio-blk.h
 
diff --git a/hw/dataplane/vring.c b/hw/dataplane/vring.c
index d5d4ef4..eff5ad8 100644
--- a/hw/dataplane/vring.c
+++ b/hw/dataplane/vring.c
@@ -16,6 +16,7 @@
 
 #include trace.h
 #include hw/dataplane/vring.h
+#include qemu/error-report.h
 
 /* Map the guest's vring to host memory */
 bool vring_setup(Vring *vring, VirtIODevice *vdev, int n)
diff --git a/hw/pc87312.c b/hw/pc87312.c
index 38af4c1..0e9760e 100644
--- a/hw/pc87312.c
+++ b/hw/pc87312.c
@@ -24,6 +24,7 @@
  */
 
 #include pc87312.h
+#include qemu/error-report.h
 #include sysemu/blockdev.h
 #include sysemu/sysemu.h
 #include char/char.h
diff --git a/hw/pc_sysfw.c b/hw/pc_sysfw.c
index 7f6c12c..8b65a7a 100644
--- a/hw/pc_sysfw.c
+++ b/hw/pc_sysfw.c
@@ -24,6 +24,7 @@
  */
 
 #include sysemu/blockdev.h
+#include qemu/error-report.h
 #include sysbus.h
 #include hw.h
 #include pc.h
diff --git a/hw/pci/shpc.c b/hw/pci/shpc.c
index f07266d..d35c2ee 100644
--- a/hw/pci/shpc.c
+++ b/hw/pci/shpc.c
@@ -1,7 +1,8 @@
+#include qemu-common.h
 #include strings.h
 #include stdint.h
 #include qemu/range.h
-#include qemu/range.h
+#include qemu/error-report.h
 #include hw/pci/shpc.h
 #include hw/pci/pci.h
 #include hw/pci/pci_bus.h
diff --git a/hw/pci/slotid_cap.c b/hw/pci/slotid_cap.c
index 99a30f4..62f7bae 100644
--- a/hw/pci/slotid_cap.c
+++ b/hw/pci/slotid_cap.c
@@ -1,5 +1,6 @@
 #include hw/pci/slotid_cap.h
 #include hw/pci/pci.h
+#include qemu/error-report.h
 
 #define SLOTID_CAP_LENGTH 4
 #define SLOTID_NSLOTS_SHIFT (ffs(PCI_SID_ESR_NSLOTS) - 1)
diff --git a/hw/qdev-addr.c b/hw/qdev-addr.c
index b4388f6..fc2c437 100644
--- a/hw/qdev-addr.c
+++ b/hw/qdev-addr.c
@@ -1,6 +1,7 @@
 #include qdev.h
 #include qdev-addr.h
 #include exec/hwaddr.h
+#include qapi/qmp/qerror.h
 #include