From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v5 RFC 05/14] tools/libxc: noarch common code Date: Wed, 18 Jun 2014 10:19:09 +0100 Message-ID: <1403083149.25771.74.camel@kazak.uk.xensource.com> References: <1402510482-21099-1-git-send-email-andrew.cooper3@citrix.com> <1402510482-21099-6-git-send-email-andrew.cooper3@citrix.com> <1403021435.25771.15.camel@kazak.uk.xensource.com> <53A06CCB.9010304@citrix.com> <1403024015.25771.37.camel@kazak.uk.xensource.com> <53A0886A.7000306@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53A0886A.7000306@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: Andrew Cooper Cc: Frediano Ziglio , David Vrabel , Xen-devel List-Id: xen-devel@lists.xenproject.org On Tue, 2014-06-17 at 19:26 +0100, Andrew Cooper wrote: > On 17/06/14 17:53, Ian Campbell wrote: > > On Tue, 2014-06-17 at 17:28 +0100, Andrew Cooper wrote: > >>>> +// Hack out junk from the namespace > >>> Do you have a plan to not need these hacks? > >> Not really. There are enough other areas of libxc which still use these > >> macros, and I can't go and simply update all other areas as > > I (or rather git grep) can't see the existing definitions/uses > > mfn_to_pfn and pfn_to_mfn outside of xc_domain_{save,restore}.c. Where > > are the defined and used outside of those? > > mfn_to_pfn it turns out isn't. pfn_to_mfn is used once in xc_domain.c. Ah, I grepped for mfn_to_pfn twice so never for pfn_to_mfn... tools/libxc/xc_offline_page.c uses it too BTW. I'd be inclined to namespace this existing function (i.e. prefix xc_*) which will stop it clashing with any use you want to make of the more generic name in the new migration code. > > Likewise for the *_FIELD stuff which is used in ~2 places outside the > > save restore code according to grep. > > xc_core_x86.c defines itself GET_FIELD() so clearly doesn't use > xg_save_restore.h > > xc_resume.c clearly uses xg_save_restore.h but could probably be > converted to be similar to xc_core_x86.c Arguably xc_domain_resume could/should be made part of the new migration infratructure anyway. > >> struct > >> context is meaningless outside of libxc/saverestore. > > So how are these used there? > > > > Ian. > > > > They are not. They are reimplemented in common_x86_pv.h so as to not > take magic locally scoped variables with specific names. Either fix the existing ones to suit your tastes or just bite your tongue and use the existing macros, don't add hacks. Ian.