mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
rust: qdev: support returning errors from realize
Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
9a33f49f44
commit
4b66abead9
3 changed files with 14 additions and 8 deletions
|
@ -175,7 +175,7 @@ impl DeviceImpl for PL011State {
|
|||
fn vmsd() -> Option<&'static VMStateDescription> {
|
||||
Some(&device_class::VMSTATE_PL011)
|
||||
}
|
||||
const REALIZE: Option<fn(&Self)> = Some(Self::realize);
|
||||
const REALIZE: Option<fn(&Self) -> qemu_api::Result<()>> = Some(Self::realize);
|
||||
}
|
||||
|
||||
impl ResettablePhasesImpl for PL011State {
|
||||
|
@ -619,9 +619,10 @@ impl PL011State {
|
|||
}
|
||||
}
|
||||
|
||||
fn realize(&self) {
|
||||
fn realize(&self) -> qemu_api::Result<()> {
|
||||
self.char_backend
|
||||
.enable_handlers(self, Self::can_receive, Self::receive, Self::event);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn reset_hold(&self, _type: ResetType) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue