mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
tools/libxl: Restore errnoval behavior for datacopier callback
6d896e1357 ("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@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
This commit is contained in:
1 parent
cd2f100f0f
commit
916735e181
2 files changed
+3
-4
No files matched your search
@@ -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 */
|
||||
|
||||
@@ -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.
|
||||
|
||||