summary refs log tree commit diff stats
path: root/rust/qemu-api/src/errno.rs (follow)
Commit message (Collapse)AuthorAgeFilesLines
* rust: add module to convert between success/-errno and io::ResultPaolo Bonzini2025-02-251-0/+345
It is a common convention in QEMU to return a positive value in case of success, and a negated errno value in case of error. Unfortunately, using errno portably in Rust is a bit complicated; on Unix the errno values are supported natively by io::Error, but on Windows they are not; so, use the libc crate. This is a set of utility functions that are used by both chardev and block layer bindings. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>