target/i386/kvm: use g_clear_handle_id() for GSource cleanup
Subsystems (2)
PATCH 6/8 target/i386/kvm: use g_clear_handle_id() for GSource cleanup
Replace g_source_remove() and explicit watch id check with g_clear_handle_id().
This simplifies the code and ensures consistent handling of GSource IDs, since g_clear_handle_id() checks for a non-zero ID before calling the cleanup function.
No functional change intended.
Signed-off-by Matthew Penney <[email protected]>
--- target/i386/kvm/tdx-quote-generator.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
target/i386/kvm/tdx-quote-generator.c +1 -3
@@ -75,9 +75,7 @@ static void tdx_generate_quote_cleanup(TdxGenerateQuoteTask *task) {timer_del (&task->timer); -if (task->watch) { -g_source_remove (task->watch); - } +g_clear_handle_id (&task->watch, g_source_remove);qio_channel_close (QIO_CHANNEL (task->sioc),NULL );object_unref (OBJECT (task->sioc));
Signature · 1 line
2.53.0