Il mer 12 feb 2025, 18:32 Kevin Wolf ha scritto:
> > > +mut buf: MaybeUninit,
> >
> > I think Rust doesn't guarantee no copies here, so maybe this could be
>
> Do you think that in practice the compiler won't optimise the copy away?
>
It's possiblr that it does not, because it has to bui
Am 12.02.2025 um 17:43 hat Paolo Bonzini geschrieben:
> On 2/11/25 22:43, Kevin Wolf wrote:
> > +/// Reads data from the child node into a linear typed buffer.
> > +pub async fn read(&self, offset: u64, buf: &mut
> > T) -> io::Result<()> {
> > +unsafe {
> > +self.read_r
On 2/11/25 22:43, Kevin Wolf wrote:
+/// Reads data from the child node into a linear typed buffer.
+pub async fn read(&self, offset: u64, buf: &mut T) ->
io::Result<()> {
+unsafe {
+self.read_raw(offset, buf.buffer_len(), buf.buffer_mut_ptr())
+.await
This adds a barebones module for a block driver interface. Because there
is no native QAPI support for Rust yet, opening images takes a few
unsafe functions to call into C visitor functions. This should be
cleaned up later.
Signed-off-by: Kevin Wolf
---
rust/block/src/driver.rs | 190 +++