xemu/rust
Paolo Bonzini c92c447ff0 rust: make properties array immutable
Now that device_class_set_props() takes a const pointer, the only part of
"define_property!" that needs to be non-const is the call to try_into().
This in turn will only break if offset_of returns a value with the most
significant bit set (i.e. a struct size that is >=2^31 or >= 2^63,
respectively on 32- and 64-bit system), which is impossible.

Just use a cast and clean everything up to remove the run-time
initialization.  This also removes a use of OnceLock, which was only
stabilized in 1.70.0.

Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-11-05 14:18:16 +01:00
..
hw rust: remove uses of #[no_mangle] 2024-11-05 14:18:15 +01:00
qemu-api rust: make properties array immutable 2024-11-05 14:18:16 +01:00
qemu-api-macros rust: cleanup module_init!, use it from #[derive(Object)] 2024-11-05 14:18:15 +01:00
.gitignore rust: add bindgen step as a meson dependency 2024-10-11 12:32:17 +02:00
Kconfig rust: add PL011 device model 2024-11-05 14:18:15 +01:00
meson.build rust: add PL011 device model 2024-11-05 14:18:15 +01:00
rustfmt.toml rust: add crate to expose bindings and interfaces 2024-10-11 12:32:17 +02:00
wrapper.h rust/wrapper.h: define memory_order enum 2024-11-05 14:18:15 +01:00