From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Chen, Tiejun" Subject: Re: [v7][PATCH 11/16] tools/libxl: detect and avoid conflicts with RDM Date: Mon, 13 Jul 2015 17:19:08 +0800 Message-ID: <55A3828C.9080604@intel.com> References: <1436420047-25356-1-git-send-email-tiejun.chen@intel.com> <1436420047-25356-12-git-send-email-tiejun.chen@intel.com> <21918.47614.887667.234848@mariner.uk.xensource.com> <559F39DB.8030106@intel.com> <21919.39692.335512.864741@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <21919.39692.335512.864741@mariner.uk.xensource.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: Ian Jackson Cc: Stefano Stabellini , Wei Liu , Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >> Do you mean I should merge them as one as possible? > > "Factor it out" means to break out into a separate function (or maybe > a macro or something, but in this case a function is appropriate). So > in this case take the two sets of similar code, combine them into a > function with appropriate arguments, and then call that function in > both places. > > Finding multiple occurrences of very similar code is usually a sign > that refactoring is needed. > Thanks for you explanation. >> But seems not be possible because we have seveal combinations of these >> two conditions, strategy = LIBXL_RDM_RESERVE_STRATEGY_HOST and one or >> pci devices are also passes through. > [snip] >> Sorry I can't figure out a good name here :) Any suggestions? > > The hypervisor seems to call this `pfn_to_paddr'. Okay. Thanks Tiejun