vmspawn-qmp: pass bridge to on_cont_complete via invoke userdata

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>
This commit is contained in:
Christian Brauner
2026-04-24 14:39:25 +02:00
parent 9ed1af2bd1
commit 06816dfee3
+3 -3
View 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);
}