All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/3] Clean up includes of monitor.h
@ 2012-06-07  2:02 Paolo Bonzini
  2012-06-07  2:02 ` [Qemu-devel] [PATCH v2 1/3] kvm: add missing include files Paolo Bonzini
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Paolo Bonzini @ 2012-06-07  2:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: lcapitulino

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.

v1->v2: rebase to queue/qmp

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

 hmp.c                  |    1 +
 kvm-all.c              |    2 ++
 net/tap.c              |    1 +
 qapi/qapi-types-core.h |    4 +---
 4 files changed, 5 insertions(+), 3 deletions(-)

-- 
1.7.10.1

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

* [Qemu-devel] [PATCH v2 1/3] kvm: add missing include files
  2012-06-07  2:02 [Qemu-devel] [PATCH v2 0/3] Clean up includes of monitor.h Paolo Bonzini
@ 2012-06-07  2:02 ` Paolo Bonzini
  2012-06-07  2:02 ` [Qemu-devel] [PATCH v2 2/3] qmp: include monitor.h when needed Paolo Bonzini
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Paolo Bonzini @ 2012-06-07  2:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: lcapitulino

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

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 kvm-all.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/kvm-all.c b/kvm-all.c
index 489ee53..831651d 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -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"
-- 
1.7.10.1

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

* [Qemu-devel] [PATCH v2 2/3] qmp: include monitor.h when needed
  2012-06-07  2:02 [Qemu-devel] [PATCH v2 0/3] Clean up includes of monitor.h Paolo Bonzini
  2012-06-07  2:02 ` [Qemu-devel] [PATCH v2 1/3] kvm: add missing include files Paolo Bonzini
@ 2012-06-07  2:02 ` Paolo Bonzini
  2012-06-07  2:02 ` [Qemu-devel] [PATCH v2 3/3] qmp: do not include monitor.h from qapi-types-core.h Paolo Bonzini
  2012-06-12 18:57 ` [Qemu-devel] [PATCH v2 0/3] Clean up includes of monitor.h Luiz Capitulino
  3 siblings, 0 replies; 8+ messages in thread
From: Paolo Bonzini @ 2012-06-07  2:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: lcapitulino

This is needed to get file descriptors from SCM_RIGHTS.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hmp.c     |    1 +
 net/tap.c |    1 +
 2 file changed, 2 insertion(+)

diff --git a/hmp.c b/hmp.c
index 2ce8cb9..b9cec1d 100644
--- a/hmp.c
+++ b/hmp.c
@@ -18,6 +18,7 @@
 #include "qemu-option.h"
 #include "qemu-timer.h"
 #include "qmp-commands.h"
+#include "monitor.h"
 
 static void hmp_handle_error(Monitor *mon, Error **errp)
 {
diff --git a/net/tap.c b/net/tap.c
index 5ac4ba3..17e9135 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -34,6 +34,7 @@
 #include <net/if.h>
 
 #include "net.h"
+#include "monitor.h"
 #include "sysemu.h"
 #include "qemu-char.h"
 #include "qemu-common.h"
-- 
1.7.10.1

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

* [Qemu-devel] [PATCH v2 3/3] qmp: do not include monitor.h from qapi-types-core.h
  2012-06-07  2:02 [Qemu-devel] [PATCH v2 0/3] Clean up includes of monitor.h Paolo Bonzini
  2012-06-07  2:02 ` [Qemu-devel] [PATCH v2 1/3] kvm: add missing include files Paolo Bonzini
  2012-06-07  2:02 ` [Qemu-devel] [PATCH v2 2/3] qmp: include monitor.h when needed Paolo Bonzini
@ 2012-06-07  2:02 ` Paolo Bonzini
  2012-06-07  4:55   ` Anthony Liguori
  2012-06-12 18:57 ` [Qemu-devel] [PATCH v2 0/3] Clean up includes of monitor.h Luiz Capitulino
  3 siblings, 1 reply; 8+ messages in thread
From: Paolo Bonzini @ 2012-06-07  2:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: lcapitulino

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

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 qapi/qapi-types-core.h |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/qapi/qapi-types-core.h b/qapi/qapi-types-core.h
index 27e6be0..f781fc3 100644
--- a/qapi/qapi-types-core.h
+++ b/qapi/qapi-types-core.h
@@ -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
-- 
1.7.10.1

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

* Re: [Qemu-devel] [PATCH v2 3/3] qmp: do not include monitor.h from qapi-types-core.h
  2012-06-07  2:02 ` [Qemu-devel] [PATCH v2 3/3] qmp: do not include monitor.h from qapi-types-core.h Paolo Bonzini
@ 2012-06-07  4:55   ` Anthony Liguori
  2012-06-07  5:35     ` Paolo Bonzini
  2012-06-12 23:06     ` Andreas Färber
  0 siblings, 2 replies; 8+ messages in thread
From: Anthony Liguori @ 2012-06-07  4:55 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, lcapitulino

On 06/07/2012 10:02 AM, Paolo Bonzini wrote:
> The comment is stale, monitor.h is not needed anymore (only qerror.h
> is, because it contains the schema for errors).
>
> Signed-off-by: Paolo Bonzini<pbonzini@redhat.com>
> ---
>   qapi/qapi-types-core.h |    4 +---
>   1 files changed, 1 insertions(+), 3 deletions(-)
>
> diff --git a/qapi/qapi-types-core.h b/qapi/qapi-types-core.h
> index 27e6be0..f781fc3 100644
> --- a/qapi/qapi-types-core.h
> +++ b/qapi/qapi-types-core.h
> @@ -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"

Middle mode generates signatures that contain a 'Monitor *'.  qmp-commands.h 
includes qmp-types which only includes qmp-types-core.h

Without having a #include "monitor.h" here, qmp-commands.h is relying on 
something else including monitor.h before including qmp-commands.h

I guess you could push the monitor.h include to qmp-commands.h but the point of 
qmp-types-core was to avoid having to add #includes to the code generator.

Regards,

Anthony Liguori

>
>   #endif

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

* Re: [Qemu-devel] [PATCH v2 3/3] qmp: do not include monitor.h from qapi-types-core.h
  2012-06-07  4:55   ` Anthony Liguori
@ 2012-06-07  5:35     ` Paolo Bonzini
  2012-06-12 23:06     ` Andreas Färber
  1 sibling, 0 replies; 8+ messages in thread
From: Paolo Bonzini @ 2012-06-07  5:35 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: qemu-devel, lcapitulino

Il 07/06/2012 06:55, Anthony Liguori ha scritto:
> On 06/07/2012 10:02 AM, Paolo Bonzini wrote:
>> The comment is stale, monitor.h is not needed anymore (only qerror.h
>> is, because it contains the schema for errors).
>>
>> Signed-off-by: Paolo Bonzini<pbonzini@redhat.com>
>> ---
>>   qapi/qapi-types-core.h |    4 +---
>>   1 files changed, 1 insertions(+), 3 deletions(-)
>>
>> diff --git a/qapi/qapi-types-core.h b/qapi/qapi-types-core.h
>> index 27e6be0..f781fc3 100644
>> --- a/qapi/qapi-types-core.h
>> +++ b/qapi/qapi-types-core.h
>> @@ -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"
> 
> Middle mode generates signatures that contain a 'Monitor *'. 
> qmp-commands.h includes qmp-types which only includes qmp-types-core.h
> 
> Without having a #include "monitor.h" here, qmp-commands.h is relying on
> something else including monitor.h before including qmp-commands.h

Everything should be including qemu-common.h that has the "typedef
struct Monitor Monitor".  Note that this is not really just a cleanup.
Right now I cannot include qapi-types.h from block_int.h, because
monitor.h depends on block_int.h.

Paolo

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

* Re: [Qemu-devel] [PATCH v2 0/3] Clean up includes of monitor.h
  2012-06-07  2:02 [Qemu-devel] [PATCH v2 0/3] Clean up includes of monitor.h Paolo Bonzini
                   ` (2 preceding siblings ...)
  2012-06-07  2:02 ` [Qemu-devel] [PATCH v2 3/3] qmp: do not include monitor.h from qapi-types-core.h Paolo Bonzini
@ 2012-06-12 18:57 ` Luiz Capitulino
  3 siblings, 0 replies; 8+ messages in thread
From: Luiz Capitulino @ 2012-06-12 18:57 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: aliguori, qemu-devel

On Thu,  7 Jun 2012 04:02:19 +0200
Paolo Bonzini <pbonzini@redhat.com> 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.

Applied to the qmp branch, thanks.

PS: I'm assuming that Anthony doesn't have further objections.

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

* Re: [Qemu-devel] [PATCH v2 3/3] qmp: do not include monitor.h from qapi-types-core.h
  2012-06-07  4:55   ` Anthony Liguori
  2012-06-07  5:35     ` Paolo Bonzini
@ 2012-06-12 23:06     ` Andreas Färber
  1 sibling, 0 replies; 8+ messages in thread
From: Andreas Färber @ 2012-06-12 23:06 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: Paolo Bonzini, qemu-devel, lcapitulino

Am 07.06.2012 06:55, schrieb Anthony Liguori:
> On 06/07/2012 10:02 AM, Paolo Bonzini wrote:
>> The comment is stale, monitor.h is not needed anymore (only qerror.h
>> is, because it contains the schema for errors).
>>
>> Signed-off-by: Paolo Bonzini<pbonzini@redhat.com>
>> ---
>>   qapi/qapi-types-core.h |    4 +---
>>   1 files changed, 1 insertions(+), 3 deletions(-)
>>
>> diff --git a/qapi/qapi-types-core.h b/qapi/qapi-types-core.h
>> index 27e6be0..f781fc3 100644
>> --- a/qapi/qapi-types-core.h
>> +++ b/qapi/qapi-types-core.h
>> @@ -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"
> 
> Middle mode generates signatures that contain a 'Monitor *'. 
> qmp-commands.h includes qmp-types which only includes qmp-types-core.h
> 
> Without having a #include "monitor.h" here, qmp-commands.h is relying on
> something else including monitor.h before including qmp-commands.h
[snip]

Similar situation with some block types - they're being used in one of
these core QAPI files but my CPU-as-a-device branch no longer compiles
since somehow the appropriate block header is no longer being included.

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

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

end of thread, other threads:[~2012-06-12 23:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-07  2:02 [Qemu-devel] [PATCH v2 0/3] Clean up includes of monitor.h Paolo Bonzini
2012-06-07  2:02 ` [Qemu-devel] [PATCH v2 1/3] kvm: add missing include files Paolo Bonzini
2012-06-07  2:02 ` [Qemu-devel] [PATCH v2 2/3] qmp: include monitor.h when needed Paolo Bonzini
2012-06-07  2:02 ` [Qemu-devel] [PATCH v2 3/3] qmp: do not include monitor.h from qapi-types-core.h Paolo Bonzini
2012-06-07  4:55   ` Anthony Liguori
2012-06-07  5:35     ` Paolo Bonzini
2012-06-12 23:06     ` Andreas Färber
2012-06-12 18:57 ` [Qemu-devel] [PATCH v2 0/3] Clean up includes of monitor.h Luiz Capitulino

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.