get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2229480,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2229480/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260428095450.77419-1-guobin@linux.alibaba.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": "<20260428095450.77419-1-guobin@linux.alibaba.com>",
    "date": "2026-04-28T09:54:50",
    "name": "[1/2] util/aio-posix: fix poll_ready handlers dropped in aio_prepare()",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "d6f3bfe1c135820558b53a8782d5ed154f962483",
    "submitter": {
        "id": 91693,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/91693/?format=api",
        "name": "Bin Guo",
        "email": "guobin@linux.alibaba.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260428095450.77419-1-guobin@linux.alibaba.com/mbox/",
    "series": [
        {
            "id": 501810,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/501810/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=501810",
            "date": "2026-04-28T09:50:13",
            "name": "util/aio-posix: fix and clean up poll_ready handling in aio_prepare()",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/501810/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2229480/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2229480/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 (1024-bit key;\n unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com\n header.a=rsa-sha256 header.s=default header.b=arbr+yMK;\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=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from lists1p.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 4g4bQf3cxjz1xvV\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 28 Apr 2026 19:55:22 +1000 (AEST)",
            "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wHf9s-0004Oq-Rt; Tue, 28 Apr 2026 05:55:12 -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 <guobin@linux.alibaba.com>)\n id 1wHf9q-0004Ng-LI\n for qemu-devel@nongnu.org; Tue, 28 Apr 2026 05:55:10 -0400",
            "from out30-133.freemail.mail.aliyun.com ([115.124.30.133])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <guobin@linux.alibaba.com>)\n id 1wHf9o-00082r-7O\n for qemu-devel@nongnu.org; Tue, 28 Apr 2026 05:55:10 -0400",
            "from localhost(mailfrom:guobin@linux.alibaba.com\n fp:SMTPD_---0X1uDXNA_1777370091 cluster:ay36) by smtp.aliyun-inc.com;\n Tue, 28 Apr 2026 17:54:56 +0800"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linux.alibaba.com; s=default;\n t=1777370096; h=From:To:Subject:Date:Message-ID:MIME-Version;\n bh=EuN8QYLMABegW93bH0lChbTIz1DIZ96znFN8/Pwg8g0=;\n b=arbr+yMKCgMws/ofydjSXa3FM2HjHQ6mATwSzohjXsdhtwtwPkUUAmXDwCacqIaV3peSPgLAszMU6vrRCiNuukBPYRRrzcJEqp64PZaSQdlXRYR4iCdiw7j83hEKUDO80BYftnzsAS7R0GdQiLfXR4sUuOt3komOC8FZoxPoupg=",
        "X-Alimail-AntiSpam": "AC=PASS; BC=-1|-1; BR=01201311R201e4; CH=green;\n DM=||false|;\n DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=maildocker-contentspam033037026112;\n MF=guobin@linux.alibaba.com; NM=1; PH=DS; RN=5; SR=0;\n TI=SMTPD_---0X1uDXNA_1777370091;",
        "From": "Bin Guo <guobin@linux.alibaba.com>",
        "To": "qemu-devel@nongnu.org",
        "Cc": "pbonzini@redhat.com, stefanha@redhat.com, fam@euphon.net,\n qemu-block@nongnu.org",
        "Subject": "[PATCH 1/2] util/aio-posix: fix poll_ready handlers dropped in\n aio_prepare()",
        "Date": "Tue, 28 Apr 2026 17:54:50 +0800",
        "Message-ID": "<20260428095450.77419-1-guobin@linux.alibaba.com>",
        "X-Mailer": "git-send-email 2.50.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Received-SPF": "pass client-ip=115.124.30.133;\n envelope-from=guobin@linux.alibaba.com;\n helo=out30-133.freemail.mail.aliyun.com",
        "X-Spam_score_int": "-174",
        "X-Spam_score": "-17.5",
        "X-Spam_bar": "-----------------",
        "X-Spam_report": "(-17.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, ENV_AND_HDR_SPF_MATCH=-0.5,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,\n UNPARSEABLE_RELAY=0.001, USER_IN_DEF_DKIM_WL=-7.5,\n USER_IN_DEF_SPF_WL=-7.5 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": "When aio_prepare() calls poll_set_started(ctx, &ready_list, false) to\ndisable poll mode, the last poll round may find ready handlers and mark\nthem poll_ready=true while inserting them into a local ready_list.\nHowever, that local list is discarded on function return, so those\nhandlers are silently dropped and must wait until the next GLib main\nloop iteration to be processed.\n\nThis was noted by commit 826cc32423 as a TODO comment:\n  /* TODO what to do with this list? */\n\nFix this by:\n- Extending aio_pending() to scan poll_aio_handlers for any node with\n  poll_ready=true, so GLib's check phase correctly reports pending work\n  and triggers dispatch.\n- Collecting poll_ready handlers in aio_dispatch() before calling\n  aio_dispatch_ready_handlers(), so they are actually executed in the\n  same dispatch cycle.\n\nSigned-off-by: Bin Guo <guobin@linux.alibaba.com>\n---\n util/aio-posix.c | 37 ++++++++++++++++++++++++++++++++++---\n 1 file changed, 34 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/util/aio-posix.c b/util/aio-posix.c\nindex 488d964611..633bffd716 100644\n--- a/util/aio-posix.c\n+++ b/util/aio-posix.c\n@@ -255,9 +255,12 @@ bool aio_prepare(AioContext *ctx)\n {\n     AioHandlerList ready_list = QLIST_HEAD_INITIALIZER(ready_list);\n \n-    /* Poll mode cannot be used with glib's event loop, disable it. */\n+    /*\n+     * Poll mode cannot be used with glib's event loop, disable it.\n+     * Any handlers that fire in the last poll are marked poll_ready=true\n+     * and will be picked up by aio_pending() / aio_dispatch().\n+     */\n     poll_set_started(ctx, &ready_list, false);\n-    /* TODO what to do with this list? */\n \n     ctx->fdmon_ops->gsource_prepare(ctx);\n     return false;\n@@ -265,7 +268,25 @@ bool aio_prepare(AioContext *ctx)\n \n bool aio_pending(AioContext *ctx)\n {\n-    return ctx->fdmon_ops->gsource_check(ctx);\n+    AioHandler *node;\n+\n+    if (ctx->fdmon_ops->gsource_check(ctx)) {\n+        return true;\n+    }\n+\n+    /*\n+     * Check if any poll handlers became ready during aio_prepare()'s\n+     * last poll (when poll mode is stopped, poll_set_started(false)).\n+     */\n+    qemu_lockcnt_inc(&ctx->list_lock);\n+    QLIST_FOREACH_RCU(node, &ctx->poll_aio_handlers, node_poll) {\n+        if (!QLIST_IS_INSERTED(node, node_deleted) && node->poll_ready) {\n+            qemu_lockcnt_dec(&ctx->list_lock);\n+            return true;\n+        }\n+    }\n+    qemu_lockcnt_dec(&ctx->list_lock);\n+    return false;\n }\n \n static void aio_free_deleted_handlers(AioContext *ctx)\n@@ -395,6 +416,16 @@ void aio_dispatch(AioContext *ctx)\n         ctx->fdmon_ops->dispatch(ctx);\n     }\n \n+    /* Collect handlers that became ready during aio_prepare()'s last poll */\n+    {\n+        AioHandler *node;\n+        QLIST_FOREACH_RCU(node, &ctx->poll_aio_handlers, node_poll) {\n+            if (!QLIST_IS_INSERTED(node, node_deleted) && node->poll_ready) {\n+                aio_add_poll_ready_handler(&ready_list, node);\n+            }\n+        }\n+    }\n+\n     /* block_ns is 0 because polling is disabled in the glib event loop */\n     aio_dispatch_ready_handlers(ctx, &ready_list, 0);\n \n",
    "prefixes": [
        "1/2"
    ]
}