From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Chen, Tiejun" Subject: Re: [v5][PATCH 11/16] tools/libxl: detect and avoid conflicts with RDM Date: Tue, 07 Jul 2015 23:27:38 +0800 Message-ID: <559BEFEA.6010709@intel.com> References: <1436249837-14747-1-git-send-email-tiejun.chen@intel.com> <1436249837-14747-12-git-send-email-tiejun.chen@intel.com> <21915.48835.512123.695897@mariner.uk.xensource.com> <559BE7A8.3020007@intel.com> <21915.59587.186926.310968@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: <21915.59587.186926.310968@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 On 2015/7/7 22:57, Ian Jackson wrote: > Chen, Tiejun writes ("Re: [v5][PATCH 11/16] tools/libxl: detect and avoid conflicts with RDM"): >> On 2015/7/7 19:57, Ian Jackson wrote: >>> I think the error handling here is wrong. Certainly `rc' should not >>> be used for a libxc return. >> >> Nope, we don't return rc directly. In any case of error, rc is reset as >> "ERROR_FAIL" finally. > > Did you see > >>> See tools/libxl/CODING_STYLE. I know that much of the existing code >>> uses rc for libxc returns but this is deprecated, and please don't >>> make more of it. > > this ? > Are you saying this? We should use 'r' as the return value of libxc call int rc = 0, r; r = xc_reserved_device_memory_map(CTX->xch, flag, seg, bus, devfn, NULL, nr_entries); assert(r <= 0); /* "0" means we have no any rdm entry. */ if (!r) goto out; Thanks Tiejun