Re: [PATCH 05/10] rust: qdev: add clock creation

2025-02-05 Thread Zhao Liu
> // SAFETY: > // > -// self.clock is not initialized at this point; but since > `NonNull<_>` is Copy, > -// we can overwrite the undefined value without side effects. This is > +// self.clock is not initialized at this point; but since > `NonNull<_>` is

[PATCH 05/10] rust: qdev: add clock creation

2025-01-17 Thread Paolo Bonzini
Add a Rust version of qdev_init_clock_in, which can be used in instance_init. There are a couple differences with the C version: - in Rust the object keeps its own reference to the clock (in addition to the one embedded in the NamedClockList), and the reference is dropped automatically by ins