diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2025-05-23 18:31:29 +0200 |
|---|---|---|
| committer | Paolo Bonzini <pbonzini@redhat.com> | 2025-06-06 14:32:53 +0200 |
| commit | 4b66abead9c9c7b637fb87e6bf782a45eee2a621 (patch) | |
| tree | 28d39eced641144ec969a6ce44ff94599016da08 /rust/hw/timer | |
| parent | 9a33f49f44453b2914dc2e9be2633c0dfcb9e267 (diff) | |
| download | focaccia-qemu-4b66abead9c9c7b637fb87e6bf782a45eee2a621.tar.gz focaccia-qemu-4b66abead9c9c7b637fb87e6bf782a45eee2a621.zip | |
rust: qdev: support returning errors from realize
Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'rust/hw/timer')
| -rw-r--r-- | rust/hw/timer/hpet/src/device.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/rust/hw/timer/hpet/src/device.rs b/rust/hw/timer/hpet/src/device.rs index e3ba62b287..68c82b09b6 100644 --- a/rust/hw/timer/hpet/src/device.rs +++ b/rust/hw/timer/hpet/src/device.rs @@ -724,7 +724,7 @@ impl HPETState { } } - fn realize(&self) { + fn realize(&self) -> qemu_api::Result<()> { if self.int_route_cap == 0 { // TODO: Add error binding: warn_report() println!("Hpet's hpet-intcap property not initialized"); @@ -751,6 +751,7 @@ impl HPETState { self.init_gpio_in(2, HPETState::handle_legacy_irq); self.init_gpio_out(from_ref(&self.pit_enabled)); + Ok(()) } fn reset_hold(&self, _type: ResetType) { @@ -1042,7 +1043,7 @@ impl DeviceImpl for HPETState { Some(&VMSTATE_HPET) } - const REALIZE: Option<fn(&Self)> = Some(Self::realize); + const REALIZE: Option<fn(&Self) -> qemu_api::Result<()>> = Some(Self::realize); } impl ResettablePhasesImpl for HPETState { |