diff --git a/crates/reims-vgpu-c/src/graphics.rs b/crates/reims-vgpu-c/src/graphics.rs index 41ed5661b..89ab1d0ba 100644 --- a/crates/reims-vgpu-c/src/graphics.rs +++ b/crates/reims-vgpu-c/src/graphics.rs @@ -846,7 +846,9 @@ pub extern "C" fn rvg_quiesce_for_exit(timeout_ms: u64) -> bool { /// library's. Calls back: never. #[unsafe(no_mangle)] pub extern "C" fn rvg_write_counts() { - ffi::export(GraphicsDevice::::write_counts) + ffi::export(|| { + GraphicsDevice::::write_counts(); + }) } /// The device's region: its first byte, page-aligned, and, through `size` where it is not NULL, diff --git a/crates/reims-vgpu-c/tests/c/harness.c b/crates/reims-vgpu-c/tests/c/harness.c index fcf3b29a3..dc5fecd94 100644 --- a/crates/reims-vgpu-c/tests/c/harness.c +++ b/crates/reims-vgpu-c/tests/c/harness.c @@ -452,6 +452,9 @@ int main(int argc, char **argv) { check_graphics(); check_memory_files(); check_displays(); + /* As QEMU does when reims-ctl's report asks for them while the guest runs: the degradation + * counts on stderr now, where they changed since the library last wrote them. */ + rvg_write_counts(); /* As QEMU does at its quit, the last call before the exit, whose answer is whether the exit * may run; a second call answers at once, with the first answer. On false the harness ends as * QEMU then does: its streams flushed, then _Exit, which runs no exit handler. */ diff --git a/crates/reims-vgpu-c/tests/c_harness.rs b/crates/reims-vgpu-c/tests/c_harness.rs index 64ea45813..b6135fa8d 100644 --- a/crates/reims-vgpu-c/tests/c_harness.rs +++ b/crates/reims-vgpu-c/tests/c_harness.rs @@ -242,7 +242,7 @@ fn c_harness_calls_every_function() { // A function with a form of each OS's (Windows's under `#if defined(_WIN32)`, the others' // under `#if !defined(_WIN32)`) is declared once per form, one after the other. declared.dedup(); - assert_eq!(declared.len(), 18, "{declared:?}"); + assert_eq!(declared.len(), 19, "{declared:?}"); let missing: Vec<&str> = declared .iter() .copied()