[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 4/6] tools/libxl: Allow limiting amount copied by datacopier



On Fri, 2015-03-06 at 19:05 +0000, Andrew Cooper wrote:
> From: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
> 
> Currently, a datacopier will unconditionally read until EOF on its read fd.
> 
> For migration v2, libxl needs to read records of a specific length out of the
> migration stream, without reading any further data.
> 
> Introduce a parameter, maxread, which may be used to stop the datacopier ahead
> of reaching EOF.

maxread is ok as a parameter but not really in the dc.

It's unfortunate that "toread" is already used. Perhaps "remaining" (or
remread if you want to get terse)?

> diff --git a/tools/libxl/libxl_bootloader.c b/tools/libxl/libxl_bootloader.c
> index 79947d4..1503101 100644
> --- a/tools/libxl/libxl_bootloader.c
> +++ b/tools/libxl/libxl_bootloader.c
> @@ -516,6 +516,7 @@ static void bootloader_gotptys(libxl__egc *egc, 
> libxl__openpty_state *op)
>  
>      bl->keystrokes.ao = ao;
>      bl->keystrokes.maxsz = BOOTLOADER_BUF_OUT;
> +    bl->keystrokes.maxread = INT_MAX;

SSIZE_MAX exists for this I think.

But, doesn't this mean that if the bootloader receives INT_MAX (or
SIZE_MAX) keystrokes it will mysteriously stop working? Or do we already
have that via maxsz?



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.