]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
rust: do not copy the SysBusDevice
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 26 Nov 2025 12:39:08 +0000 (13:39 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 27 Dec 2025 09:11:09 +0000 (10:11 +0100)
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
rust/hw/core/src/sysbus.rs

index 68165e8929557c3caaa4ccb87895b183d9af0ce7..ec620639be5739f083e2f2d79e5ee84604fc2cc5 100644 (file)
@@ -78,7 +78,7 @@ where
         assert!(bql::is_locked());
         // SAFETY: the BQL ensures that no one else writes to sbd.mmio[], and
         // the SysBusDevice must be initialized to get an IsA<SysBusDevice>.
-        let sbd = unsafe { *self.upcast().as_ptr() };
+        let sbd = unsafe { &*self.upcast().as_ptr() };
         let id: usize = id.try_into().unwrap();
         if sbd.mmio[id].memory.is_null() {
             None