On Mon, Jun 09, 2025 at 05:44:20PM +0200, Paolo Bonzini wrote: > Date: Mon, 9 Jun 2025 17:44:20 +0200 > From: Paolo Bonzini <pbonz...@redhat.com> > Subject: [PATCH 2/5] rust: hpet: fully initialize object after instance_init > X-Mailer: git-send-email 2.49.0 > > The array of BqlRefCell<HPETTimer> is not initialized yet at the > end of instance_init. In particular, the "state" field is NonNull > and therefore it is invalid to have it as zero bytes. > > Note that MaybeUninit is necessary because assigning to self.timers[index] > would trigger Drop of the old value. > > Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> > --- > rust/hw/timer/hpet/src/device.rs | 42 +++++++++++++++++++------------- > 1 file changed, 25 insertions(+), 17 deletions(-)
Reviewed-by: Zhao Liu <zhao1....@intel.com>