Re: [PATCH 08/10] rust: qdev: switch from legacy reset to Resettable

2025-02-06 Thread Zhao Liu
On Fri, Jan 17, 2025 at 08:40:01PM +0100, Paolo Bonzini wrote: > Date: Fri, 17 Jan 2025 20:40:01 +0100 > From: Paolo Bonzini > Subject: [PATCH 08/10] rust: qdev: switch from legacy reset to Resettable > X-Mailer: git-send-email 2.47.1 > > Signed-off-by: Paolo Bonzini &g

Re: [PATCH 08/10] rust: qdev: switch from legacy reset to Resettable

2025-01-28 Thread Zhao Liu
> For now I prefer to make things homogeneous... this way if someone has > to copy the code into a wrapper for a new interface they don't have to > wonder about small differences. Yes. > (This by the way will also be a reason to use function pointers for > character devices as well, instead of th

Re: [PATCH 08/10] rust: qdev: switch from legacy reset to Resettable

2025-01-27 Thread Paolo Bonzini
On Mon, Jan 27, 2025 at 11:12 AM Zhao Liu wrote: > > +/// If not None, this is called when the object for entry into reset, > > once > > +/// every object in the system which is being reset has had its > > +/// @phases.enter method called. At this point devices can do actions > > Mayb

Re: [PATCH 08/10] rust: qdev: switch from legacy reset to Resettable

2025-01-27 Thread Zhao Liu
> +/// Trait providing the contents of [`ResettablePhases`]. > +pub trait ResettablePhasesImpl { > +/// If not None, this is called when the object enters reset. It > +/// can reset local state of the object, but it must not do anything that > +/// has a side-effect on other objects, su

[PATCH 08/10] rust: qdev: switch from legacy reset to Resettable

2025-01-17 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- meson.build | 1 + rust/hw/char/pl011/src/device.rs | 10 ++- rust/qemu-api/src/qdev.rs| 116 --- rust/qemu-api/tests/tests.rs | 5 +- 4 files changed, 102 insertions(+), 30 deletions(-) diff --git