]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
rust: qdev: make ObjectImpl a supertrait of DeviceImpl
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 7 Jan 2025 11:01:18 +0000 (12:01 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 13 Feb 2025 11:19:33 +0000 (12:19 +0100)
In practice it has to be implemented always in order to access an
implementation of ClassInitImpl<ObjectClass>.  Make the relationship
explicit in the code.

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
rust/qemu-api/src/qdev.rs

index 176c69a56001dd6db1a6cc48d79bb3e1cbe131a6..34d24da4b6377cac35a37484311619a62bfb87e6 100644 (file)
@@ -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).