get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2228016,
    "url": "http://patchwork.ozlabs.org/api/patches/2228016/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260424192543.22614-10-philmd@linaro.org/",
    "project": {
        "id": 14,
        "url": "http://patchwork.ozlabs.org/api/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": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260424192543.22614-10-philmd@linaro.org>",
    "list_archive_url": null,
    "date": "2026-04-24T19:25:41",
    "name": "[PULL,v4,53/62] hw/usb/hcd-ehci.c: Replace fprintf(stderr, ...) with qemu_log_mask(LOG_GUEST_ERROR)",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "445bb0025185483a3a855b02c1f178bff2e5875b",
    "submitter": {
        "id": 85046,
        "url": "http://patchwork.ozlabs.org/api/people/85046/?format=api",
        "name": "Philippe Mathieu-Daudé",
        "email": "philmd@linaro.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260424192543.22614-10-philmd@linaro.org/mbox/",
    "series": [
        {
            "id": 501401,
            "url": "http://patchwork.ozlabs.org/api/series/501401/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=501401",
            "date": "2026-04-24T19:25:34",
            "name": null,
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/501401/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2228016/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2228016/checks/",
    "tags": {},
    "related": [],
    "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=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=wNAONgYP;\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 4g2NJM0qdNz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 25 Apr 2026 05:27:15 +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 1wGMAv-0004Da-MS; Fri, 24 Apr 2026 15:26:53 -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 <philmd@linaro.org>) id 1wGMAt-00043z-MV\n for qemu-devel@nongnu.org; Fri, 24 Apr 2026 15:26:51 -0400",
            "from mail-wm1-x333.google.com ([2a00:1450:4864:20::333])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <philmd@linaro.org>) id 1wGMAr-0001c1-Ni\n for qemu-devel@nongnu.org; Fri, 24 Apr 2026 15:26:51 -0400",
            "by mail-wm1-x333.google.com with SMTP id\n 5b1f17b1804b1-4838c15e3cbso76950615e9.3\n for <qemu-devel@nongnu.org>; Fri, 24 Apr 2026 12:26:49 -0700 (PDT)",
            "from localhost.localdomain (88-187-86-199.subs.proxad.net.\n [88.187.86.199]) by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-4891b46cffasm429035555e9.13.2026.04.24.12.26.46\n for <qemu-devel@nongnu.org>\n (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);\n Fri, 24 Apr 2026 12:26:46 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1777058808; x=1777663608; darn=nongnu.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:to:from:from:to:cc:subject:date:message-id\n :reply-to; bh=0t8jt0AymVNgUQqeTGOsFxkTgdR8czHS8Zoa+60ANvE=;\n b=wNAONgYPYCZA/Z7GsQ/mGL9mDDwoItlceBvTrM29UhSdO3iwH12bt6XFRBpnk9+1RT\n Q9PaL3TALlZfzDWKVmtCb1V8bp1/a9sKV0EX7uGAGNKqhxoQRIYM/SoVL3hmfwQWVfjN\n X+sGVTk80+mqWVjoZL7dj8xn0jviGQnW5K079PptC435c+4GBXiH87oTOFNh5cbl79LH\n 1o/felc1PRW4QnLPiyQ7IgO1QEduiE/cOqZQypcr2TebXhr1pqLaB/5TuhttQAU6Pqsz\n o4pacPKOppwHKinX+cGVlO5nHa5eaCSi85AaOynujckJTdnF/R5IRm7NnvRWCprKmNgw\n TYfw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777058808; x=1777663608;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to\n :cc:subject:date:message-id:reply-to;\n bh=0t8jt0AymVN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uApSXVjB1NmB5bsCcFNqA\n 8mKi8TyxvY=",
        "X-Received": "by 2002:a05:600c:4652:b0:489:a4:e578 with SMTP id\n 5b1f17b1804b1-48900a4e944mr235315145e9.14.1777058807557;\n Fri, 24 Apr 2026 12:26:47 -0700 (PDT)",
        "From": "=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>",
        "To": "qemu-devel@nongnu.org",
        "Subject": "[PULL v4 53/62] hw/usb/hcd-ehci.c: Replace fprintf(stderr,\n ...) with qemu_log_mask(LOG_GUEST_ERROR)",
        "Date": "Fri, 24 Apr 2026 21:25:41 +0200",
        "Message-ID": "<20260424192543.22614-10-philmd@linaro.org>",
        "X-Mailer": "git-send-email 2.53.0",
        "In-Reply-To": "<20260424192543.22614-1-philmd@linaro.org>",
        "References": "<20260424192543.22614-1-philmd@linaro.org>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Received-SPF": "pass client-ip=2a00:1450:4864:20::333;\n envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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,\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": "From: Jamin Lin <jamin_lin@aspeedtech.com>\n\nReplace direct fprintf(stderr, ...) calls with qemu_log_mask()\nusing LOG_GUEST_ERROR in the EHCI controller implementation.\n\nDirect writes to stderr are discouraged in QEMU as they bypass\nthe logging framework and cannot be filtered or controlled at\nruntime. Using qemu_log_mask() ensures that guest-visible errors\nare properly categorized and can be managed via QEMU logging\noptions.\n\nAll affected messages correspond to guest-triggerable error\nconditions, so LOG_GUEST_ERROR is used consistently.\n\nThis change improves integration with QEMU's logging infrastructure\nand aligns with upstream coding guidelines.\n\nSigned-off-by: Jamin Lin <jamin_lin@aspeedtech.com>\nReviewed-by: Cédric Le Goater <clg@redhat.com>\nMessage-ID: <20260424080508.53992-6-jamin_lin@aspeedtech.com>\nSigned-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>\n---\n hw/usb/hcd-ehci.c | 46 +++++++++++++++++++++++++---------------------\n 1 file changed, 25 insertions(+), 21 deletions(-)",
    "diff": "diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c\nindex 7e0b767eb9e..8acaedeaa90 100644\n--- a/hw/usb/hcd-ehci.c\n+++ b/hw/usb/hcd-ehci.c\n@@ -36,6 +36,7 @@\n #include \"qemu/error-report.h\"\n #include \"qemu/main-loop.h\"\n #include \"system/runstate.h\"\n+#include \"qemu/log.h\"\n \n #define FRAME_TIMER_FREQ 1000\n #define FRAME_TIMER_NS   (NANOSECONDS_PER_SECOND / FRAME_TIMER_FREQ)\n@@ -425,7 +426,7 @@ static int ehci_get_pid(EHCIqtd *qtd)\n     case 2:\n         return USB_TOKEN_SETUP;\n     default:\n-        fprintf(stderr, \"bad token\\n\");\n+        qemu_log_mask(LOG_GUEST_ERROR, \"bad token\\n\");\n         return 0;\n     }\n }\n@@ -532,7 +533,7 @@ static void ehci_free_packet(EHCIPacket *p)\n     }\n     if (p->async == EHCI_ASYNC_FINISHED &&\n             p->packet.status == USB_RET_SUCCESS) {\n-        fprintf(stderr,\n+        qemu_log_mask(LOG_GUEST_ERROR,\n                 \"EHCI: Dropping completed packet from halted %s ep %02X\\n\",\n                 (p->pid == USB_TOKEN_IN) ? \"in\" : \"out\",\n                 get_field(p->queue->qh.epchar, QH_EPCHAR_EP));\n@@ -1042,8 +1043,9 @@ static void ehci_opreg_write(void *ptr, hwaddr addr,\n \n         /* not supporting dynamic frame list size at the moment */\n         if ((val & USBCMD_FLS) && !(s->usbcmd & USBCMD_FLS)) {\n-            fprintf(stderr, \"attempt to set frame list size -- value %d\\n\",\n-                    (int)val & USBCMD_FLS);\n+            qemu_log_mask(LOG_GUEST_ERROR,\n+                          \"attempt to set frame list size -- value %\" PRId64\n+                          \"\\n\", val & USBCMD_FLS);\n             val &= ~USBCMD_FLS;\n         }\n \n@@ -1101,7 +1103,7 @@ static void ehci_opreg_write(void *ptr, hwaddr addr,\n \n     case PERIODICLISTBASE:\n         if (ehci_periodic_enabled(s)) {\n-            fprintf(stderr,\n+            qemu_log_mask(LOG_GUEST_ERROR,\n               \"ehci: PERIODIC list base register set while periodic schedule\\n\"\n               \"      is enabled and HC is enabled\\n\");\n         }\n@@ -1109,7 +1111,7 @@ static void ehci_opreg_write(void *ptr, hwaddr addr,\n \n     case ASYNCLISTADDR:\n         if (ehci_async_enabled(s)) {\n-            fprintf(stderr,\n+            qemu_log_mask(LOG_GUEST_ERROR,\n               \"ehci: ASYNC list address register set while async schedule\\n\"\n               \"      is enabled and HC is enabled\\n\");\n         }\n@@ -1200,7 +1202,7 @@ static int ehci_init_transfer(EHCIPacket *p)\n \n     while (bytes > 0) {\n         if (cpage > 4) {\n-            fprintf(stderr, \"cpage out of range (%u)\\n\", cpage);\n+            qemu_log_mask(LOG_GUEST_ERROR, \"cpage out of range (%u)\\n\", cpage);\n             qemu_sglist_destroy(&p->sgl);\n             return -1;\n         }\n@@ -1306,7 +1308,8 @@ static void ehci_execute_complete(EHCIQueue *q)\n         break;\n     default:\n         /* should not be triggerable */\n-        fprintf(stderr, \"USB invalid response %d\\n\", p->packet.status);\n+        qemu_log_mask(LOG_GUEST_ERROR, \"USB invalid response %d\\n\",\n+                      p->packet.status);\n         g_assert_not_reached();\n     }\n \n@@ -1354,7 +1357,7 @@ static int ehci_execute(EHCIPacket *p, const char *action)\n            p->async == EHCI_ASYNC_INITIALIZED);\n \n     if (!(p->qtd.token & QTD_TOKEN_ACTIVE)) {\n-        fprintf(stderr, \"Attempting to execute inactive qtd\\n\");\n+        qemu_log_mask(LOG_GUEST_ERROR, \"Attempting to execute inactive qtd\\n\");\n         return -1;\n     }\n \n@@ -1395,7 +1398,8 @@ static int ehci_execute(EHCIPacket *p, const char *action)\n             p->packet.actual_length);\n \n     if (p->packet.actual_length > BUFF_SIZE) {\n-        fprintf(stderr, \"ret from usb_handle_packet > BUFF_SIZE\\n\");\n+        qemu_log_mask(LOG_GUEST_ERROR,\n+                      \"ret from usb_handle_packet > BUFF_SIZE\\n\");\n         return -1;\n     }\n \n@@ -1479,8 +1483,9 @@ static int ehci_process_itd(EHCIState *ehci,\n             case USB_RET_SUCCESS:\n                 break;\n             default:\n-                fprintf(stderr, \"Unexpected iso usb result: %d\\n\",\n-                        ehci->ipacket.status);\n+                qemu_log_mask(LOG_GUEST_ERROR,\n+                              \"Unexpected iso usb result: %d\\n\",\n+                              ehci->ipacket.status);\n                 /* Fall through */\n             case USB_RET_IOERROR:\n             case USB_RET_NODEV:\n@@ -1584,7 +1589,8 @@ static int ehci_state_fetchentry(EHCIState *ehci, int async)\n \n     /* section 4.8, only QH in async schedule */\n     if (async && (NLPTR_TYPE_GET(entry) != NLPTR_TYPE_QH)) {\n-        fprintf(stderr, \"non queue head request in async schedule\\n\");\n+        qemu_log_mask(LOG_GUEST_ERROR,\n+                      \"non queue head request in async schedule\\n\");\n         return -1;\n     }\n \n@@ -1606,8 +1612,10 @@ static int ehci_state_fetchentry(EHCIState *ehci, int async)\n \n     default:\n         /* TODO: handle FSTN type */\n-        fprintf(stderr, \"FETCHENTRY: entry at %X is of type %u \"\n-                \"which is not supported yet\\n\", entry, NLPTR_TYPE_GET(entry));\n+        qemu_log_mask(LOG_GUEST_ERROR,\n+                      \"FETCHENTRY: entry at 0x%x is of type %u \"\n+                      \"which is not supported yet\\n\",\n+                      entry, NLPTR_TYPE_GET(entry));\n         return -1;\n     }\n \n@@ -2118,13 +2126,13 @@ static void ehci_advance_state(EHCIState *ehci, int async)\n             break;\n \n         default:\n-            fprintf(stderr, \"Bad state!\\n\");\n             g_assert_not_reached();\n         }\n \n         if (again < 0 || itd_count > 16) {\n             /* TODO: notify guest (raise HSE irq?) */\n-            fprintf(stderr, \"processing error - resetting ehci HC\\n\");\n+            qemu_log_mask(LOG_GUEST_ERROR,\n+                          \"processing error - resetting ehci HC\\n\");\n             ehci_reset(ehci);\n             again = 0;\n         }\n@@ -2181,8 +2189,6 @@ static void ehci_advance_async_state(EHCIState *ehci)\n \n     default:\n         /* this should only be due to a developer mistake */\n-        fprintf(stderr, \"ehci: Bad asynchronous state %d. \"\n-                \"Resetting to active\\n\", ehci->astate);\n         g_assert_not_reached();\n     }\n }\n@@ -2231,8 +2237,6 @@ static void ehci_advance_periodic_state(EHCIState *ehci)\n \n     default:\n         /* this should only be due to a developer mistake */\n-        fprintf(stderr, \"ehci: Bad periodic state %d. \"\n-                \"Resetting to active\\n\", ehci->pstate);\n         g_assert_not_reached();\n     }\n }\n",
    "prefixes": [
        "PULL",
        "v4",
        "53/62"
    ]
}