Browse Source

rust: do not copy the SysBusDevice

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
pull/316/head
Paolo Bonzini 8 months ago
parent
commit
ebf3fb9a53
  1. 2
      rust/hw/core/src/sysbus.rs

2
rust/hw/core/src/sysbus.rs

@ -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

Loading…
Cancel
Save