From: Ross Lagerwall Date: Fri, 20 Mar 2015 16:04:14 +0000 (+0000) Subject: tools/libxl: Restore errnoval behavior for datacopier callback X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=916735e1814d4d6df0d90b871b0666cdfaf134cd;p=people%2Fpauldu%2Fxen.git tools/libxl: Restore errnoval behavior for datacopier callback 6d896e1357ff ("tools/libxl: Extend datacopier to support reading into a buffer") changed the semantics of the errnoval parameter for the datacopier callback without updating all callers. Restore the original behavior for now. Signed-off-by: Ross Lagerwall Acked-by: Ian Campbell --- diff --git a/tools/libxl/libxl_aoutils.c b/tools/libxl/libxl_aoutils.c index 0d4c8af345..3b77286904 100644 --- a/tools/libxl/libxl_aoutils.c +++ b/tools/libxl/libxl_aoutils.c @@ -148,7 +148,7 @@ static void datacopier_check_state(libxl__egc *egc, libxl__datacopier_state *dc) } else if (!libxl__ev_fd_isregistered(&dc->toread) || dc->bytes_to_read == 0) { /* we have had eof */ - datacopier_callback(egc, dc, 0, dc->readbuf ? dc->used : 0); + datacopier_callback(egc, dc, 0, 0); return; } else { /* nothing buffered, but still reading */ diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index 51f0601146..904567eb6e 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -2527,9 +2527,8 @@ typedef struct libxl__datacopier_buf libxl__datacopier_buf; /* 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 or number of bytes - * written when in read mode - * errnoval<0 means we had a read error, logged + * errnoval==0 means we got eof and all data was written + * errnoval!=0 means we had a read error, logged * onwrite==-1 means some other internal failure, errnoval not valid, logged * If we get POLLHUP, we call callback_pollhup(..., onwrite, -1); * or if callback_pollhup==0 this is an internal failure, as above.