From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46937) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZVL7x-00052q-Q4 for qemu-devel@nongnu.org; Fri, 28 Aug 2015 10:59:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZVL7u-0007VI-I6 for qemu-devel@nongnu.org; Fri, 28 Aug 2015 10:59:37 -0400 Received: from mx2.parallels.com ([199.115.105.18]:40898) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZVL7u-0007VE-Bv for qemu-devel@nongnu.org; Fri, 28 Aug 2015 10:59:34 -0400 Message-ID: <55E07717.50807@odin.com> Date: Fri, 28 Aug 2015 17:58:31 +0300 From: Pavel Butsykin MIME-Version: 1.0 References: <1439380232-20660-1-git-send-email-den@openvz.org> <1439380232-20660-3-git-send-email-den@openvz.org> <55E02829.6040805@odin.com> In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/3] monitor: remove target-specific code from monitor.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: "Denis V. Lunev" , Luiz Capitulino , QEMU Developers , Paolo Bonzini , Pavel Butsykin On 28.08.2015 13:12, Peter Maydell wrote: > On 28 August 2015 at 10:21, Pavel Butsykin 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.