Re: [PATCH 09/11] rust/block: Add read support for block drivers

2025-02-12 Thread Kevin Wolf
Am 12.02.2025 um 16:05 hat Paolo Bonzini geschrieben: > On 2/11/25 22:43, Kevin Wolf wrote: > > +/// A request to a block driver > > +pub enum Request { > > +Read { offset: u64, len: u64 }, > > +} > > + > > Maybe add flags already? > > +#[allow(dead_code)] > > +pub enum MappingTarget { > > +

Re: [PATCH 09/11] rust/block: Add read support for block drivers

2025-02-12 Thread Paolo Bonzini
On 2/11/25 22:43, Kevin Wolf wrote: +/// A request to a block driver +pub enum Request { +Read { offset: u64, len: u64 }, +} + Maybe add flags already? +#[allow(dead_code)] +pub enum MappingTarget { +/// The described blocks are unallocated. Reading from them yields zeros. +Unmappe

[PATCH 09/11] rust/block: Add read support for block drivers

2025-02-11 Thread Kevin Wolf
This adds a map() function to the BlockDriver trait and makes use of it to implement reading from an image. Signed-off-by: Kevin Wolf --- rust/block/src/driver.rs | 100 +++ 1 file changed, 100 insertions(+) diff --git a/rust/block/src/driver.rs b/rust/block/