All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools/libxl: Restore errnoval behavior for datacopier callback
@ 2015-03-20 16:04 Ross Lagerwall
  2015-03-20 17:03 ` Ian Campbell
  0 siblings, 1 reply; 2+ messages in thread
From: Ross Lagerwall @ 2015-03-20 16:04 UTC (permalink / raw)
  To: xen-devel
  Cc: andrew.cooper3, Ian Jackson, Ian Campbell, wency, Ross Lagerwall

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@citrix.com>
---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] tools/libxl: Restore errnoval behavior for datacopier callback
  2015-03-20 16:04 [PATCH] tools/libxl: Restore errnoval behavior for datacopier callback Ross Lagerwall
@ 2015-03-20 17:03 ` Ian Campbell
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Campbell @ 2015-03-20 17:03 UTC (permalink / raw)
  To: Ross Lagerwall; +Cc: andrew.cooper3, Ian Jackson, wency, xen-devel

On Fri, 2015-03-20 at 16:04 +0000, Ross Lagerwall wrote:
> 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@citrix.com>

Acked + applied, thanks for the speedy turnaround.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-20 17:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-20 16:04 [PATCH] tools/libxl: Restore errnoval behavior for datacopier callback Ross Lagerwall
2015-03-20 17:03 ` Ian Campbell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.