On Mon, 6 Jan 2025 at 11:54, Paolo Bonzini <pbonz...@redhat.com> wrote: > Il gio 2 gen 2025, 18:04 Philippe Mathieu-Daudé <phi...@linaro.org> ha > scritto: >> Pre-existing, but since it appears on this patch, Rust device models >> should not implement this legacy interface. If a non-Rust parent >> implements it, I think we should convert the non-Rust parent before >> adding a Rust child. No clue how to check a parent don't implement >> this interface in Rust. >> >> Generally, we shouldn't access legacy API from Rust IMHO. > > > I disagree that device_class_set_legacy_reset() should not be used. > Three-phase reset is only needed for buses, and requires more code in order > to implement the Resettable interface. Devices gain nothing compared to using > device_class_set_legacy_reset().
Devices using device_class_set_legacy_reset() *are* using three-phase reset, just with a different function signature: -- all that device_class_set_legacy_reset() does is register the provided reset function as the 'hold' phase reset via a trivial passthrough function that adjusts for the function signature being slightly different. (This is different from the situation prior to commit 5fdb6cd27211eff, where we still had more of the "legacy reset" machinery around with various transitional handling to make it interwork with three-phase.) I think here I agree with Philippe that we might as well provide only the new API to Rust devices. -- PMM