From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH v2 4/6] tools/libxl: Allow limiting amount copied by datacopier Date: Wed, 11 Mar 2015 12:23:28 +0000 Message-ID: <550033C0.8000703@citrix.com> References: <1425668741-28003-1-git-send-email-andrew.cooper3@citrix.com> <1425668741-28003-5-git-send-email-andrew.cooper3@citrix.com> <1426076122.21353.217.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1426076122.21353.217.camel@citrix.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 Campbell Cc: Ross Lagerwall , Ian Jackson , Wei Liu , Xen-devel List-Id: xen-devel@lists.xenproject.org On 11/03/15 12:15, Ian Campbell wrote: > On Fri, 2015-03-06 at 19:05 +0000, Andrew Cooper wrote: >> From: Ross Lagerwall >> >> 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)? ssize_t bytes_to_read perhaps? with -1 being a sentinel for "until EOF" ? ~Andrew