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

2025-03-04 Thread Stefan Hajnoczi
On Tue, Feb 18, 2025 at 07:20:12PM +0100, Kevin Wolf wrote: > This adds helper functions that allow running Rust futures to completion > using QEMU's event loops. This commit is a cliff-hanger. I'm intrigued to find out how timer, fd, etc event loop integration will work :). > > Signed-off-by: K

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

2025-02-20 Thread Kevin Wolf
Am 20.02.2025 um 07:35 hat Zhao Liu geschrieben: > > +/// 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(futu

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

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

2025-02-18 Thread Kevin Wolf
This adds helper functions that allow running Rust futures to completion using QEMU's event loops. Signed-off-by: Kevin Wolf --- include/qemu/coroutine-rust.h | 24 +++ rust/wrapper.h| 1 + util/qemu-co-rust-async.c | 55 + rust/qemu-api/meson