[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 12/15] rust: sysbus: wrap SysBusDevice with Opaque<>
From: |
Zhao Liu |
Subject: |
Re: [PATCH 12/15] rust: sysbus: wrap SysBusDevice with Opaque<> |
Date: |
Tue, 25 Feb 2025 16:59:52 +0800 |
On Fri, Feb 21, 2025 at 06:03:39PM +0100, Paolo Bonzini wrote:
> Date: Fri, 21 Feb 2025 18:03:39 +0100
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: [PATCH 12/15] rust: sysbus: wrap SysBusDevice with Opaque<>
> X-Mailer: git-send-email 2.48.1
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> rust/hw/timer/hpet/src/hpet.rs | 2 +-
> rust/qemu-api/src/bindings.rs | 3 ---
> rust/qemu-api/src/sysbus.rs | 25 ++++++++++++++++++-------
> 3 files changed, 19 insertions(+), 11 deletions(-)
>
> diff --git a/rust/hw/timer/hpet/src/hpet.rs b/rust/hw/timer/hpet/src/hpet.rs
> index be27eb0eff4..19e63465cff 100644
> --- a/rust/hw/timer/hpet/src/hpet.rs
> +++ b/rust/hw/timer/hpet/src/hpet.rs
> @@ -741,7 +741,7 @@ fn reset_hold(&self, _type: ResetType) {
> HPETFwConfig::update_hpet_cfg(
> self.hpet_id.get(),
> self.capability.get() as u32,
> - sbd.mmio[0].addr,
> + unsafe { *sbd.as_ptr() }.mmio[0].addr,
We can wrap this unsafe code into SysBusDeviceMethods...then the device
won't introduce more unsafe code.
> );
>
> // to document that the RTC lowers its output on reset as well
Others, fine for me,
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
- Re: [PATCH 07/15] rust: qemu_api_macros: add Wrapper derive macro, (continued)
- [PATCH 10/15] rust: qom: wrap Object with Opaque<>, Paolo Bonzini, 2025/02/21
- [PATCH 12/15] rust: sysbus: wrap SysBusDevice with Opaque<>, Paolo Bonzini, 2025/02/21
- Re: [PATCH 12/15] rust: sysbus: wrap SysBusDevice with Opaque<>,
Zhao Liu <=
- [PATCH 11/15] rust: qdev: wrap Clock and DeviceState with Opaque<>, Paolo Bonzini, 2025/02/21
- [PATCH 13/15] rust: memory: wrap MemoryRegion with Opaque<>, Paolo Bonzini, 2025/02/21
- [PATCH 14/15] rust: chardev: wrap Chardev with Opaque<>, Paolo Bonzini, 2025/02/21
- [PATCH 15/15] rust: bindings: remove more unnecessary Send/Sync impls, Paolo Bonzini, 2025/02/21