On 27/10/26 19:38, Brian Cain wrote:
qemu_chr_fe_write() reports failure as -1 with the cause in errno, not
as a negated errno, so errno::into_io_result() turned every failure into
EPERM and a frontend could never see EAGAIN. Build the error from
errno instead, in both CharFrontend::write() and the BQL-free variant.
Also add CharFrontend::add_write_watch() and remove_watch(), so that a
device whose backend would block can retry once it is writable again.
remove_watch() tolerates a source that the backend has already torn
down.
Please split as 2 distinct patches. With that:
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Brian Cain <[email protected]>
---
rust/chardev/src/chardev.rs | 82 +++++++++++++++++++++++++++++--------
1 file changed, 66 insertions(+), 16 deletions(-)