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: Pavel Butsykin
Subject: Re: [Qemu-devel] [PATCH 2/3] monitor: remove target-specific code from monitor.c
Date: Fri, 28 Aug 2015 17:58:31 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0



On 28.08.2015 13:12, Peter Maydell wrote:
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
Thank you for the suggestion, this seems a good way out.



reply via email to

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