get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.1/patches/2221139/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2221139,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2221139/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260408010026.4611-9-matt@matthewpenney.net/",
    "project": {
        "id": 14,
        "url": "http://patchwork.ozlabs.org/api/1.1/projects/14/?format=api",
        "name": "QEMU Development",
        "link_name": "qemu-devel",
        "list_id": "qemu-devel.nongnu.org",
        "list_email": "qemu-devel@nongnu.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20260408010026.4611-9-matt@matthewpenney.net>",
    "date": "2026-04-08T01:03:15",
    "name": "[8/8] ui: use g_clear_handle_id() for GSource cleanup",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "194d8f7af22227fee3bf78b8a379627b3ecf06e1",
    "submitter": {
        "id": 92789,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/92789/?format=api",
        "name": "Matthew Penney",
        "email": "matt@matthewpenney.net"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260408010026.4611-9-matt@matthewpenney.net/mbox/",
    "series": [
        {
            "id": 499175,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/499175/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=499175",
            "date": "2026-04-08T01:02:28",
            "name": "[1/8] hw/char: use g_clear_handle_id() for GSource cleanup",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/499175/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2221139/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2221139/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=matthewpenney.net header.i=@matthewpenney.net\n header.a=rsa-sha256 header.s=protonmail header.b=P8rff3h9;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from lists.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4frXz23BQgz1xv0\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 09 Apr 2026 05:23:10 +1000 (AEST)",
            "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wAYQc-0005eV-Mv; Wed, 08 Apr 2026 15:19:06 -0400",
            "from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <matt@matthewpenney.net>)\n id 1wAY0D-00052P-CZ\n for qemu-devel@nongnu.org; Wed, 08 Apr 2026 14:51:50 -0400",
            "from mail-4318.protonmail.ch ([185.70.43.18])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <matt@matthewpenney.net>)\n id 1wAHKC-0001QR-BY\n for qemu-devel@nongnu.org; Tue, 07 Apr 2026 21:03:22 -0400"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=matthewpenney.net;\n s=protonmail; t=1775610198; x=1775869398;\n bh=J70lQstTQVknvHfsteZTD4+60wiGyrWRUrFeYvP4YI4=;\n h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date:\n Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector;\n b=P8rff3h9TLnKNXgb+i4vcE0NHGJw66dj8YBJTTk4qKDh0rQhHn4d3UudzUU//SqTl\n /ZoFeDWpEV1xAuTSt1e6Pzpy5uVocFmS3REo1KRfN2kd6NuesPVW9zR9xv/WQGLiqT\n Vj72lcscCoI9waT0xZs1zOJVcoMphK/fT95pVJVBxIUMqf2DUKN9VPQkivFHeMe4Ve\n 6TJa92gMdDXpk4Bg4wFZXB46+9Q2/WREgkySfFbRuzx1geWbkFQZdnMNqF8eDna2rN\n NNU0gtU/GPWPmp2niLQSWW8oNfMoJxgbKF86lfE05XmYxOdeQbCygjkMNNt9Y0scZK\n TVbjQSkQO3+cg==",
        "Date": "Wed, 08 Apr 2026 01:03:15 +0000",
        "To": "qemu-devel@nongnu.org",
        "From": "Matthew Penney <matt@matthewpenney.net>",
        "Cc": "Matthew Penney <matt@matthewpenney.net>, marcandre.lureau@redhat.com",
        "Subject": "[PATCH 8/8] ui: use g_clear_handle_id() for GSource cleanup",
        "Message-ID": "<20260408010026.4611-9-matt@matthewpenney.net>",
        "Feedback-ID": "185185778:user:proton",
        "X-Pm-Message-ID": "5b7bbd041a4983705a8acf8250fc87a54828c37d",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=utf-8",
        "Content-Transfer-Encoding": "quoted-printable",
        "Received-SPF": "pass client-ip=185.70.43.18;\n envelope-from=matt@matthewpenney.net;\n helo=mail-4318.protonmail.ch",
        "X-Spam_score_int": "-27",
        "X-Spam_score": "-2.8",
        "X-Spam_bar": "--",
        "X-Spam_report": "(-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001,\n RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,\n SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no",
        "X-Spam_action": "no action",
        "X-BeenThere": "qemu-devel@nongnu.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "qemu development <qemu-devel.nongnu.org>",
        "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.nongnu.org/archive/html/qemu-devel>",
        "List-Post": "<mailto:qemu-devel@nongnu.org>",
        "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>",
        "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>",
        "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org",
        "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"
    },
    "content": "Use g_clear_handle_id() instead of g_source_remove() with manual ID\nchecking and zeroing.\n\nThis simplifies the code and ensures consistent handling of GSource IDs,\nsince g_clear_handle_id() checks for a non-zero ID before calling the\ncleanup function and zeros it afterwards.\n\nNo functional change intended.\n\nSigned-off-by: Matthew Penney <matt@matthewpenney.net>\n---\n ui/dbus-clipboard.c    |  6 ++----\n ui/input-barrier.c     |  5 +----\n ui/vnc-auth-sasl.c     |  4 +---\n ui/vnc-auth-vencrypt.c |  9 ++-------\n ui/vnc-ws.c            | 18 ++++--------------\n 5 files changed, 10 insertions(+), 32 deletions(-)",
    "diff": "diff --git a/ui/dbus-clipboard.c b/ui/dbus-clipboard.c\nindex 935b6b1a2a..90318384ee 100644\n--- a/ui/dbus-clipboard.c\n+++ b/ui/dbus-clipboard.c\n@@ -80,8 +80,7 @@ dbus_clipboard_update_info(DBusDisplay *dpy, QemuClipboardInfo *info)\n     if (req->invocation && info->types[req->type].data) {\n         dbus_clipboard_complete_request(dpy, req->invocation, info, req->type);\n         g_clear_object(&req->invocation);\n-        g_source_remove(req->timeout_id);\n-        req->timeout_id = 0;\n+        g_clear_handle_id(&req->timeout_id, g_source_remove);\n         return;\n     }\n \n@@ -183,8 +182,7 @@ dbus_clipboard_request_cancelled(DBusClipboardRequest *req)\n         \"Cancelled clipboard request\");\n \n     g_clear_object(&req->invocation);\n-    g_source_remove(req->timeout_id);\n-    req->timeout_id = 0;\n+    g_clear_handle_id(&req->timeout_id, g_source_remove);\n }\n \n static void\ndiff --git a/ui/input-barrier.c b/ui/input-barrier.c\nindex 0a2198ca50..711ad81b34 100644\n--- a/ui/input-barrier.c\n+++ b/ui/input-barrier.c\n@@ -519,10 +519,7 @@ static void input_barrier_instance_finalize(Object *obj)\n {\n     InputBarrier *ib = INPUT_BARRIER(obj);\n \n-    if (ib->ioc_tag) {\n-        g_source_remove(ib->ioc_tag);\n-        ib->ioc_tag = 0;\n-    }\n+    g_clear_handle_id(&ib->ioc_tag, g_source_remove);\n \n     if (ib->sioc) {\n         qio_channel_close(QIO_CHANNEL(ib->sioc), NULL);\ndiff --git a/ui/vnc-auth-sasl.c b/ui/vnc-auth-sasl.c\nindex 3f4cfc471d..ac68a507ae 100644\n--- a/ui/vnc-auth-sasl.c\n+++ b/ui/vnc-auth-sasl.c\n@@ -127,9 +127,7 @@ size_t vnc_client_write_sasl(VncState *vs)\n      * SASL encoded output\n      */\n     if (vs->output.offset == 0) {\n-        if (vs->ioc_tag) {\n-            g_source_remove(vs->ioc_tag);\n-        }\n+        g_clear_handle_id(&vs->ioc_tag, g_source_remove);\n         vs->ioc_tag = qio_channel_add_watch(\n             vs->ioc, G_IO_IN | G_IO_HUP | G_IO_ERR,\n             vnc_client_io, vs, NULL);\ndiff --git a/ui/vnc-auth-vencrypt.c b/ui/vnc-auth-vencrypt.c\nindex d9c212ff32..0b4be384b9 100644\n--- a/ui/vnc-auth-vencrypt.c\n+++ b/ui/vnc-auth-vencrypt.c\n@@ -75,9 +75,7 @@ static void vnc_tls_handshake_done(QIOTask *task,\n         vnc_client_error(vs);\n         error_free(err);\n     } else {\n-        if (vs->ioc_tag) {\n-            g_source_remove(vs->ioc_tag);\n-        }\n+        g_clear_handle_id(&vs->ioc_tag, g_source_remove);\n         vs->ioc_tag = qio_channel_add_watch(\n             vs->ioc, G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_OUT,\n             vnc_client_io, vs, NULL);\n@@ -102,10 +100,7 @@ static int protocol_client_vencrypt_auth(VncState *vs, uint8_t *data, size_t len\n         vnc_write_u8(vs, 1); /* Accept auth */\n         vnc_flush(vs);\n \n-        if (vs->ioc_tag) {\n-            g_source_remove(vs->ioc_tag);\n-            vs->ioc_tag = 0;\n-        }\n+        g_clear_handle_id(&vs->ioc_tag, g_source_remove);\n \n         tls = qio_channel_tls_new_server(\n             vs->ioc,\ndiff --git a/ui/vnc-ws.c b/ui/vnc-ws.c\nindex 9e3503d93d..e072c1b3fa 100644\n--- a/ui/vnc-ws.c\n+++ b/ui/vnc-ws.c\n@@ -37,9 +37,7 @@ static void vncws_tls_handshake_done(QIOTask *task,\n         error_free(err);\n     } else {\n         VNC_DEBUG(\"TLS handshake complete, starting websocket handshake\\n\");\n-        if (vs->ioc_tag) {\n-            g_source_remove(vs->ioc_tag);\n-        }\n+        g_clear_handle_id(&vs->ioc_tag, g_source_remove);\n         vs->ioc_tag = qio_channel_add_watch(vs->ioc,\n                                             G_IO_IN | G_IO_HUP | G_IO_ERR,\n                                             vncws_handshake_io, vs, NULL);\n@@ -55,10 +53,7 @@ gboolean vncws_tls_handshake_io(QIOChannel *ioc G_GNUC_UNUSED,\n     QIOChannelTLS *tls;\n     Error *err = NULL;\n \n-    if (vs->ioc_tag) {\n-        g_source_remove(vs->ioc_tag);\n-        vs->ioc_tag = 0;\n-    }\n+    g_clear_handle_id(&vs->ioc_tag, g_source_remove);\n \n     if (condition & (G_IO_HUP | G_IO_ERR)) {\n         vnc_client_error(vs);\n@@ -107,9 +102,7 @@ static void vncws_handshake_done(QIOTask *task,\n     } else {\n         VNC_DEBUG(\"Websock handshake complete, starting VNC protocol\\n\");\n         vnc_start_protocol(vs);\n-        if (vs->ioc_tag) {\n-            g_source_remove(vs->ioc_tag);\n-        }\n+        g_clear_handle_id(&vs->ioc_tag, g_source_remove);\n         vs->ioc_tag = qio_channel_add_watch(\n             vs->ioc, G_IO_IN | G_IO_HUP | G_IO_ERR,\n             vnc_client_io, vs, NULL);\n@@ -124,10 +117,7 @@ gboolean vncws_handshake_io(QIOChannel *ioc G_GNUC_UNUSED,\n     VncState *vs = opaque;\n     QIOChannelWebsock *wioc;\n \n-    if (vs->ioc_tag) {\n-        g_source_remove(vs->ioc_tag);\n-        vs->ioc_tag = 0;\n-    }\n+    g_clear_handle_id(&vs->ioc_tag, g_source_remove);\n \n     if (condition & (G_IO_HUP | G_IO_ERR)) {\n         vnc_client_error(vs);\n",
    "prefixes": [
        "8/8"
    ]
}