Paolo Bonzini <pbonz...@redhat.com> writes:
> 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. > > Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> Reviewed-by: Junjie Mao <junjie....@hotmail.com> -- Best Regards Junjie Mao