]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/char/virtio-console: clear dangling GLib event source tag
authorMatthew Penney <matt@matthewpenney.net>
Thu, 5 Mar 2026 21:33:32 +0000 (21:33 +0000)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 23 Mar 2026 13:54:13 +0000 (14:54 +0100)
Clear dangling GLib event source tag when virtio-console is
unrealized. This prevents a stale tag from being used, and
maintains consistency with the rest of virtio-console.

Signed-off-by: Matthew Penney <matt@matthewpenney.net>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260305213308.96441-1-matt@matthewpenney.net>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
hw/char/virtio-console.c

index 25db0f019b858c81cc129dc3fae70c9b99036d19..efe7cd6772e068afa0271eab2dfe37e81eb37cd1 100644 (file)
@@ -257,7 +257,7 @@ static void virtconsole_unrealize(DeviceState *dev)
     VirtConsole *vcon = VIRTIO_CONSOLE(dev);
 
     if (vcon->watch) {
-        g_source_remove(vcon->watch);
+        g_clear_handle_id(&vcon->watch, g_source_remove);
     }
 }