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

2025-03-05 Thread Stefan Hajnoczi
On Tue, Feb 18, 2025 at 07:20:17PM +0100, Kevin Wolf wrote: > +/// A request to a block driver > +pub enum Request { > +Read { offset: u64, len: u64 }, > +} > + > +/// The target for a number of guest blocks, e.g. a location in a child node > or the information > +/// that the described blocks

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

2025-03-04 Thread Stefan Hajnoczi
On Tue, Feb 18, 2025 at 07:20:17PM +0100, Kevin Wolf wrote: > 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 | 95 > 1 file chang

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

2025-02-19 Thread Paolo Bonzini
Il mer 19 feb 2025, 14:02 Kevin Wolf ha scritto: > > Likewise, even BochsImage should not need a standard Rust Arc. > > However you need to add your own block::Arc and map > Clone/Drop to > > bdrv_ref/bdrv_unref. Then BochsImage can use block::Arc; this > > makes it even clearer that Mapping sho

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

2025-02-19 Thread Kevin Wolf
Am 19.02.2025 um 07:11 hat Paolo Bonzini geschrieben: > On 2/18/25 19:20, Kevin Wolf wrote: > > +/// The described blocks are stored in a child node. > > +Data { > > +/// Child node in which the data is stored > > +node: Arc, > > Having Arc<> here shouldn't be necessary, si

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

2025-02-18 Thread Paolo Bonzini
On 2/18/25 19:20, Kevin Wolf wrote: +/// The described blocks are stored in a child node. +Data { +/// Child node in which the data is stored +node: Arc, Having Arc<> here shouldn't be necessary, since the BdrvChild is already reference counted. Since the code is calle

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

2025-02-18 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 | 95 1 file changed, 95 insertions(+) diff --git a/rust/block/src/driver.rs b/rust/block/s