From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v3 5/6] tools/libxl: Extend datacopier to support reading into a buffer Date: Wed, 1 Apr 2015 16:59:52 +0100 Message-ID: <1427903992.13425.25.camel@citrix.com> References: <1426512594-11585-1-git-send-email-ross.lagerwall@citrix.com> <1426512594-11585-5-git-send-email-ross.lagerwall@citrix.com> <21788.5271.661820.56568@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <21788.5271.661820.56568@mariner.uk.xensource.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 Jackson Cc: Ross Lagerwall , Andrew Cooper , Wei Liu , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, 2015-04-01 at 16:53 +0100, Ian Jackson wrote: > > /* onwrite==1 means failure happened when writing, logged, errnoval is valid > > * onwrite==0 means failure happened when reading > > - * errnoval==0 means we got eof and all data was written > > - * errnoval!=0 means we had a read error, logged > > + * errnoval>=0 means we got eof and all data was written or number of bytes > > + * written when in read mode > > + * errnoval<0 means we had a read error, logged > > I don't like this API. Are you encoding a size in errnoval ? Note that this aspect has since been reverted since it also broke things. Ross was going to look for another way to achieve it, and this: > Perhaps it would be better to include "bytes read" and "bytes written" > fields in the dc state structure. Sounds like a very plausible answer. Ian.