Re: [RFC PATCH 5/9] rust: vmstate: implement VMState for scalar types

2025-01-15 Thread Zhao Liu
> > > +impl_vmstate_scalar!(vmstate_info_uint64, u64); > > > > What about applying this to "usize" with vmstate_info_uint64? > > There's 32-bit hosts too... So one would have to add vmstate_info_ulong > which is serialized as 64-bit. > > We can add it later, but perhaps we could also create a

Re: [RFC PATCH 5/9] rust: vmstate: implement VMState for scalar types

2025-01-15 Thread Paolo Bonzini
On 1/8/25 07:45, Zhao Liu wrote: #[macro_export] macro_rules! vmstate_of { -($struct_name:ty, $field_name:ident $([0 .. $num:ident $(* $factor:expr)?])? $(,)?) => { +($struct_name:ty, $field_name:ident $([0 .. $num:tt $(* $factor:expr)?])? $(,)?) => { Why change ident to tt? Reb

Re: [RFC PATCH 5/9] rust: vmstate: implement VMState for scalar types

2025-01-07 Thread Zhao Liu
> #[macro_export] > macro_rules! vmstate_of { > -($struct_name:ty, $field_name:ident $([0 .. $num:ident $(* > $factor:expr)?])? $(,)?) => { > +($struct_name:ty, $field_name:ident $([0 .. $num:tt $(* > $factor:expr)?])? $(,)?) => { Why change ident to tt? > $crate::bindings::

[RFC PATCH 5/9] rust: vmstate: implement VMState for scalar types

2024-12-30 Thread Paolo Bonzini
Scalar types are those that have their own VMStateInfo. This poses a problem in that references to VMStateInfo can only be included in associated consts starting with Rust 1.83.0, when the const_refs_static was stabilized. Removing the requirement is done by placing a limited list of VMStateInfos