Skip to contentSkip to conversation

Clean up includes of monitor.h

PATCH Superseded Paolo Bonzini 2 participants 4 messages Jun 6, 2012

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Clean up includes of monitor.h

There is no reason why QAPI clients should use monitor.h at all, qerror.h suffices.

qmp-commands.h uses the Monitor typedef, but it is only included from files that already get the typedef from qemu-common.h.

Paolo Bonzini (2):
kvm: add missing include files
qmp: do not include monitor.h from qapi-types-core.h

 hmp.c                  |    1 +
 kvm-all.c              |    2 ++
 qapi/qapi-types-core.h |    4 +---
 3 files changed, 4 insertions(+), 3 deletions(-)
Signature · 1 line
1.7.10.1
Quoted 1 line

From 669822329cc01dd8e55e0e080aae20bee4878dd4 Mon Sep 17 00:00:00 2001

From: Paolo Bonzini <[email protected]>
Date: Fri, 11 May 2012 14:36:34 +0200
Subject: [PATCH 1/2] kvm: add missing include files

These are included via monitor.h right now, add them explicitly.

---
 kvm-all.c |    2 ++
 1 file changed, 2 insertions(+)
kvm-all.c +2 -0
index 489ee53..831651d 100644
@@ -22,6 +22,8 @@
 
 #include "qemu-common.h"
 #include "qemu-barrier.h"
+#include "qemu-option.h"
+#include "qemu-config.h"
 #include "sysemu.h"
 #include "hw/hw.h"
 #include "hw/msi.h"
Signature · 1 line
1.7.10.1
Quoted 1 line

From 64cda12bfeb007b180e3328b757818f88c5d7302 Mon Sep 17 00:00:00 2001

From: Paolo Bonzini <[email protected]>
Date: Fri, 11 May 2012 14:34:32 +0200
Subject: [PATCH 2/2] qmp: do not include monitor.h from qapi-types-core.h

The comment is stale, monitor.h is not needed anymore (only qerror.h is, because it contains the schema for errors).

---
 hmp.c                  |    1 +
 qapi/qapi-types-core.h |    4 +---
 2 files changed, 2 insertions(+), 3 deletions(-)
hmp.c +1 -0
index bb0952e..7be673e 100644
@@ -16,6 +16,7 @@
 #include "hmp.h"
 #include "qemu-timer.h"
 #include "qmp-commands.h"
+#include "monitor.h"
 
 static void hmp_handle_error(Monitor *mon, Error **errp)
 {
qapi/qapi-types-core.h +1 -3
index 27e6be0..f781fc3 100644
@@ -16,8 +16,6 @@
 
 #include "qemu-common.h"
 #include "error.h"
-
-/* FIXME this is temporary until we remove middle mode */
-#include "monitor.h"
+#include "qerror.h"
 
 #endif
Signature · 1 line
1.7.10.1
#1 lore raw

PATCH 1/2 kvm: add missing include files

These are included via monitor.h right now, add them explicitly.

---
 kvm-all.c |    2 ++
 1 file changed, 2 insertions(+)
kvm-all.c +2 -0
index 489ee53..831651d 100644
@@ -22,6 +22,8 @@
 
 #include "qemu-common.h"
 #include "qemu-barrier.h"
+#include "qemu-option.h"
+#include "qemu-config.h"
 #include "sysemu.h"
 #include "hw/hw.h"
 #include "hw/msi.h"
Signature · 1 line
1.7.10.1
#2 lore raw

PATCH 2/2 qmp: do not include monitor.h from qapi-types-core.h

The comment is stale, monitor.h is not needed anymore (only qerror.h is, because it contains the schema for errors).

---
 hmp.c                  |    1 +
 qapi/qapi-types-core.h |    4 +---
 2 files changed, 2 insertions(+), 3 deletions(-)
hmp.c +1 -0
index bb0952e..7be673e 100644
@@ -16,6 +16,7 @@
 #include "hmp.h"
 #include "qemu-timer.h"
 #include "qmp-commands.h"
+#include "monitor.h"
 
 static void hmp_handle_error(Monitor *mon, Error **errp)
 {
qapi/qapi-types-core.h +1 -3
index 27e6be0..f781fc3 100644
@@ -16,8 +16,6 @@
 
 #include "qemu-common.h"
 #include "error.h"
-
-/* FIXME this is temporary until we remove middle mode */
-#include "monitor.h"
+#include "qerror.h"
 
 #endif
Signature · 1 line
1.7.10.1
#3 lore raw
In reply to Paolo Bonzini
Quoted 5 lines · On Wed, 6 Jun 2012 08:08:42 +0200 Paolo Bonzini <[email protected]> wrote:

There is no reason why QAPI clients should use monitor.h at all, qerror.h suffices.

qmp-commands.h uses the Monitor typedef, but it is only included from files that already get the typedef from qemu-common.h.

Could you please rebase it on top of the qmp queue?

git://repo.or.cz/qemu/qmp-unstable.git queue/qmp

I think you're going to get a few build errors there.