From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v3 04/24] xen: guestcopy: Provide an helper to safely copy string from guest Date: Fri, 20 Feb 2015 15:22:24 +0000 Message-ID: <1424445744.30924.297.camel@citrix.com> 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" 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 1YOplv-0000iN-4Z for xen-devel@lists.xenproject.org; Fri, 20 Feb 2015 15:45:43 +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 Cc: Keir Fraser , Ian Jackson , tim@xen.org, stefano.stabellini@citrix.com, Jan Beulich , xen-devel@lists.xenproject.org, Daniel De Graaf List-Id: xen-devel@lists.xenproject.org On Tue, 2015-01-13 at 14:25 +0000, Julien Grall wrote: > Flask code already provides an helper to copy a string from guest. In a later "a helper". > 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 "Return the buffer directly and...". > xen/err.h to return an error code if necessary. > > Signed-off-by: Julien Grall > Cc: Daniel De Graaf > Cc: Ian Jackson > Cc: Jan Beulich > Cc: Keir Fraser Acked-by: Ian Campbell