]> git.ipfire.org Git - thirdparty/qemu.git/commit
rust/qemu-api: Add initial logging support based on C API
authorBernhard Beschow <shentey@gmail.com>
Sun, 15 Jun 2025 11:20:34 +0000 (13:20 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 20 Jun 2025 11:25:59 +0000 (13:25 +0200)
commitab81002252af101068fca94bc82b31ba59ff154b
tree6b4d3837e312bc5406d058dc17f160d886bc8a76
parent1ae4ca0463d737ead1162c35b267ef5882d42883
rust/qemu-api: Add initial logging support based on C API

A log_mask_ln!() macro is provided which expects similar arguments as the
C version. However, the formatting works as one would expect from Rust.

To maximize code reuse the macro is just a thin wrapper around
qemu_log(). Also, just the bare minimum of logging masks is provided
which should suffice for the current use case of Rust in QEMU.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Link: https://lore.kernel.org/r/20250615112037.11992-2-shentey@gmail.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
docs/devel/rust.rst
rust/qemu-api/meson.build
rust/qemu-api/src/lib.rs
rust/qemu-api/src/log.rs [new file with mode: 0644]
rust/qemu-api/src/prelude.rs
rust/qemu-api/wrapper.h