summary refs log tree commit diff stats
path: root/rust/qemu-api/src/assertions.rs (follow)
Commit message (Collapse)AuthorAgeFilesLines
* rust: add module to convert between success/-errno and io::ResultPaolo Bonzini2025-02-251-0/+28
| | | | | | | | | | | | | 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>
* rust: qemu_api: add a documentation header for all modulesPaolo Bonzini2025-02-131-0/+4
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* rust: add a utility module for compile-time type checksPaolo Bonzini2025-01-101-0/+90
It is relatively common in the low-level qemu_api code to assert that a field of a struct has a specific type; for example, it can be used to ensure that the fields match what the qemu_api and C code expects for safety. Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>