[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 41/49] rust: qom: add default definitions for ObjectImpl
From: |
Paolo Bonzini |
Subject: |
[PULL 41/49] rust: qom: add default definitions for ObjectImpl |
Date: |
Wed, 11 Dec 2024 17:27:11 +0100 |
Remove a bunch of duplicate const definitions.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
rust/hw/char/pl011/src/device.rs | 6 ------
rust/qemu-api/src/definitions.rs | 8 ++++----
rust/qemu-api/tests/tests.rs | 4 ----
3 files changed, 4 insertions(+), 14 deletions(-)
diff --git a/rust/hw/char/pl011/src/device.rs b/rust/hw/char/pl011/src/device.rs
index c5c8c463d37..3d173ae816d 100644
--- a/rust/hw/char/pl011/src/device.rs
+++ b/rust/hw/char/pl011/src/device.rs
@@ -109,10 +109,7 @@ impl ObjectImpl for PL011State {
const TYPE_INFO: qemu_api::bindings::TypeInfo = qemu_api::type_info! {
Self };
const TYPE_NAME: &'static CStr = crate::TYPE_PL011;
const PARENT_TYPE_NAME: Option<&'static CStr> = Some(TYPE_SYS_BUS_DEVICE);
- const ABSTRACT: bool = false;
const INSTANCE_INIT: Option<unsafe extern "C" fn(obj: *mut Object)> =
Some(pl011_init);
- const INSTANCE_POST_INIT: Option<unsafe extern "C" fn(obj: *mut Object)> =
None;
- const INSTANCE_FINALIZE: Option<unsafe extern "C" fn(obj: *mut Object)> =
None;
}
#[repr(C)]
@@ -666,8 +663,5 @@ impl ObjectImpl for PL011Luminary {
const TYPE_INFO: qemu_api::bindings::TypeInfo = qemu_api::type_info! {
Self };
const TYPE_NAME: &'static CStr = crate::TYPE_PL011_LUMINARY;
const PARENT_TYPE_NAME: Option<&'static CStr> = Some(crate::TYPE_PL011);
- const ABSTRACT: bool = false;
const INSTANCE_INIT: Option<unsafe extern "C" fn(obj: *mut Object)> =
Some(pl011_luminary_init);
- const INSTANCE_POST_INIT: Option<unsafe extern "C" fn(obj: *mut Object)> =
None;
- const INSTANCE_FINALIZE: Option<unsafe extern "C" fn(obj: *mut Object)> =
None;
}
diff --git a/rust/qemu-api/src/definitions.rs b/rust/qemu-api/src/definitions.rs
index 26597934bbd..92b3c6f9118 100644
--- a/rust/qemu-api/src/definitions.rs
+++ b/rust/qemu-api/src/definitions.rs
@@ -14,10 +14,10 @@ pub trait ObjectImpl {
const TYPE_INFO: TypeInfo;
const TYPE_NAME: &'static CStr;
const PARENT_TYPE_NAME: Option<&'static CStr>;
- const ABSTRACT: bool;
- const INSTANCE_INIT: Option<unsafe extern "C" fn(obj: *mut Object)>;
- const INSTANCE_POST_INIT: Option<unsafe extern "C" fn(obj: *mut Object)>;
- const INSTANCE_FINALIZE: Option<unsafe extern "C" fn(obj: *mut Object)>;
+ const ABSTRACT: bool = false;
+ const INSTANCE_INIT: Option<unsafe extern "C" fn(obj: *mut Object)> = None;
+ const INSTANCE_POST_INIT: Option<unsafe extern "C" fn(obj: *mut Object)> =
None;
+ const INSTANCE_FINALIZE: Option<unsafe extern "C" fn(obj: *mut Object)> =
None;
}
pub trait Class {
diff --git a/rust/qemu-api/tests/tests.rs b/rust/qemu-api/tests/tests.rs
index 925f5a3c77b..f793ff26e5d 100644
--- a/rust/qemu-api/tests/tests.rs
+++ b/rust/qemu-api/tests/tests.rs
@@ -58,10 +58,6 @@ impl ObjectImpl for DummyState {
const TYPE_INFO: qemu_api::bindings::TypeInfo = qemu_api::type_info! {
Self };
const TYPE_NAME: &'static CStr = c_str!("dummy");
const PARENT_TYPE_NAME: Option<&'static CStr> =
Some(device_class::TYPE_DEVICE);
- const ABSTRACT: bool = false;
- const INSTANCE_INIT: Option<unsafe extern "C" fn(obj: *mut Object)> =
None;
- const INSTANCE_POST_INIT: Option<unsafe extern "C" fn(obj: *mut
Object)> = None;
- const INSTANCE_FINALIZE: Option<unsafe extern "C" fn(obj: *mut
Object)> = None;
}
impl Class for DummyClass {
--
2.47.1
- [PULL 32/49] ui: Replace type_register() with type_register_static(), (continued)
- [PULL 32/49] ui: Replace type_register() with type_register_static(), Paolo Bonzini, 2024/12/11
- [PULL 33/49] script/codeconverter/qom_type_info: Deprecate MakeTypeRegisterStatic and MakeTypeRegisterNotStatic, Paolo Bonzini, 2024/12/11
- [PULL 34/49] qom/object: Remove type_register(), Paolo Bonzini, 2024/12/11
- [PULL 35/49] bql: check that the BQL is not dropped within marked sections, Paolo Bonzini, 2024/12/11
- [PULL 36/49] rust: cell: add BQL-enforcing Cell variant, Paolo Bonzini, 2024/12/11
- [PULL 38/49] rust: define prelude, Paolo Bonzini, 2024/12/11
- [PULL 37/49] rust: cell: add BQL-enforcing RefCell variant, Paolo Bonzini, 2024/12/11
- [PULL 39/49] rust: add bindings for interrupt sources, Paolo Bonzini, 2024/12/11
- [PULL 40/49] rust: add a bit operation module, Paolo Bonzini, 2024/12/11
- [PULL 41/49] rust: qom: add default definitions for ObjectImpl,
Paolo Bonzini <=
- [PULL 42/49] rust: qom: rename Class trait to ClassInitImpl, Paolo Bonzini, 2024/12/11
- [PULL 43/49] rust: qom: convert type_info! macro to an associated const, Paolo Bonzini, 2024/12/11
- [PULL 44/49] rust: qom: move ClassInitImpl to the instance side, Paolo Bonzini, 2024/12/11
- [PULL 45/49] rust: qdev: move device_class_init! body to generic function, ClassInitImpl implementation to macro, Paolo Bonzini, 2024/12/11
- [PULL 46/49] rust: qdev: move bridge for realize and reset functions out of pl011, Paolo Bonzini, 2024/12/11
- [PULL 47/49] rust: qom: move bridge for TypeInfo functions out of pl011, Paolo Bonzini, 2024/12/11
- [PULL 48/49] rust: qom: split ObjectType from ObjectImpl trait, Paolo Bonzini, 2024/12/11
- [PULL 49/49] rust: qom: change the parent type to an associated type, Paolo Bonzini, 2024/12/11
- Re: [PULL 00/49] rust, QOM, kvm changes for 2024-12-11, Stefan Hajnoczi, 2024/12/12