Re: [PATCH v2 4/4] rust: samples: add EDU PCI driver sample
From: Danilo Krummrich
Date: Sun Jun 21 2026 - 08:27:36 EST
On Sat Jun 20, 2026 at 10:45 AM CEST, Maurice Hieronymus wrote:
> Add a Rust sample driver for the QEMU EDU device, wired up via a new
> SAMPLE_RUST_DRIVER_EDU Kconfig option and the samples Makefile.
>
> Signed-off-by: Maurice Hieronymus <mhi@xxxxxxxxxxx>
This is a good example, but it seems a bit redundant with the existing sample
driver. So, I think this one should just replace the existing one. The only
thing that is not covered is PCI configuration space access, but that should be
trivial to demonstrate in this sample too.
> +impl pci::Driver for EduDriver {
> + type IdInfo = ();
> + type Data<'bound> = Self;
Please make this a new type and take advantage of Rust native lifetimes for
device resources, just like the existing sample driver and nova-core does.
I understand that the existing IRQ infrastructure is a bit in the way and you
have to work around it.
I'm going to send a patch to make the irq::Registration compatible with the
device driver lifetime rework soon. Please rebase onto that once it's sent, so
this sample can land as idiomatic as possible.