Re: vtables and procedural macros (was Re: [PATCH] rust: pl011: convert pl011_create to safe Rust)

2025-02-11 Thread Junjie Mao
Paolo Bonzini writes: > On Tue, Feb 11, 2025 at 7:47 AM Junjie Mao wrote: >> I would suggest to keep the "sysbus" prefix in the method name, or in >> general, keep the class prefix in the method names in XXXClassMethods >> traits. Otherwise APIs from different parent classes may also >> confli

Re: vtables and procedural macros (was Re: [PATCH] rust: pl011: convert pl011_create to safe Rust)

2025-02-11 Thread Paolo Bonzini
On Tue, Feb 11, 2025 at 7:47 AM Junjie Mao wrote: > I would suggest to keep the "sysbus" prefix in the method name, or in > general, keep the class prefix in the method names in XXXClassMethods > traits. Otherwise APIs from different parent classes may also > conflict. As an example, in the follow

Re: vtables and procedural macros (was Re: [PATCH] rust: pl011: convert pl011_create to safe Rust)

2025-02-10 Thread Junjie Mao
Paolo Bonzini writes: > On 2/10/25 10:59, Zhao Liu wrote: >> On Thu, Feb 06, 2025 at 12:15:14PM +0100, Paolo Bonzini wrote: >>> Not a major change but, as a small but significant step in creating >>> qdev bindings, show how pl011_create can be written without "unsafe" >>> calls (apart from conv

vtables and procedural macros (was Re: [PATCH] rust: pl011: convert pl011_create to safe Rust)

2025-02-10 Thread Paolo Bonzini
On 2/10/25 10:59, Zhao Liu wrote: On Thu, Feb 06, 2025 at 12:15:14PM +0100, Paolo Bonzini wrote: Date: Thu, 6 Feb 2025 12:15:14 +0100 From: Paolo Bonzini Subject: [PATCH] rust: pl011: convert pl011_create to safe Rust X-Mailer: git-send-email 2.48.1 Not a major change but, as a small but

Re: [PATCH] rust: pl011: convert pl011_create to safe Rust

2025-02-10 Thread Zhao Liu
On Thu, Feb 06, 2025 at 12:15:14PM +0100, Paolo Bonzini wrote: > Date: Thu, 6 Feb 2025 12:15:14 +0100 > From: Paolo Bonzini > Subject: [PATCH] rust: pl011: convert pl011_create to safe Rust > X-Mailer: git-send-email 2.48.1 > > Not a major change but, as a small but significan

[PATCH] rust: pl011: convert pl011_create to safe Rust

2025-02-06 Thread Paolo Bonzini
Not a major change but, as a small but significant step in creating qdev bindings, show how pl011_create can be written without "unsafe" calls (apart from converting pointers to references). This also provides a starting point for creating Error** bindings. Signed-off-by: Paolo Bonzini --- rust