Patchwork [03/19] hw: move qdev-monitor.o to toplevel directory

login
register
mail settings
Submitter Paolo Bonzini
Date Feb. 4, 2013, 5:29 p.m.
Message ID <1359999004-22982-4-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/218041/
State New
Headers show

Comments

Paolo Bonzini - Feb. 4, 2013, 5:29 p.m.
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 <pbonzini@redhat.com>
---
 Makefile.objs                               |    1 +
 hw/9pfs/virtio-9p-proxy.c                   |    1 +
 hw/Makefile.objs                            |    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/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 +
 20 files changed, 21 insertions(+), 8 deletions(-)
 rename hw/qdev-monitor.h => include/monitor/qdev.h (80%)
 rename hw/qdev-monitor.c => qdev-monitor.c (99%)

Patch

diff --git a/Makefile.objs b/Makefile.objs
index 21e9c91..f37e701 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 d5ad208..acac15c 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 6aad5de..ca7d5bd 100644
--- a/hw/Makefile.objs
+++ b/hw/Makefile.objs
@@ -187,7 +187,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/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 "qapi/visitor.h"
 
 /* --- target physical address --- */
diff --git a/hw/qdev.c b/hw/qdev.c
index 8258757..cd18026 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -28,6 +28,7 @@ 
 #include "qdev.h"
 #include "sysemu/sysemu.h"
 #include "qapi/error.h"
+#include "qapi/qmp/qerror.h"
 #include "qapi/visitor.h"
 
 int qdev_hotplug = 0;
diff --git a/hw/qdev.h b/hw/qdev.h
index 365b8d6..f814656 100644
--- a/hw/qdev.h
+++ b/hw/qdev.h
@@ -4,6 +4,5 @@ 
 #include "hw/hw.h"
 #include "qdev-core.h"
 #include "qdev-properties.h"
-#include "qdev-monitor.h"
 
 #endif
diff --git a/hw/s390x/sclpconsole.c b/hw/s390x/sclpconsole.c
index adc0ee8..c562501 100644
--- a/hw/s390x/sclpconsole.c
+++ b/hw/s390x/sclpconsole.c
@@ -14,6 +14,7 @@ 
 
 #include <hw/qdev.h>
 #include "qemu/thread.h"
+#include "qemu/error-report.h"
 
 #include "sclp.h"
 #include "event-facility.h"
diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c
index a01a5e7..b89a252 100644
--- a/hw/usb/dev-network.c
+++ b/hw/usb/dev-network.c
@@ -27,6 +27,7 @@ 
 #include "hw/usb.h"
 #include "hw/usb/desc.h"
 #include "net/net.h"
+#include "qapi/qmp/qerror.h"
 #include "qemu/queue.h"
 #include "qemu/config-file.h"
 #include "sysemu/sysemu.h"
diff --git a/hw/virtio-rng.c b/hw/virtio-rng.c
index e063127..2cdf4ec 100644
--- a/hw/virtio-rng.c
+++ b/hw/virtio-rng.c
@@ -11,6 +11,7 @@ 
 
 #include "qemu/iov.h"
 #include "qdev.h"
+#include "qapi/qmp/qerror.h"
 #include "virtio.h"
 #include "virtio-rng.h"
 #include "qemu/rng.h"
diff --git a/hw/virtio-scsi.c b/hw/virtio-scsi.c
index 0715865..27070d1 100644
--- a/hw/virtio-scsi.c
+++ b/hw/virtio-scsi.c
@@ -14,6 +14,7 @@ 
  */
 
 #include "virtio-scsi.h"
+#include "qemu/error-report.h"
 #include <hw/scsi.h>
 #include <hw/scsi-defs.h>
 
diff --git a/hw/xilinx.h b/hw/xilinx.h
index 725f2f4..c4c8359 100644
--- a/hw/xilinx.h
+++ b/hw/xilinx.h
@@ -2,8 +2,9 @@ 
 #define HW_XILINX_H 1
 
 
-#include "stream.h"
 #include "qemu-common.h"
+#include "qapi/qmp/qerror.h"
+#include "stream.h"
 #include "net/net.h"
 
 static inline DeviceState *
diff --git a/hw/qdev-monitor.h b/include/monitor/qdev.h
similarity index 80%
rename from hw/qdev-monitor.h
rename to include/monitor/qdev.h
index 9ec4850..8d16e11 100644
--- a/hw/qdev-monitor.h
+++ b/include/monitor/qdev.h
@@ -1,7 +1,7 @@ 
 #ifndef QEMU_QDEV_MONITOR_H
 #define QEMU_QDEV_MONITOR_H
 
-#include "qdev-core.h"
+#include "hw/qdev-core.h"
 #include "monitor/monitor.h"
 
 /*** monitor commands ***/
@@ -9,7 +9,6 @@ 
 void do_info_qtree(Monitor *mon, const QDict *qdict);
 void do_info_qdm(Monitor *mon, const QDict *qdict);
 int do_device_add(Monitor *mon, const QDict *qdict, QObject **ret_data);
-int do_device_del(Monitor *mon, const QDict *qdict, QObject **ret_data);
 int qdev_device_help(QemuOpts *opts);
 DeviceState *qdev_device_add(QemuOpts *opts);
 
diff --git a/monitor.c b/monitor.c
index 20bd19b..81c65ed 100644
--- a/monitor.c
+++ b/monitor.c
@@ -23,7 +23,7 @@ 
  */
 #include <dirent.h>
 #include "hw/hw.h"
-#include "hw/qdev.h"
+#include "monitor/qdev.h"
 #include "hw/usb.h"
 #include "hw/pcmcia.h"
 #include "hw/pc.h"
diff --git a/hw/qdev-monitor.c b/qdev-monitor.c
similarity index 99%
rename from hw/qdev-monitor.c
rename to qdev-monitor.c
index 4f9a6eb..9a78ccf 100644
--- a/hw/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -17,8 +17,9 @@ 
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "qdev.h"
+#include "hw/qdev.h"
 #include "monitor/monitor.h"
+#include "monitor/qdev.h"
 #include "qmp-commands.h"
 #include "sysemu/arch_init.h"
 #include "qemu/config-file.h"
diff --git a/util/qemu-config.c b/util/qemu-config.c
index 47c81f7..fc07c51 100644
--- a/util/qemu-config.c
+++ b/util/qemu-config.c
@@ -2,6 +2,7 @@ 
 #include "qemu/error-report.h"
 #include "qemu/option.h"
 #include "qemu/config-file.h"
+#include "qapi/qmp/qerror.h"
 #include "hw/qdev.h"
 #include "qapi/error.h"
 
diff --git a/vl.c b/vl.c
index 79ed0c7..c0bf99f 100644
--- a/vl.c
+++ b/vl.c
@@ -126,6 +126,7 @@  int main(int argc, char **argv)
 #include "hw/xen.h"
 #include "hw/qdev.h"
 #include "hw/loader.h"
+#include "monitor/qdev.h"
 #include "bt/bt.h"
 #include "net/net.h"
 #include "net/slirp.h"