From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH Remus v2 02/10] tools/libxc: introduce setup() and cleanup() on save Date: Mon, 11 May 2015 12:49:33 +0100 Message-ID: <1431344973.8263.35.camel@citrix.com> References: <1431077610-3366-1-git-send-email-yanghy@cn.fujitsu.com> <1431077610-3366-3-git-send-email-yanghy@cn.fujitsu.com> <554C85A7.5000103@citrix.com> <554C88F7.2030908@cn.fujitsu.com> <554C8B08.6020409@citrix.com> <555003DE.9090104@cn.fujitsu.com> <1431344839.8263.34.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1431344839.8263.34.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Hongyang Yang Cc: wei.liu2@citrix.com, eddie.dong@intel.com, wency@cn.fujitsu.com, Andrew Cooper , yunhong.jiang@intel.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org, rshriram@cs.ubc.ca List-Id: xen-devel@lists.xenproject.org On Mon, 2015-05-11 at 12:47 +0100, Ian Campbell wrote: > > >> Actually this is another trick that I need to deal with those > > >> hypercall macros. > > >> DECLARE_HYPERCALL_BUFFER_SHADOW will define a user pointer "dirty_bitmap" > > >> and a shadow buffer, although xc_hypercall_buffer_free_pages takes > > >> "dirty_bitmap" as an augument, but it is also a MACRO, without > > >> "if ( dirty_bitmap )", the compiler will report "dirty_bitmap" unused > > >> error... > > > > > > Ah, in which case you would be better using > > > xc__hypercall_buffer_free_pages() and not creating the local shadow in > > > the first place. > > > > I thought we'd better use those MACROs which described in the comments... > > If it is OK to use xc__hypercall_buffer_free_pages(), I will fix it in > > the next version. > > If anything I think I'd prefer for the if to move inside the > xc_hypercall_buffer_free_pages macro. Or if you want to use the "raw" xc__hypercall_buffer variant you should be consistent and do the same on allocation. Ian.