Re: [Xen-devel] [PATCH v3 04/24] xen: guestcopy: Provide an helper to safely copy string from guest

2015-02-20 Thread Ian Campbell
On Tue, 2015-01-13 at 14:25 +, 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

Re: [Xen-devel] [PATCH v3 04/24] xen: guestcopy: Provide an helper to safely copy string from guest

2015-01-20 Thread Jan Beulich
>>> On 20.01.15 at 13:45, wrote: > On 19/01/15 16:51, Jan Beulich wrote: > On 13.01.15 at 15:25, wrote: >>> +void *safe_copy_string_from_guest(XEN_GUEST_HANDLE(char) u_buf, >>> + size_t size, size_t max_size) >> >> Is the "safe_" prefix really meaningful? I.e

Re: [Xen-devel] [PATCH v3 04/24] xen: guestcopy: Provide an helper to safely copy string from guest

2015-01-20 Thread Julien Grall
Hi Jan, On 19/01/15 16:51, Jan Beulich wrote: On 13.01.15 at 15:25, wrote: >> --- /dev/null >> +++ b/xen/common/guestcopy.c >> @@ -0,0 +1,30 @@ >> +#include >> +#include >> +#include >> +#include >> + >> +/* The function copies a string from the guest and adds a NUL to >> + * make sure t

Re: [Xen-devel] [PATCH v3 04/24] xen: guestcopy: Provide an helper to safely copy string from guest

2015-01-19 Thread Jan Beulich
>>> On 13.01.15 at 15:25, wrote: > --- /dev/null > +++ b/xen/common/guestcopy.c > @@ -0,0 +1,30 @@ > +#include > +#include > +#include > +#include > + > +/* The function copies a string from the guest and adds a NUL to > + * make sure the string is correctly terminated. > + */ Coding style.

Re: [Xen-devel] [PATCH v3 04/24] xen: guestcopy: Provide an helper to safely copy string from guest

2015-01-13 Thread Daniel De Graaf
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_cop

[Xen-devel] [PATCH v3 04/24] xen: guestcopy: Provide an helper to safely copy string from guest

2015-01-13 Thread Julien Grall
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 explai