From: Paolo Bonzini Date: Tue, 7 Jan 2025 11:01:18 +0000 (+0100) Subject: rust: qdev: make ObjectImpl a supertrait of DeviceImpl X-Git-Tag: v10.0.0-rc0~51^2~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=68da5402df003a855c581563acc6f5f8c5d563f0;p=thirdparty%2Fqemu.git rust: qdev: make ObjectImpl a supertrait of DeviceImpl In practice it has to be implemented always in order to access an implementation of ClassInitImpl. Make the relationship explicit in the code. Reviewed-by: Zhao Liu Signed-off-by: Paolo Bonzini --- diff --git a/rust/qemu-api/src/qdev.rs b/rust/qemu-api/src/qdev.rs index 176c69a5600..34d24da4b63 100644 --- a/rust/qemu-api/src/qdev.rs +++ b/rust/qemu-api/src/qdev.rs @@ -17,12 +17,12 @@ use crate::{ callbacks::FnCall, cell::bql_locked, prelude::*, - qom::{ClassInitImpl, ObjectClass, Owned}, + qom::{ClassInitImpl, ObjectClass, ObjectImpl, Owned}, vmstate::VMStateDescription, }; /// Trait providing the contents of [`DeviceClass`]. -pub trait DeviceImpl { +pub trait DeviceImpl: ObjectImpl { /// _Realization_ is the second stage of device creation. It contains /// all operations that depend on device properties and can fail (note: /// this is not yet supported for Rust devices).