]> Git Repo - qemu.git/commitdiff
main-loop: document IOCanReadHandler
authorStefan Hajnoczi <[email protected]>
Sat, 2 Jun 2018 08:52:59 +0000 (09:52 +0100)
committerPaolo Bonzini <[email protected]>
Thu, 28 Jun 2018 17:05:30 +0000 (19:05 +0200)
Signed-off-by: Stefan Hajnoczi <[email protected]>
Message-Id: <20180602085259[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
include/qemu/main-loop.h

index 6b4b60bf6d2de585d9adfa426696915263449f55..721aa2416a8082a07bcb1c1b6b94931f3f782699 100644 (file)
@@ -168,6 +168,20 @@ void qemu_del_wait_object(HANDLE handle, WaitObjectFunc *func, void *opaque);
 /* async I/O support */
 
 typedef void IOReadHandler(void *opaque, const uint8_t *buf, int size);
+
+/**
+ * IOCanReadHandler: Return the number of bytes that #IOReadHandler can accept
+ *
+ * This function reports how many bytes #IOReadHandler is prepared to accept.
+ * #IOReadHandler may be invoked with up to this number of bytes.  If this
+ * function returns 0 then #IOReadHandler is not invoked.
+ *
+ * This function is typically called from an event loop.  If the number of
+ * bytes changes outside the event loop (e.g. because a vcpu thread drained the
+ * buffer), then it is necessary to kick the event loop so that this function
+ * is called again.  aio_notify() or qemu_notify_event() can be used to kick
+ * the event loop.
+ */
 typedef int IOCanReadHandler(void *opaque);
 
 /**
This page took 0.026837 seconds and 4 git commands to generate.