mirror of
https://github.com/qemu/qemu.git
synced 2026-07-08 17:46:10 +00:00
ui/qmp: keep a reference of console across yield
While the coroutine is waiting, the console could be finalized. Keep a reference to prevent this. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20260623-b4-ui-v4-10-4656aec3398d@redhat.com>
This commit is contained in:
@@ -348,6 +348,7 @@ qmp_screendump(const char *filename, const char *device,
|
||||
}
|
||||
}
|
||||
|
||||
object_ref(con);
|
||||
qemu_console_co_wait_update(con);
|
||||
|
||||
/*
|
||||
@@ -358,9 +359,11 @@ qmp_screendump(const char *filename, const char *device,
|
||||
surface = qemu_console_surface(con);
|
||||
if (!surface) {
|
||||
error_setg(errp, "no surface");
|
||||
object_unref(con);
|
||||
return;
|
||||
}
|
||||
image = pixman_image_ref(surface->image);
|
||||
object_unref(con);
|
||||
|
||||
fd = qemu_create(filename, O_WRONLY | O_TRUNC | O_BINARY, 0666, errp);
|
||||
if (fd == -1) {
|
||||
|
||||
Reference in New Issue
Block a user