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 1/2] rust: subprojects: add libc crate

2025-02-19 Thread Zhao Liu
On Thu, Feb 13, 2025 at 03:32:15PM +0100, Paolo Bonzini wrote: > Date: Thu, 13 Feb 2025 15:32:15 +0100 > From: Paolo Bonzini > Subject: [PATCH 1/2] rust: subprojects: add libc crate > X-Mailer: git-send-email 2.48.1 > > This allows access to errno values. > > Signed-off-by: Paolo Bonzini > ---

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

[PATCH v2] qapi: merge common parts of NbdServerOptions and nbd-server-start data

2025-02-19 Thread Vladimir Sementsov-Ogievskiy
Instead of comment "Keep this type consistent with the nbd-server-start arguments", we can simply merge these things. Note that each field of new base already has "since" tag, equal in both original copies. So "since" information is saved. Signed-off-by: Vladimir Sementsov-Ogievskiy --- v2: reb

Re: [PATCH v2] qapi: merge common parts of NbdServerOptions and nbd-server-start data

2025-02-19 Thread Eric Blake
On Wed, Feb 19, 2025 at 10:19:14PM +0300, Vladimir Sementsov-Ogievskiy wrote: > Instead of comment > "Keep this type consistent with the nbd-server-start arguments", we > can simply merge these things. > > Note that each field of new base already has "since" tag, equal in both > original copies. S

Re: [PATCH v2 04/11] rust/qemu-api: Add wrappers to run futures in QEMU

2025-02-19 Thread Zhao Liu
> +/// Use QEMU's event loops to run a Rust [`Future`] to completion and return > its result. > +/// > +/// This function must be called in coroutine context. If the future isn't > ready yet, it yields. > +pub fn qemu_co_run_future(future: F) -> F::Output { > +let waker = Waker::from(Arc::new

Re: [PATCH v2 10/11] bochs-rs: Add bochs block driver reimplementation in Rust

2025-02-19 Thread Zhao Liu
> +use crate::driver::{block_driver, BdrvChild, BlockDriver, Mapping, > MappingTarget, Request}; > +use crate::SizedIoBuffer; > +use qemu_api::bindings; it's better to list all items from bindings here, which helps in understanding which parts will need a wrapper added later. > +use qemu_api::er

Re: [PATCH v2 01/11] rust: Build separate qemu_api_tools and qemu_api_system

2025-02-19 Thread Zhao Liu
> diff --git a/rust/qemu-api/Cargo.toml b/rust/qemu-api/Cargo.toml > index 57747bc934..bc0393add4 100644 > --- a/rust/qemu-api/Cargo.toml > +++ b/rust/qemu-api/Cargo.toml > @@ -25,6 +25,7 @@ version_check = "~0.9" > default = ["debug_cell"] > allocator = [] > debug_cell = [] > +system= [] With

Re: [PATCH v2 08/11] rust/block: Add driver module

2025-02-19 Thread Zhao Liu
> +impl BdrvChild { > +/// Creates a new child reference from a `BlockdevRef`. > +pub unsafe fn new( > +parent: *mut bindings::BlockDriverState, > +bref: *mut bindings::BlockdevRef, > +errp: *mut *mut bindings::Error, > +) -> Option { > +unsafe { > +

[PATCH] iothread: defer AioContext GSource usage

2025-02-19 Thread Stefan Hajnoczi
Getting the GSource for the AioContext stops fdmon-io_uring from working because it is not compatible with the glib event loop. Defer the GSource code until the glib event loop is actually used. For typical IOThreads this may never be the case and we can use fdmon-io_uring. Signed-off-by: Stefan H