Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2222005/?format=api
{ "id": 2222005, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2222005/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260410150457.85190-15-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-15-zhangckid@gmail.com>", "date": "2026-04-10T15:04:57", "name": "[V6,14/14] iothread: simplify API by merging iothread_get_aio_context variants", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "cb46473a6a990495ba112ffd6405c7219809351d", "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-15-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/2222005/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2222005/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=dma3fokm;\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 4fsgBf1NGhz20HT\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 11 Apr 2026 01:07:06 +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 1wBDQv-0008K5-1W; Fri, 10 Apr 2026 11:06:09 -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 1wBDQt-00089Q-F8\n for qemu-devel@nongnu.org; Fri, 10 Apr 2026 11:06:07 -0400", "from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030])\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 1wBDQr-0002bx-3b\n for qemu-devel@nongnu.org; Fri, 10 Apr 2026 11:06:06 -0400", "by mail-pj1-x1030.google.com with SMTP id\n 98e67ed59e1d1-35c1a131946so1333525a91.0\n for <qemu-devel@nongnu.org>; Fri, 10 Apr 2026 08:06:04 -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.58\n (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);\n Fri, 10 Apr 2026 08:06:02 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1775833563; x=1776438363; 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=Y84HVOhRdFiTx4rK3lNBeuuJYVZj1WfUlmRssgWUGlo=;\n b=dma3fokmW1tnDkriQi0emVjvnf4Uhph46UbJS7CjsTHSFo6bO8Z0y6dKWSyMP+dy0Y\n gB1g82KpKrSpIgsrO6ZHEv9dI8V3SXQp40q9hE7OVV4BwsAuCMKt+Gk4u8ZWKH57+PNO\n FcivUrk2SMNFJMX1bvRxZ3cnpUFr/M/LrPeXyjPVcVg2WAE2KYXEwvJZRH42dAcBXF8n\n oRFFcZ5MbxDO1Q9YgVl/RVC9dxhbgqdRf4FzQGzkJm2BRb8CEI7bRXtBCuEJ+rsdwbAq\n BsdBnPeZPbvpzvq4IVHks7mrrA/JMQMv4t/XDkPYeLWJgm81LdOO5hF5t7EQcF0xxEPx\n YwCQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775833563; x=1776438363;\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=Y84HVOhRdFiTx4rK3lNBeuuJYVZj1WfUlmRssgWUGlo=;\n b=H3/EzJlGdvlt5MPXnUXrJDGQkxzONGvRKxptd2a+EVAsZvcgCgxKo79EvHTkAfpv5i\n tDcqSfe99na0HS9JwCID8ta/UUtbRr2eNY+C+Ch7PcjYLeRuTl44sWftCRpVC3Iwi3LZ\n km1LbhoWT9d57ra/bG1W+6BGJKSwdelw6qVfv+/RYEX5fZywBC5qhzx1Fke/zqQgCunO\n uEyUNj4tDj4OWgNIuf6XlO4ufQHJRwy7AOjdg7n+e4CHhSg8Y7Bz6OiT5NIqEeA6vBZu\n P6GijClzD9eu7k/l/u2VncoOh9TS1pEGmYtDkJQbZ0oAGLvVw97CiXAVF+39QU7g7Zd7\n Vljg==", "X-Gm-Message-State": "AOJu0YxxGJ+zKzRFnt+TMQXuSU2I9CJ5jRZtQF+d7m8Mk+kuOIWC1+67\n yrvU6rwrXQQJ4xzRhSwt1My0O5dUwY8Z7soCxuRQ7b+2xxftHgp4/0IlxI4uqmKc", "X-Gm-Gg": "AeBDieutigLJLSsf6r/HDt2YA1WUbTFn3VjYGjUwuUAat9mmyFMzugSIrDWRsYhz72S\n T3SpV/zAf/Akx06sj3kyeR08b3fcAW5KfImf6KjUTeCdiHfRgAbhM/BIkVAzNXnf6MA6lRKxTh0\n V86O08lHF4fGaGhzflZI2jphkIOekQoxZWYN6uWl7ZThIUjwFzH1WxjM8nXVkPGV03aTpe97Qg+\n vzOHG4bPNr4tOI5xKwCwXePObtd79jkvLx0/z0Kvh5KabEC3qGWHpoyGTjg9mumvtUr7Zc8B0xF\n PxjR/kdQXicgfrOu/X8DQpdt043DnQqKkp8FVmWbsPOIrMeP3N/X5mCPlQr1ZJjJ8ElFvsrpLvJ\n rEddVXBmXI2WQWmHXuYB77NmlVVJvFxSok447lF1h8hzHge0sP3FheT/VF3Vd0D9Y/oarJ7ijlx\n W6k46asC09ImubYWcvBo5V4sVlUaQ+pAyharA317KcnjxiNTh1vBYx", "X-Received": "by 2002:a17:90b:2fc7:b0:35d:9276:eba7 with SMTP id\n 98e67ed59e1d1-35e4302d8afmr2719702a91.7.1775833562973;\n Fri, 10 Apr 2026 08:06:02 -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 14/14] iothread: simplify API by merging\n iothread_get_aio_context variants", "Date": "Fri, 10 Apr 2026 23:04:57 +0800", "Message-ID": "<20260410150457.85190-15-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::1030;\n envelope-from=zhangckid@gmail.com; helo=mail-pj1-x1030.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": "Simplify the interface by merging iothread_ref_and_get_aio_context()\ninto iothread_get_aio_context(). The updated function now requires a\n'holder' parameter, ensuring that every retrieval of an AioContext for\nlong-term use is automatically registered in the IOThread's holder list.\n\nUpdate all callers across block, virtio, scsi, net, and monitor\nsubsystems to match the new signature. This cleanup reduces code\nredundancy and improves the reliability of IOThread introspection.\n\nSigned-off-by: Zhang Chen <zhangckid@gmail.com>\n---\n block/export/export.c | 6 +++---\n blockdev.c | 2 +-\n hw/block/dataplane/xen-block.c | 3 +--\n hw/block/virtio-blk.c | 3 +--\n hw/scsi/virtio-scsi-dataplane.c | 3 +--\n hw/vfio-user/proxy.c | 2 +-\n hw/virtio/iothread-vq-mapping.c | 2 +-\n hw/virtio/virtio-balloon.c | 2 +-\n include/system/iothread.h | 5 ++---\n iothread.c | 9 ++-------\n monitor/monitor.c | 2 +-\n net/colo-compare.c | 2 +-\n 12 files changed, 16 insertions(+), 25 deletions(-)", "diff": "diff --git a/block/export/export.c b/block/export/export.c\nindex 636633c324..37bcb4f4d6 100644\n--- a/block/export/export.c\n+++ b/block/export/export.c\n@@ -141,7 +141,7 @@ BlockExport *blk_exp_add(BlockExportOptions *export, Error **errp)\n }\n \n holder_name = bdrv_get_node_name(bs);\n- new_ctx = iothread_ref_and_get_aio_context(iothread, holder_name);\n+ new_ctx = iothread_get_aio_context(iothread, holder_name);\n multithread_count = 1;\n local_iothreads = g_new0(IOThread *, 1);\n local_iothreads[0] = iothread;\n@@ -180,8 +180,8 @@ BlockExport *blk_exp_add(BlockExportOptions *export, Error **errp)\n goto fail;\n }\n local_iothreads[i] = iothread;\n- multithread_ctxs[i++] = iothread_ref_and_get_aio_context(iothread,\n- holder_name);\n+ multithread_ctxs[i++] = iothread_get_aio_context(iothread,\n+ holder_name);\n }\n assert(i == multithread_count);\n }\ndiff --git a/blockdev.c b/blockdev.c\nindex 6e20579187..7eb206a02a 100644\n--- a/blockdev.c\n+++ b/blockdev.c\n@@ -3683,7 +3683,7 @@ void qmp_x_blockdev_set_iothread(const char *node_name, StrOrNull *iothread,\n goto out;\n }\n \n- new_context = iothread_ref_and_get_aio_context(obj, node_name);\n+ new_context = iothread_get_aio_context(obj, node_name);\n bs->iothread = obj;\n } else {\n if (bs->iothread) {\ndiff --git a/hw/block/dataplane/xen-block.c b/hw/block/dataplane/xen-block.c\nindex 552bd8b039..f5984c86e9 100644\n--- a/hw/block/dataplane/xen-block.c\n+++ b/hw/block/dataplane/xen-block.c\n@@ -624,8 +624,7 @@ XenBlockDataPlane *xen_block_dataplane_create(XenDevice *xendev,\n g_autofree char *path = object_get_canonical_path(OBJECT(xendev));\n \n dataplane->iothread = iothread;\n- dataplane->ctx = iothread_ref_and_get_aio_context(dataplane->iothread,\n- path);\n+ dataplane->ctx = iothread_get_aio_context(dataplane->iothread, path);\n } else {\n dataplane->ctx = qemu_get_aio_context();\n }\ndiff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c\nindex 70fc85bdde..8c6a3eaa1e 100644\n--- a/hw/block/virtio-blk.c\n+++ b/hw/block/virtio-blk.c\n@@ -1464,8 +1464,7 @@ static bool virtio_blk_vq_aio_context_init(VirtIOBlock *s, Error **errp)\n return false;\n }\n } else if (conf->iothread) {\n- AioContext *ctx = iothread_ref_and_get_aio_context(conf->iothread,\n- path);\n+ AioContext *ctx = iothread_get_aio_context(conf->iothread, path);\n for (unsigned i = 0; i < conf->num_queues; i++) {\n s->vq_aio_context[i] = ctx;\n }\ndiff --git a/hw/scsi/virtio-scsi-dataplane.c b/hw/scsi/virtio-scsi-dataplane.c\nindex cc318162f5..7b37e3d223 100644\n--- a/hw/scsi/virtio-scsi-dataplane.c\n+++ b/hw/scsi/virtio-scsi-dataplane.c\n@@ -74,8 +74,7 @@ void virtio_scsi_dataplane_setup(VirtIOSCSI *s, Error **errp)\n return;\n }\n } else if (vs->conf.iothread) {\n- AioContext *ctx = iothread_ref_and_get_aio_context(vs->conf.iothread,\n- path);\n+ AioContext *ctx = iothread_get_aio_context(vs->conf.iothread, path);\n for (uint16_t i = 0; i < vs->conf.num_queues; i++) {\n s->vq_aio_context[VIRTIO_SCSI_VQ_NUM_FIXED + i] = ctx;\n }\ndiff --git a/hw/vfio-user/proxy.c b/hw/vfio-user/proxy.c\nindex eebe202c4a..9a9059290f 100644\n--- a/hw/vfio-user/proxy.c\n+++ b/hw/vfio-user/proxy.c\n@@ -938,7 +938,7 @@ VFIOUserProxy *vfio_user_connect_dev(SocketAddress *addr, Error **errp)\n vfio_user_iothread = iothread_create(\"VFIO user\", errp);\n }\n \n- proxy->ctx = iothread_ref_and_get_aio_context(vfio_user_iothread, path);\n+ proxy->ctx = iothread_get_aio_context(vfio_user_iothread, path);\n proxy->req_bh = qemu_bh_new(vfio_user_request, proxy);\n \n QTAILQ_INIT(&proxy->outgoing);\ndiff --git a/hw/virtio/iothread-vq-mapping.c b/hw/virtio/iothread-vq-mapping.c\nindex c993281d7f..7dadc43c44 100644\n--- a/hw/virtio/iothread-vq-mapping.c\n+++ b/hw/virtio/iothread-vq-mapping.c\n@@ -94,7 +94,7 @@ bool iothread_vq_mapping_apply(\n \n for (node = list; node; node = node->next) {\n IOThread *iothread = iothread_by_id(node->value->iothread);\n- AioContext *ctx = iothread_ref_and_get_aio_context(iothread, holder);\n+ AioContext *ctx = iothread_get_aio_context(iothread, holder);\n \n if (node->value->vqs) {\n uint16List *vq;\ndiff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c\nindex 8a4494905a..bd47ba8256 100644\n--- a/hw/virtio/virtio-balloon.c\n+++ b/hw/virtio/virtio-balloon.c\n@@ -899,7 +899,7 @@ static void virtio_balloon_device_realize(DeviceState *dev, Error **errp)\n precopy_add_notifier(&s->free_page_hint_notify);\n \n s->free_page_bh = aio_bh_new_guarded(\n- iothread_ref_and_get_aio_context(s->iothread, path),\n+ iothread_get_aio_context(s->iothread, path),\n virtio_ballloon_get_free_page_hints, s,\n &dev->mem_reentrancy_guard);\n }\ndiff --git a/include/system/iothread.h b/include/system/iothread.h\nindex dbada8249c..fde80f4149 100644\n--- a/include/system/iothread.h\n+++ b/include/system/iothread.h\n@@ -47,9 +47,8 @@ DECLARE_INSTANCE_CHECKER(IOThread, IOTHREAD,\n \n char *iothread_get_id(IOThread *iothread);\n IOThread *iothread_by_id(const char *id);\n-AioContext *iothread_get_aio_context(IOThread *iothread);\n-AioContext *iothread_ref_and_get_aio_context(IOThread *iothread,\n- const char *holder);\n+AioContext *iothread_get_aio_context(IOThread *iothread,\n+ const char *holder);\n void iothread_put_aio_context(IOThread *iothread, const char *holder);\n GMainContext *iothread_get_g_main_context(IOThread *iothread);\n \ndiff --git a/iothread.c b/iothread.c\nindex 70bc5fb62a..470f267901 100644\n--- a/iothread.c\n+++ b/iothread.c\n@@ -415,13 +415,8 @@ char *iothread_get_id(IOThread *iothread)\n return g_strdup(object_get_canonical_path_component(OBJECT(iothread)));\n }\n \n-AioContext *iothread_get_aio_context(IOThread *iothread)\n-{\n- return iothread->ctx;\n-}\n-\n-AioContext *iothread_ref_and_get_aio_context(IOThread *iothread,\n- const char *holder)\n+AioContext *iothread_get_aio_context(IOThread *iothread,\n+ const char *holder)\n {\n /*\n * In some cases, iothread user need the ctx to clearup other resource.\ndiff --git a/monitor/monitor.c b/monitor/monitor.c\nindex b6efe776d6..0f9642f11a 100644\n--- a/monitor/monitor.c\n+++ b/monitor/monitor.c\n@@ -623,7 +623,7 @@ void monitor_data_init(Monitor *mon, bool is_qmp, bool skip_flush,\n */\n g_autofree char *path = g_strdup(is_qmp ? \"/monitor/qmp_mon0\" :\n \"/monitor/hmp_mon0\");\n- mon->ctx = iothread_ref_and_get_aio_context(mon_iothread, path);\n+ mon->ctx = iothread_get_aio_context(mon_iothread, path);\n }\n qemu_mutex_init(&mon->mon_lock);\n mon->is_qmp = is_qmp;\ndiff --git a/net/colo-compare.c b/net/colo-compare.c\nindex f3231257d2..ff58ea9e0a 100644\n--- a/net/colo-compare.c\n+++ b/net/colo-compare.c\n@@ -968,7 +968,7 @@ static void colo_compare_handle_event(void *opaque)\n static void colo_compare_iothread(CompareState *s)\n {\n g_autofree char *path = object_get_canonical_path(OBJECT(s));\n- AioContext *ctx = iothread_ref_and_get_aio_context(s->iothread, path);\n+ AioContext *ctx = iothread_get_aio_context(s->iothread, path);\n \n s->iothread_ctx = ctx;\n s->worker_context = iothread_get_g_main_context(s->iothread);\n", "prefixes": [ "V6", "14/14" ] }