|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH] 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 <ross.lagerwall@xxxxxxxxxx>
---
tools/libxl/libxl_aoutils.c | 2 +-
tools/libxl/libxl_internal.h | 5 ++---
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/tools/libxl/libxl_aoutils.c b/tools/libxl/libxl_aoutils.c
index 0d4c8af..3b77286 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 931c00c..269d2cd 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -2524,9 +2524,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.
--
2.1.0
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |