aboutsummaryrefslogtreecommitdiff
path: root/rust/qemu-api-macros
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2025-05-02 10:56:06 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2025-05-02 17:37:46 +0200
commitfff99a88be34c82270c918b711f8fc3affd504d5 (patch)
tree704235d8e1ae34e545de488c8d51d96a339cebbf /rust/qemu-api-macros
parent756ea88fff96252dd76cf388fb8678cb97dd2658 (diff)
downloadqemu-fff99a88be34c82270c918b711f8fc3affd504d5.zip
qemu-fff99a88be34c82270c918b711f8fc3affd504d5.tar.gz
qemu-fff99a88be34c82270c918b711f8fc3affd504d5.tar.bz2
rust: assertions: Support index field wrapped in BqlCell
Currently, if the `num` field of a varray is not a numeric type, such as being placed in a wrapper, the array variant of assert_field_type will fail the check. HPET currently wraps num_timers in BqlCell<>. Although BqlCell<> is not necessary from strictly speaking, it makes sense for vmstate to respect BqlCell. The failure of assert_field_type is because it cannot convert BqlCell<T> into usize for use as the index. Use a constant 0 instead for the index, by avoiding $(...)? and extracting the common parts of assert_field_type! into an internal case. Commit message based on a patch by Zhao Liu <zhao1.liu@intel.com>. Link: https://lore.kernel.org/r/20250414144943.1112885-3-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'rust/qemu-api-macros')
0 files changed, 0 insertions, 0 deletions