]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
vmspawn-qmp: pass bridge to on_cont_complete via invoke userdata
authorChristian Brauner <brauner@kernel.org>
Tue, 21 Apr 2026 22:21:43 +0000 (00:21 +0200)
committerChristian Brauner <brauner@kernel.org>
Fri, 24 Apr 2026 12:39:25 +0000 (14:39 +0200)
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) <brauner@kernel.org>
src/vmspawn/vmspawn-qmp.c

index 6c1277f0829f5a0d0e3bba6e05c5cf9625eeadad..702e2e658e93b9d8221d4131724bbc7d4a19e44c 100644 (file)
@@ -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);
 }