[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 19/26] rust: rename qemu-api modules to follow C code a bit m
From: |
Zhao Liu |
Subject: |
Re: [PATCH 19/26] rust: rename qemu-api modules to follow C code a bit more |
Date: |
Thu, 12 Dec 2024 17:52:57 +0800 |
On Mon, Dec 09, 2024 at 01:37:10PM +0100, Paolo Bonzini wrote:
> Date: Mon, 9 Dec 2024 13:37:10 +0100
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: [PATCH 19/26] rust: rename qemu-api modules to follow C code a bit
> more
> X-Mailer: git-send-email 2.47.1
>
> A full match would mean calling them qom::object and hw::core::qdev. For now,
> keep the names shorter but still a bit easier to find.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> rust/hw/char/pl011/src/device.rs | 4 +-
> rust/qemu-api-macros/src/lib.rs | 2 +-
> rust/qemu-api/meson.build | 5 +-
> rust/qemu-api/src/lib.rs | 5 +-
> rust/qemu-api/src/module.rs | 43 +++++++++++
> rust/qemu-api/src/prelude.rs | 2 +-
> .../qemu-api/src/{device_class.rs => qdev.rs} | 4 +-
> rust/qemu-api/src/{definitions.rs => qom.rs} | 74 +++++++++----------
> rust/qemu-api/src/sysbus.rs | 2 +-
> rust/qemu-api/tests/tests.rs | 5 +-
> 10 files changed, 92 insertions(+), 54 deletions(-)
> create mode 100644 rust/qemu-api/src/module.rs
> rename rust/qemu-api/src/{device_class.rs => qdev.rs} (97%)
> rename rust/qemu-api/src/{definitions.rs => qom.rs} (83%)
>
> --- a/rust/qemu-api/src/definitions.rs
> +++ b/rust/qemu-api/src/qom.rs
> @@ -2,7 +2,37 @@
> // Author(s): Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
> // SPDX-License-Identifier: GPL-2.0-or-later
>
> -//! Definitions required by QEMU when registering a device.
> +//! Bindings to access QOM functionality from Rust.
> +//!
> +//! This module provides automatic creation and registration of `TypeInfo`
> +//! for classes that are written in Rust, and mapping between Rust traits
> +//! and QOM vtables.
> +//!
> +//! # Structure of a class
> +//!
> +//! A concrete class only needs a struct holding instance state. The struct
> must
> +//! implement the [`ObjectType`] and [`IsA`] traits, as well as any `*Impl`
> +//! traits provided by its superclasses.
In this commit, this comment is a bit ahead, but I think it's okay.
qom and qdev are both good names. In addition, we can rename the files
of PL011 as well. Perhaps device_class.rs could be merged into device.rs
(and eventually renamed to pl011.rs). I guess you might be planning to
keep it until the cleanup of vmstate and property is done.
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
- Re: [PATCH 14/26] rust: qom: move bridge for TypeInfo functions out of pl011, (continued)
Re: [PATCH 14/26] rust: qom: move bridge for TypeInfo functions out of pl011, Zhao Liu, 2024/12/10
[PATCH 15/26] rust: qom: split ObjectType from ObjectImpl trait, Paolo Bonzini, 2024/12/09
[PATCH 11/26] rust: qdev: move device_class_init! body to generic function, ClassInitImpl implementation to macro, Paolo Bonzini, 2024/12/09
[PATCH 16/26] rust: qom: change the parent type to an associated type, Paolo Bonzini, 2024/12/09
[PATCH 19/26] rust: rename qemu-api modules to follow C code a bit more, Paolo Bonzini, 2024/12/09
- Re: [PATCH 19/26] rust: rename qemu-api modules to follow C code a bit more,
Zhao Liu <=
[PATCH 24/26] rust: qom: move device_id to PL011 class side, Paolo Bonzini, 2024/12/09
- Re: [PATCH 24/26] rust: qom: move device_id to PL011 class side, Zhao Liu, 2024/12/16
- Re: [PATCH 24/26] rust: qom: move device_id to PL011 class side, Paolo Bonzini, 2024/12/17
- Re: [PATCH 24/26] rust: qom: move device_id to PL011 class side, Zhao Liu, 2024/12/18
- Re: [PATCH 24/26] rust: qom: move device_id to PL011 class side, Paolo Bonzini, 2024/12/18
- Re: [PATCH 24/26] rust: qom: move device_id to PL011 class side, Paolo Bonzini, 2024/12/18
- Re: [PATCH 24/26] rust: qom: move device_id to PL011 class side, Zhao Liu, 2024/12/18