qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/3] monitor: remove target-specific code from m


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 2/3] monitor: remove target-specific code from monitor.c
Date: Fri, 28 Aug 2015 11:12:08 +0100

On 28 August 2015 at 10:21, Pavel Butsykin <address@hidden> wrote:
> Yes, this is a good way if we make the interface: const MonitorDef
> *target_monitor_defs(void);
> But we can't include the 'monitor/monitor-common.h' to
> stubs/target-monitor-defs.c, because
> there is a dependency with a target-specific headers( such as
> cpu.h:CPUArchState, cpu-defs.h:target_long).
> Make a copy of the struct MonitorDef not a good way because we can miss the
> change of copied MonitorDef
> in stubs/target-monitor-defs.c and this will result in an bug. Can this be
> solved somehow else?

That target_long is awkward. I suggest making the stub version
just return NULL rather than a pointer to an empty list (you'll
need to adjust the calling code slightly to handle the NULL
return). Then the stub code only needs to be able to see the
'typedef struct MonitorDef MonitorDef' (which you can put in
qemu-typedefs.h).

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]