]> git.ipfire.org Git - thirdparty/qemu.git/commit
rust: chardev: provide basic bindings to character devices
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 14 Feb 2025 11:41:14 +0000 (12:41 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 6 Mar 2025 11:44:47 +0000 (12:44 +0100)
commit2d0050cbe27fed5233561451e6de64af5ecb6571
treef87b1f1c7c62a81cf86b47385fb82e6760c71c6a
parent2ad011d466697d69f7f9aa84662a6553049f6556
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>
rust/qemu-api/meson.build
rust/qemu-api/src/chardev.rs
rust/qemu-api/src/zeroable.rs