summary refs log tree commit diff stats
path: root/rust/qemu-api/src/zeroable.rs
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2025-02-14 12:41:14 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2025-03-06 12:44:47 +0100
commit2d0050cbe27fed5233561451e6de64af5ecb6571 (patch)
treef87b1f1c7c62a81cf86b47385fb82e6760c71c6a /rust/qemu-api/src/zeroable.rs
parent2ad011d466697d69f7f9aa84662a6553049f6556 (diff)
downloadfocaccia-qemu-2d0050cbe27fed5233561451e6de64af5ecb6571.tar.gz
focaccia-qemu-2d0050cbe27fed5233561451e6de64af5ecb6571.zip
rust: chardev: provide basic bindings to character devices
Most of the character device API is pretty simple, with "0 or -errno"
or "number of bytes or -errno" as the convention for return codes.
Add safe wrappers for the API to the CharBackend bindgen-generated
struct.

The API is not complete, but it covers the parts that are used
by the PL011 device, plus qemu_chr_fe_write which is needed to
implement the standard library Write trait.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'rust/qemu-api/src/zeroable.rs')
-rw-r--r--rust/qemu-api/src/zeroable.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/rust/qemu-api/src/zeroable.rs b/rust/qemu-api/src/zeroable.rs
index 47b6977828..a3415a2ebc 100644
--- a/rust/qemu-api/src/zeroable.rs
+++ b/rust/qemu-api/src/zeroable.rs
@@ -106,3 +106,4 @@ impl_zeroable!(crate::bindings::MemoryRegionOps__bindgen_ty_1);
 impl_zeroable!(crate::bindings::MemoryRegionOps__bindgen_ty_2);
 impl_zeroable!(crate::bindings::MemoryRegionOps);
 impl_zeroable!(crate::bindings::MemTxAttrs);
+impl_zeroable!(crate::bindings::CharBackend);