Patchwork [RFC,01/15] cpus.h: include cpu-common.h

login
register
mail settings
Submitter Eduardo Habkost
Date Aug. 7, 2012, 7:56 p.m.
Message ID <1344369413-9053-2-git-send-email-ehabkost@redhat.com>
Download mbox | patch
Permalink /patch/175797/
State New
Headers show

Comments

Eduardo Habkost - Aug. 7, 2012, 7:56 p.m.
Needed for the definition of fprint_function.

This is not necessary right now, but it will be necessary if code that
doesn't include cpu-common.h includes cpus.h.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 cpus.h | 2 ++
 1 file changed, 2 insertions(+)
Igor Mammedov - Aug. 13, 2012, 7:06 p.m.
On 08/07/2012 09:56 PM, Eduardo Habkost wrote:
> Needed for the definition of fprint_function.
>
> This is not necessary right now, but it will be necessary if code that
> doesn't include cpu-common.h includes cpus.h.
could fprint_function declaration be moved somewhere else?
A lot of headers include cpu-common.h just for the sake of these 
simple/independent declarations and forward declared structures 
pointers. Maybe these trivial cases could be moved in separate
header qemu-common-trivial.h. It could replace cpu-common.h in most 
headers and would help to untangle circular deps between cpu-common.h 
and cpu.h and reduce complications when one tries to embed in cpu some 
Device/SysBusDevice as a child.

>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
>   cpus.h | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/cpus.h b/cpus.h
> index 81bd817..061ff7f 100644
> --- a/cpus.h
> +++ b/cpus.h
> @@ -1,6 +1,8 @@
>   #ifndef QEMU_CPUS_H
>   #define QEMU_CPUS_H
>
> +#include "qemu-common.h"
> +
>   /* cpus.c */
>   void qemu_init_cpu_loop(void);
>   void resume_all_vcpus(void);
>

Patch

diff --git a/cpus.h b/cpus.h
index 81bd817..061ff7f 100644
--- a/cpus.h
+++ b/cpus.h
@@ -1,6 +1,8 @@ 
 #ifndef QEMU_CPUS_H
 #define QEMU_CPUS_H
 
+#include "qemu-common.h"
+
 /* cpus.c */
 void qemu_init_cpu_loop(void);
 void resume_all_vcpus(void);