On 9/16/25 10:55, Zhao Liu wrote:
Add BIT_INFO to QDevProp trait, so that bit related property info could
be bound to u32 & u64.

Then add "bit=*" field in #property attributes macro to allow device to
configure bit property.

In addtion, convert the #property field parsing from `if-else` pattern
to `match` pattern, to help readability. And note, the `bitnr` member of
`Property` struct is generated by manual TokenStream construction,
instead of conditional repetition (like #(bitnr: #bitnr,)?) since
`quote` doesn't support this.

We're almost certainly going to have more attribute parsing for ToMigrationState, therefore IMO it's time to drop the handwritten parser in favor of https://lore.kernel.org/qemu-devel/20250717062727.305466-1-pbonz...@redhat.com/. Then the extra parsing would be just one line:

+        parser.once("bitnr", with::eq(set::parse(&mut self.bitnr)));

No other complaint!

Paolo


Reply via email to