From: Zhao Liu Date: Tue, 18 Mar 2025 13:02:05 +0000 (+0800) Subject: rust/vmstate: Remove unnecessary unsafe X-Git-Tag: v10.0.0-rc1~2^2~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ea8a7ceba3aafe4de9e7306df663698809e8381a;p=thirdparty%2Fqemu.git rust/vmstate: Remove unnecessary unsafe Remove the `unsafe` block of vmsd, because vmsd (passed to vmstate_struct) is defined in Rust side now, and it doesn't need `unsafe`. Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20250318130219.1799170-2-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- diff --git a/rust/qemu-api/src/vmstate.rs b/rust/qemu-api/src/vmstate.rs index f0510ae769..6698dfe7ae 100644 --- a/rust/qemu-api/src/vmstate.rs +++ b/rust/qemu-api/src/vmstate.rs @@ -447,7 +447,7 @@ macro_rules! vmstate_struct { }, size: ::core::mem::size_of::<$type>(), flags: $crate::bindings::VMStateFlags::VMS_STRUCT, - vmsd: unsafe { $vmsd }, + vmsd: $vmsd, ..$crate::zeroable::Zeroable::ZERO $( .with_varray_flag($crate::call_func_with_field!( $crate::vmstate::vmstate_varray_flag,