diff mbox

hw/boards: make it safe to include for linux-user

Message ID 20150310183316-mutt-send-email-mst@redhat.com
State New
Headers show

Commit Message

Michael S. Tsirkin March 10, 2015, 5:33 p.m. UTC
Make it safe to include hw/boards.h in exec.c
for linux-user configurations.
We don't need any of its contents though.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---

Already on my tree as Marcel's patches needed this.

 include/hw/boards.h | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Andreas Färber March 10, 2015, 5:34 p.m. UTC | #1
Am 10.03.2015 um 18:33 schrieb Michael S. Tsirkin:
> Make it safe to include hw/boards.h in exec.c
> for linux-user configurations.
> We don't need any of its contents though.
> 
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> 
> Already on my tree as Marcel's patches needed this.

Why? Which patches?

Andreas

> 
>  include/hw/boards.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/include/hw/boards.h b/include/hw/boards.h
> index 1f21bdf..0bf00f7 100644
> --- a/include/hw/boards.h
> +++ b/include/hw/boards.h
> @@ -3,6 +3,8 @@
>  #ifndef HW_BOARDS_H
>  #define HW_BOARDS_H
>  
> +#if !defined(CONFIG_USER_ONLY)
> +
>  #include "qemu/typedefs.h"
>  #include "sysemu/blockdev.h"
>  #include "sysemu/accel.h"
> @@ -154,3 +156,5 @@ struct MachineState {
>  };
>  
>  #endif
> +
> +#endif
>
Michael S. Tsirkin March 10, 2015, 5:41 p.m. UTC | #2
On Tue, Mar 10, 2015 at 06:34:44PM +0100, Andreas Färber wrote:
> Am 10.03.2015 um 18:33 schrieb Michael S. Tsirkin:
> > Make it safe to include hw/boards.h in exec.c
> > for linux-user configurations.
> > We don't need any of its contents though.
> > 
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > ---
> > 
> > Already on my tree as Marcel's patches needed this.
> 
> Why? Which patches?
> 
> Andreas

This one:
    machine: query dump-guest-core machine property rather than qemu opts


> > 
> >  include/hw/boards.h | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/include/hw/boards.h b/include/hw/boards.h
> > index 1f21bdf..0bf00f7 100644
> > --- a/include/hw/boards.h
> > +++ b/include/hw/boards.h
> > @@ -3,6 +3,8 @@
> >  #ifndef HW_BOARDS_H
> >  #define HW_BOARDS_H
> >  
> > +#if !defined(CONFIG_USER_ONLY)
> > +
> >  #include "qemu/typedefs.h"
> >  #include "sysemu/blockdev.h"
> >  #include "sysemu/accel.h"
> > @@ -154,3 +156,5 @@ struct MachineState {
> >  };
> >  
> >  #endif
> > +
> > +#endif
> > 
> 
> 
> -- 
> SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
> GF: Felix Imendörffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu,
> Graham Norton; HRB 21284 (AG Nürnberg)
Andreas Färber March 10, 2015, 5:53 p.m. UTC | #3
Am 10.03.2015 um 18:41 schrieb Michael S. Tsirkin:
> On Tue, Mar 10, 2015 at 06:34:44PM +0100, Andreas Färber wrote:
>> Am 10.03.2015 um 18:33 schrieb Michael S. Tsirkin:
>>> Make it safe to include hw/boards.h in exec.c
>>> for linux-user configurations.
>>> We don't need any of its contents though.
>>>
>>> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
>>> ---
>>>
>>> Already on my tree as Marcel's patches needed this.
>>
>> Why? Which patches?
>>
>> Andreas
> 
> This one:
>     machine: query dump-guest-core machine property rather than qemu opts

Let's please find a better way to fix that. hw/boards.h shouldn't be
used outside softmmu code.

Andreas
Peter Maydell March 10, 2015, 6:04 p.m. UTC | #4
On 10 March 2015 at 17:53, Andreas Färber <afaerber@suse.de> wrote:
> Am 10.03.2015 um 18:41 schrieb Michael S. Tsirkin:
>> On Tue, Mar 10, 2015 at 06:34:44PM +0100, Andreas Färber wrote:
>>> Am 10.03.2015 um 18:33 schrieb Michael S. Tsirkin:
>>>> Make it safe to include hw/boards.h in exec.c
>>>> for linux-user configurations.
>>>> We don't need any of its contents though.
>>>>
>>>> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
>>>> ---
>>>>
>>>> Already on my tree as Marcel's patches needed this.
>>>
>>> Why? Which patches?
>>>
>>> Andreas
>>
>> This one:
>>     machine: query dump-guest-core machine property rather than qemu opts
>
> Let's please find a better way to fix that. hw/boards.h shouldn't be
> used outside softmmu code.

Agreed.

-- PMM
Michael S. Tsirkin March 10, 2015, 9:22 p.m. UTC | #5
On Tue, Mar 10, 2015 at 06:04:20PM +0000, Peter Maydell wrote:
> On 10 March 2015 at 17:53, Andreas Färber <afaerber@suse.de> wrote:
> > Am 10.03.2015 um 18:41 schrieb Michael S. Tsirkin:
> >> On Tue, Mar 10, 2015 at 06:34:44PM +0100, Andreas Färber wrote:
> >>> Am 10.03.2015 um 18:33 schrieb Michael S. Tsirkin:
> >>>> Make it safe to include hw/boards.h in exec.c
> >>>> for linux-user configurations.
> >>>> We don't need any of its contents though.
> >>>>
> >>>> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> >>>> ---
> >>>>
> >>>> Already on my tree as Marcel's patches needed this.
> >>>
> >>> Why? Which patches?
> >>>
> >>> Andreas
> >>
> >> This one:
> >>     machine: query dump-guest-core machine property rather than qemu opts
> >
> > Let's please find a better way to fix that. hw/boards.h shouldn't be
> > used outside softmmu code.
> 
> Agreed.
> 
> -- PMM


What is prefered?

#ifndef USER
#include "hw/boards.h"
#endif

?
diff mbox

Patch

diff --git a/include/hw/boards.h b/include/hw/boards.h
index 1f21bdf..0bf00f7 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -3,6 +3,8 @@ 
 #ifndef HW_BOARDS_H
 #define HW_BOARDS_H
 
+#if !defined(CONFIG_USER_ONLY)
+
 #include "qemu/typedefs.h"
 #include "sysemu/blockdev.h"
 #include "sysemu/accel.h"
@@ -154,3 +156,5 @@  struct MachineState {
 };
 
 #endif
+
+#endif