get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2221997,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2221997/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260410150457.85190-3-zhangckid@gmail.com/",
    "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": "<20260410150457.85190-3-zhangckid@gmail.com>",
    "date": "2026-04-10T15:04:45",
    "name": "[V6,02/14] iothread: introduce iothread_ref/unref to track attached devices",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "a6c71cfbd7e219fb8b12432a8367462fe4377612",
    "submitter": {
        "id": 72278,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/72278/?format=api",
        "name": "Zhang Chen",
        "email": "zhangckid@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260410150457.85190-3-zhangckid@gmail.com/mbox/",
    "series": [
        {
            "id": 499477,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/499477/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=499477",
            "date": "2026-04-10T15:04:43",
            "name": "iothread: Support tracking and querying IOThread holders",
            "version": 6,
            "mbox": "http://patchwork.ozlabs.org/series/499477/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2221997/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2221997/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=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=jqNpYybi;\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 4fsg9v3123z1yGS\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 11 Apr 2026 01:06:27 +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 1wBDQF-0006ad-7j; Fri, 10 Apr 2026 11:05:27 -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 <zhangckid@gmail.com>)\n id 1wBDQ8-0006Rr-7v\n for qemu-devel@nongnu.org; Fri, 10 Apr 2026 11:05:20 -0400",
            "from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <zhangckid@gmail.com>)\n id 1wBDQ6-00022W-Dy\n for qemu-devel@nongnu.org; Fri, 10 Apr 2026 11:05:19 -0400",
            "by mail-pj1-x1031.google.com with SMTP id\n 98e67ed59e1d1-35691a231a7so1549744a91.3\n for <qemu-devel@nongnu.org>; Fri, 10 Apr 2026 08:05:18 -0700 (PDT)",
            "from ZBMac-LWN10QXKQ0.taila0cd24.ts.net ([104.168.88.121])\n by smtp.gmail.com with ESMTPSA id\n 98e67ed59e1d1-35e4131cfacsm3565785a91.10.2026.04.10.08.05.12\n (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);\n Fri, 10 Apr 2026 08:05:15 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1775833516; x=1776438316; darn=nongnu.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=zbuB4mhESeHjR1sC4osJPiNIB/gMNHKxCFvIHqQzq6k=;\n b=jqNpYybiH6sQEYeJOcR7uPoVureRgkhNyZU/t9ZQ/+GpnTWJthtkV113zVCrsEfntR\n 9NcRSxd/+4aUjwaqK2KVmvOuHcXJgeQZ40TGsu0fmoKqa94KoEiY9m0FBu48xHGbKOVa\n xahZLxSgAGj3XEun6xY70IapwjDN/9agABqHnl5bwPXvt2y4GW7t4tYroctqRMxLvleP\n XpBuJ1zTL6CaTNuxSgQMdXmAD1/t7DioBefJ0zq5N0UTrQRBhWgpKJrkpgL8/zf3advt\n yT+pkdc0Gvawx9Bptk8KJG46hoAE4jInCNJWd5f8H8xjXY/HbP6TWq3NIFRWyZZluscX\n sLuQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775833516; x=1776438316;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=zbuB4mhESeHjR1sC4osJPiNIB/gMNHKxCFvIHqQzq6k=;\n b=goKJOIQu8/ZW61hlMfUuCKUuHZ90Wp/8vXzjojv7gkKBumPt4KcAZfvzgwf6Frqksm\n 1Z6JopVw0Fm/qU5hDlDgoC5+pQSqh20AoiGF6g6mFlc9eroDbEIObtdh9wBgKW8PnrDe\n kDPSCo727ySgXFlDU04YFwQLv48pv8ZJ+GBs2fnCCgTULq2jrX0028UAhlV9+La+60dl\n TzeAKR01tA/slUwwbwgvMruOwp2YjROlwoQ9RbLN88tKhFJ3HYlXsOruRKw3eNe9K/KL\n BJ5QG0itBGJVX8qmg2kfGjPJD3+tr9lO1mGf7LXcf3IAkANQUXXdXUrjUnjXCoSyiK9N\n TfNQ==",
        "X-Gm-Message-State": "AOJu0YydJYe0x8xdHGTISpETKxVR4hSQOdPV6bxE4eaq3p3XaIki04jC\n 9D1ikfm6mgyZDA7aYSs664MH8BY7n+3pKvBRLqwi1TjniC/GdXGFz3NgQslLhSuS",
        "X-Gm-Gg": "AeBDiet4bEhd7XI6h2hfjywPnUsa/o0vpTDb6A9X2cofmeND7QL7ug+XcCZLtQ5jMxc\n VB1KxlkByXjzgQfs6s+uJTI8KzQu8eCmCbbmExYrjeCoAz5AU+kFWMuKvcPHL3DnU2LWZ28FBWk\n 88nts/NpNcZb9Qla8ch55tyz0EkAcjX0VmaI9C9iE3jJPBLk6CdTNskE9DJcogfwCSUtvib7+z7\n YayT+IxTRx2i7wvyVy3OeAK35s7yWIX0hsPl2AmLDD7gyXWuDQ5eqPGbhe+qKk8DW6DiqzA/HOl\n ko9/28sCzuc9T/gzFUGju09eCHIFafGmOfc/5Z1IT5Q2m/yEUFpaSYiQcKb7UwxfwYGPRPiTSJk\n AV6FOSr0C5wNWXl7kF0P9NuHnS+wTjTd5cNn095nlYPUREThsjCcG9E1UvgVOjt8/uukjXt3YhG\n gWVopI5S7ZVpiSmK5CGpFo4eiePsf8DFcN+D8tf7lirncTNAQcmHpg",
        "X-Received": "by 2002:a17:90b:4a04:b0:35b:e550:e68a with SMTP id\n 98e67ed59e1d1-35e4254fb13mr3695835a91.3.1775833516088;\n Fri, 10 Apr 2026 08:05:16 -0700 (PDT)",
        "From": "Zhang Chen <zhangckid@gmail.com>",
        "To": "qemu-devel <qemu-devel@nongnu.org>,\n \"Dr . David Alan Gilbert\" <dave@treblig.org>,\n Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>,\n \"Michael S . Tsirkin\" <mst@redhat.com>,\n Stefan Hajnoczi <stefanha@redhat.com>",
        "Cc": "Zhang Chen <zhangckid@gmail.com>",
        "Subject": "[PATCH V6 02/14] iothread: introduce iothread_ref/unref to track\n attached devices",
        "Date": "Fri, 10 Apr 2026 23:04:45 +0800",
        "Message-ID": "<20260410150457.85190-3-zhangckid@gmail.com>",
        "X-Mailer": "git-send-email 2.49.0",
        "In-Reply-To": "<20260410150457.85190-1-zhangckid@gmail.com>",
        "References": "<20260410150457.85190-1-zhangckid@gmail.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Received-SPF": "pass client-ip=2607:f8b0:4864:20::1031;\n envelope-from=zhangckid@gmail.com; helo=mail-pj1-x1031.google.com",
        "X-Spam_score_int": "-20",
        "X-Spam_score": "-2.1",
        "X-Spam_bar": "--",
        "X-Spam_report": "(-2.1 / 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, FREEMAIL_FROM=0.001,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n 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": "Currently, IOThreads do not maintain a record of which devices are\nassociated with them. This makes it difficult to monitor the\nworkload distribution of IOThreads, especially in complex\nhotplug scenarios involving multiple virtio-blk or virtio-scsi devices.\n\nThis patch introduces a reference counting and tracking mechanism\nwithin the IOThread object:\n\n- iothread_ref(): Prepends the device's QOM path to a list.\n- iothread_unref(): Searches for the device path using a custom\n  string comparison (g_strcmp0), releases the associated memory\n  upon a successful match.\n- holders: A GList storing the QOM paths of attached devices\n  for runtime introspection.\n\nThis infrastructure allows management tools and QMP commands to\nquery the attachment status of IOThreads.\n\nSigned-off-by: Zhang Chen <zhangckid@gmail.com>\n---\n include/system/iothread.h |  1 +\n iothread.c                | 56 +++++++++++++++++++++++++++++++++++++++\n qapi/misc.json            | 48 +++++++++++++++++++++++++++++++++\n 3 files changed, 105 insertions(+)",
    "diff": "diff --git a/include/system/iothread.h b/include/system/iothread.h\nindex e26d13c6c7..21a76bd70d 100644\n--- a/include/system/iothread.h\n+++ b/include/system/iothread.h\n@@ -33,6 +33,7 @@ struct IOThread {\n     bool stopping;              /* has iothread_stop() been called? */\n     bool running;               /* should iothread_run() continue? */\n     int thread_id;\n+    GList *holders;             /* an array of QOM paths for attached devices */\n \n     /* AioContext poll parameters */\n     int64_t poll_max_ns;\ndiff --git a/iothread.c b/iothread.c\nindex caf68e0764..c43266b191 100644\n--- a/iothread.c\n+++ b/iothread.c\n@@ -36,6 +36,55 @@\n #define IOTHREAD_POLL_MAX_NS_DEFAULT 0ULL\n #endif\n \n+/*\n+ * Add holder device path to the list.\n+ */\n+static void iothread_ref(IOThread *iothread, const char *holder)\n+{\n+    IoThreadHolder *h = g_new0(IoThreadHolder, 1);\n+\n+    if (holder && holder[0] == '/') {\n+        h->type = IO_THREAD_HOLDER_KIND_QOM_OBJECT;\n+        h->u.qom_object.data = g_strdup(holder);\n+    } else {\n+        h->type = IO_THREAD_HOLDER_KIND_BLOCK_NODE;\n+        h->u.block_node.data = g_strdup(holder ? holder : \"unknown\");\n+    }\n+\n+    iothread->holders = g_list_prepend(iothread->holders, h);\n+}\n+\n+static int iothread_holder_compare(gconstpointer a, gconstpointer b)\n+{\n+    const IoThreadHolder *holder_node = a;\n+    const char *target_name = b;\n+    const char *current_name = NULL;\n+\n+    if (holder_node->type == IO_THREAD_HOLDER_KIND_QOM_OBJECT) {\n+        current_name = holder_node->u.qom_object.data;\n+    } else if (holder_node->type == IO_THREAD_HOLDER_KIND_BLOCK_NODE) {\n+        current_name = holder_node->u.block_node.data;\n+    }\n+\n+    return g_strcmp0(current_name, target_name);\n+}\n+\n+/*\n+ * Delete holder device path from the list.\n+ */\n+static void iothread_unref(IOThread *iothread, const char *holder)\n+{\n+    GList *link = g_list_find_custom(iothread->holders, holder,\n+                                     (GCompareFunc)iothread_holder_compare);\n+\n+    /* We don't support unref without a link */\n+    assert(link);\n+\n+    IoThreadHolder *h = (IoThreadHolder *)link->data;\n+    qapi_free_IoThreadHolder(h);\n+    iothread->holders = g_list_delete_link(iothread->holders, link);\n+}\n+\n static void *iothread_run(void *opaque)\n {\n     IOThread *iothread = opaque;\n@@ -115,6 +164,9 @@ static void iothread_instance_finalize(Object *obj)\n \n     iothread_stop(iothread);\n \n+    /* We don't support finalize without holders */\n+    assert(iothread->holders == NULL);\n+\n     /*\n      * Before glib2 2.33.10, there is a glib2 bug that GSource context\n      * pointer may not be cleared even if the context has already been\n@@ -336,6 +388,10 @@ char *iothread_get_id(IOThread *iothread)\n \n AioContext *iothread_get_aio_context(IOThread *iothread)\n {\n+    /* Remove in next patch for build */\n+    iothread_ref(iothread, \"tmp\");\n+    iothread_unref(iothread, \"tmp\");\n+\n     return iothread->ctx;\n }\n \ndiff --git a/qapi/misc.json b/qapi/misc.json\nindex 1f5062df2a..d65d8012b2 100644\n--- a/qapi/misc.json\n+++ b/qapi/misc.json\n@@ -67,6 +67,54 @@\n ##\n { 'command': 'query-name', 'returns': 'NameInfo', 'allow-preconfig': true }\n \n+\n+##\n+# @IoThreadHolderBlockNode:\n+#\n+# @data: Block node name.\n+#\n+# Since: 11.0\n+#\n+##\n+{ 'struct': 'IoThreadHolderBlockNode',\n+  'data': { 'data': 'str' } }\n+\n+##\n+# @IoThreadHolderQomObject:\n+#\n+# @data: QOM path.\n+#\n+# Since: 11.0\n+#\n+##\n+{ 'struct': 'IoThreadHolderQomObject',\n+  'data': { 'data': 'str' } }\n+\n+##\n+# @IoThreadHolderKind:\n+#\n+# @block-node: Block node name.\n+# @qom-object: Standard QOM path.\n+#\n+# Since: 11.0\n+##\n+{ 'enum': 'IoThreadHolderKind',\n+  'data': [ 'block-node', 'qom-object' ] }\n+\n+##\n+# @IoThreadHolder:\n+#\n+# @type: Current IoThread holder type support QOM path and Block node.\n+#\n+# Since: 11.0\n+##\n+{ 'union': 'IoThreadHolder',\n+  'base': { 'type': 'IoThreadHolderKind' },\n+  'discriminator': 'type',\n+  'data': {\n+    'block-node': 'IoThreadHolderBlockNode',\n+    'qom-object': 'IoThreadHolderQomObject' } }\n+\n ##\n # @IOThreadInfo:\n #\n",
    "prefixes": [
        "V6",
        "02/14"
    ]
}