From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel De Graaf Subject: Re: [PATCH v3 04/24] xen: guestcopy: Provide an helper to safely copy string from guest Date: Tue, 13 Jan 2015 10:10:59 -0500 Message-ID: <54B53583.2010501@tycho.nsa.gov> References: <1421159133-31526-1-git-send-email-julien.grall@linaro.org> <1421159133-31526-5-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YB380-0007zH-BM for xen-devel@lists.xenproject.org; Tue, 13 Jan 2015 15:11:32 +0000 In-Reply-To: <1421159133-31526-5-git-send-email-julien.grall@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall , xen-devel@lists.xenproject.org Cc: Keir Fraser , ian.campbell@citrix.com, tim@xen.org, Ian Jackson , stefano.stabellini@citrix.com, Jan Beulich List-Id: xen-devel@lists.xenproject.org On 01/13/2015 09:25 AM, Julien Grall wrote: > Flask code already provides an helper to copy a string from guest. In a later > patch, the new DT hypercalls will need a similar function. > > To avoid code duplication, copy the flask helper (flask_copying_string) to > common code: > - Rename into safe_copy_string_from_guest > - Add comment to explain the extra +1 > - Return directly the buffer and use the macros provided by > xen/err.h to return an error code if necessary. > > Signed-off-by: Julien Grall Acked-by: Daniel De Graaf