mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-29 21:33:53 -06:00
rust: add module to convert between success/-errno and io::Result
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>
This commit is contained in:
parent
4cfe9edb1b
commit
8a420dd109
6 changed files with 381 additions and 0 deletions
|
@ -9,6 +9,8 @@ pub use crate::bitops::IntegerExt;
|
|||
pub use crate::cell::BqlCell;
|
||||
pub use crate::cell::BqlRefCell;
|
||||
|
||||
pub use crate::errno;
|
||||
|
||||
pub use crate::qdev::DeviceMethods;
|
||||
|
||||
pub use crate::qom::InterfaceType;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue