From 06816dfee39d8419b9200448d8cc7656405a818f Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Wed, 22 Apr 2026 00:21:43 +0200 Subject: [PATCH] vmspawn-qmp: pass bridge to on_cont_complete via invoke userdata MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The callback already has the bridge available — but it was reaching for it via qmp_client_get_userdata() instead of through its own userdata parameter. Pass the bridge directly from vmspawn_qmp_start() so the callback can read its argument the way the rest of the file does. No behaviour change. Signed-off-by: Christian Brauner (Amutable) --- src/vmspawn/vmspawn-qmp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vmspawn/vmspawn-qmp.c b/src/vmspawn/vmspawn-qmp.c index 6c1277f082..702e2e658e 100644 --- a/src/vmspawn/vmspawn-qmp.c +++ b/src/vmspawn/vmspawn-qmp.c @@ -1060,10 +1060,10 @@ static int on_cont_complete( int error, void *userdata) { - VmspawnQmpBridge *bridge = ASSERT_PTR(qmp_client_get_userdata(client)); - assert(client); + VmspawnQmpBridge *bridge = ASSERT_PTR(userdata); + if (error < 0) { log_error_errno(error, "Failed to resume QEMU execution: %s", strna(error_desc)); return sd_event_exit(qmp_client_get_event(client), error); @@ -1077,5 +1077,5 @@ static int on_cont_complete( int vmspawn_qmp_start(VmspawnQmpBridge *bridge) { assert(bridge); - return qmp_client_invoke(bridge->qmp, /* ret_slot= */ NULL, "cont", /* args= */ NULL, on_cont_complete, /* userdata= */ NULL); + return qmp_client_invoke(bridge->qmp, /* ret_slot= */ NULL, "cont", /* args= */ NULL, on_cont_complete, bridge); }