[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 06/12] rust: qdev: make ObjectImpl a supertrait of DeviceImpl
From: |
Paolo Bonzini |
Subject: |
[PATCH 06/12] rust: qdev: make ObjectImpl a supertrait of DeviceImpl |
Date: |
Fri, 7 Feb 2025 11:16:17 +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 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rust/qemu-api/src/qdev.rs b/rust/qemu-api/src/qdev.rs
index 8f6744c5e26..cb6f12e726c 100644
--- a/rust/qemu-api/src/qdev.rs
+++ b/rust/qemu-api/src/qdev.rs
@@ -17,12 +17,12 @@
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).
--
2.48.1
- Re: [PATCH 02/12] rust: qom: add object creation functionality, (continued)
- [PATCH 04/12] rust: qdev: add clock creation, Paolo Bonzini, 2025/02/07
- [PATCH 01/12] rust: qom: add reference counting functionality, Paolo Bonzini, 2025/02/07
- [PATCH 03/12] rust: callbacks: allow passing optional callbacks as (), Paolo Bonzini, 2025/02/07
- [PATCH 07/12] rust: qdev: switch from legacy reset to Resettable, Paolo Bonzini, 2025/02/07
- [PATCH 05/12] rust: qom: allow initializing interface vtables, Paolo Bonzini, 2025/02/07
- [PATCH 06/12] rust: qdev: make ObjectImpl a supertrait of DeviceImpl,
Paolo Bonzini <=
- [PATCH 10/12] rust: irq: define ObjectType for IRQState, Paolo Bonzini, 2025/02/07
- [PATCH 09/12] rust: bindings for MemoryRegionOps, Paolo Bonzini, 2025/02/07
- [PATCH 08/12] rust: bindings: add Send and Sync markers for types that have bindings, Paolo Bonzini, 2025/02/07
- [PATCH 11/12] rust: chardev, qdev: add bindings to qdev_prop_set_chr, Paolo Bonzini, 2025/02/07
- [PATCH 12/12] rust: pl011: convert pl011_create to safe Rust, Paolo Bonzini, 2025/02/07