]> git.ipfire.org Git - thirdparty/qemu.git/commit
rust: add definitions for vmstate
authorManos Pitsidianakis <manos.pitsidianakis@linaro.org>
Fri, 25 Oct 2024 05:55:50 +0000 (07:55 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 5 Nov 2024 13:18:16 +0000 (14:18 +0100)
commit0a65e4124ad9c6dab594d738cac31fd32d19402c
tree38bc823e1ede73b98a953a4e6fae3a7e6ac314ec
parentf60f3670fd15edaa9dc6471dde26703b4417b815
rust: add definitions for vmstate

Add a new qemu_api module, `vmstate`. Declare a bunch of Rust
macros declared that are equivalent in spirit to the C macros in
include/migration/vmstate.h.

For example the Rust of equivalent of the C macro:

  VMSTATE_UINT32(field_name, struct_name)

is:

  vmstate_uint32!(field_name, StructName)

This breathtaking development will allow us to reach feature parity between
the Rust and C pl011 implementations.

Extracted from a patch by Manos Pitsidianakis
(https://lore.kernel.org/qemu-devel/20241024-rust-round-2-v1-4-051e7a25b978@linaro.org/).

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
rust/qemu-api/meson.build
rust/qemu-api/src/device_class.rs
rust/qemu-api/src/lib.rs
rust/qemu-api/src/vmstate.rs [new file with mode: 0644]
rust/qemu-api/tests/tests.rs