get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2229957,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2229957/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260428234519.1812371-3-pierrick.bouvier@oss.qualcomm.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": "<20260428234519.1812371-3-pierrick.bouvier@oss.qualcomm.com>",
    "date": "2026-04-28T23:45:15",
    "name": "[2/6] target-info: introduce TargetInfo in QOM",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "1a4686769ec804b1642aa5509a00289ad3f55118",
    "submitter": {
        "id": 93152,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/93152/?format=api",
        "name": "Pierrick Bouvier",
        "email": "pierrick.bouvier@oss.qualcomm.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260428234519.1812371-3-pierrick.bouvier@oss.qualcomm.com/mbox/",
    "series": [
        {
            "id": 501963,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/501963/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=501963",
            "date": "2026-04-28T23:45:13",
            "name": "single-binary: deduplicate target_info()",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/501963/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2229957/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2229957/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=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256\n header.s=qcppdkim1 header.b=mpiN/IcD;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n header.a=rsa-sha256 header.s=google header.b=iLBqhSHo;\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 4g4xt66KK3z1yHX\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 09:46:54 +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 1wHs7r-00036R-3E; Tue, 28 Apr 2026 19:45:59 -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 <pierrick.bouvier@oss.qualcomm.com>)\n id 1wHs7k-00033v-0E\n for qemu-devel@nongnu.org; Tue, 28 Apr 2026 19:45:52 -0400",
            "from mx0a-0031df01.pphosted.com ([205.220.168.131])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <pierrick.bouvier@oss.qualcomm.com>)\n id 1wHs7g-0000U7-3P\n for qemu-devel@nongnu.org; Tue, 28 Apr 2026 19:45:50 -0400",
            "from pps.filterd (m0279865.ppops.net [127.0.0.1])\n by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 63SHZuBC017610\n for <qemu-devel@nongnu.org>; Tue, 28 Apr 2026 23:45:46 GMT",
            "from mail-dy1-f199.google.com (mail-dy1-f199.google.com\n [74.125.82.199])\n by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4du1ee92dr-1\n (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)\n for <qemu-devel@nongnu.org>; Tue, 28 Apr 2026 23:45:46 +0000 (GMT)",
            "by mail-dy1-f199.google.com with SMTP id\n 5a478bee46e88-2da19227bc1so882583eec.1\n for <qemu-devel@nongnu.org>; Tue, 28 Apr 2026 16:45:46 -0700 (PDT)",
            "from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com.\n [129.46.96.20]) by smtp.gmail.com with ESMTPSA id\n 5a478bee46e88-2ed1bf8ddaasm345300eec.7.2026.04.28.16.45.43\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 28 Apr 2026 16:45:44 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=\n cc:content-transfer-encoding:date:from:in-reply-to:message-id\n :mime-version:references:subject:to; s=qcppdkim1; bh=K6b8pw+xSqA\n Xu6NNPPl1U4TktwSes6t0a9lSw1GNMHs=; b=mpiN/IcDBD4hgp53zLOAyeJd+ca\n N93bq8Dm1y83s4mkdYo0hS5zMgWj/GYalbJfZN6k5rFOQEFIrgQfi2XOUKFw8GQ9\n Rse4TE/qt8ltOTaRCaXrQHoEMscDOxUOC/nXSnaXql67QJxxCpoKVp//nHYpbmih\n 1LfkMPosf4RpwDlx4wVwQ7sgToDar9/S12uD5vBX9DdajM5obUOd+7l1+f4btf2Q\n Ikahb02PxVDr/gSzQ/pfx252LSqsxsDu3YNrOYtdpyA/lRNaC23NKXY/vrkTEuA4\n vx6zO1xqa2mIk6TSmRjUWt+igmHPPaMqSpBZfnpBdRw2vp4zy/FpuPyzWZg==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=oss.qualcomm.com; s=google; t=1777419945; x=1778024745; 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=K6b8pw+xSqAXu6NNPPl1U4TktwSes6t0a9lSw1GNMHs=;\n b=iLBqhSHokJbeOqMpsrzP6tn6wVZLgnhw1bfQ1/FG9cihvE6P3PN2BWRQbfF3TnUOMG\n 1mFKs0gggaqTnasOraYrJa1M3smwj8Mt1rSzO/YS20UId1572d8LR3dSBHKCwbXrVmej\n pbYCfoEPUS4fEZxVCfg7UMU4hRWLeu/um+94EwK5BtKGkAIOS4+ntL3nQyfkXhbIoV8T\n Px8YntyMuvkOB/UzGzmdg1a+u08WPHiAInLMKcF3clUKJybiip+f1I3gtkURoMdvOIXO\n Moi7bqjsfenFJSoZGmeZWtZNv1MEzwgALO4+z6CZpT/VUDO8j9opf2RazrzQNVxA+4pA\n /D0A=="
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777419945; x=1778024745;\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=K6b8pw+xSqAXu6NNPPl1U4TktwSes6t0a9lSw1GNMHs=;\n b=j0ba2/EhQfZptzBQsTvoQA4IJxX7IOLy8g26NCTSkT5wDLHDPK6jetxs/YiLx4Dt+n\n HwCGJSXoEyg70gLCFD27kh0FYJmB7nDsJGxDTMWTpNIfTnBVzxfRouZp6R1ZrSnuXZuA\n 6UZIkoVRayNyQajolbAwpcrHf94xQbkuf3f24KC2ENPpPZ6yS36d7YyowlIDiU7OJhP9\n 7FOT9+2EszOFFHNZjK+UE1mFuIHEiKvXkyoPJ8HlU+0CFs+blhqh62qP1vw6NzGsbvwB\n kONF+2HVqqO1b4Coqk6xk5K6KlapbkEs4D1lycfYXdXWSoJETZtflL3AOAkSIuhTaeog\n 7/7g==",
        "X-Gm-Message-State": "AOJu0YzaWQwiv8yKg8qFFXL8frW0IhLb5OGJYfdRNEJ/A7Ss2Q/kjo8N\n lDqCZXmuiARadNpm3Wyxaz1+kLnNnGILsnBXsO+R9uLRhbkt7EUoN8kpH7xsvv2vN+O8ebdozS2\n HtgIz1KFdTAO8m3ZMr6xiScUidD0KjH+kfLogWIMqkFf0ZuncwVhTG0cMmSbFCCwxckqo",
        "X-Gm-Gg": "AeBDietDVDBP7VOlth1Hpq4OCaJVjukg91yxzJ+WLxfU9+nnGUOIIkdkaEvB8tNdyO6\n /KXLesuW5sy1sIuvZa2VvhfRSs3inBX4k88/Byz5T5R5ynq12umv1uipt6GCEMZKBI35wxO+WmG\n NkpA7OdgSW10jBJXUlElLz+qcq5N5koz07vwmo251kkIErYWBqzm6yoyx7GTdO1Yv84QFvmzLXF\n F9v9QObnbxAXLQU7OcfqCM0entUNC7eNMYvSbxyf2uzAsAMLnyRlHFZ3o9Vq4sJDbltFdFqposT\n SvsHG7kq9HZCZthMWmQVqaiAzvvLnV0lOL4c9DI8N0tF8T8PR7plvkF8KSE7lOnjlT7+ptLnM5E\n JjVSTJUcymSoLauUq6j+gIBisHcC1WTwSKb/Y208HrUyIrIfVfye6JwewjT0a8xLQlH8ClGSMi2\n NcojDugPg+i4LSTubG",
        "X-Received": [
            "by 2002:a05:7300:1908:b0:2b8:5159:eca5 with SMTP id\n 5a478bee46e88-2ed0a0f47ebmr2812707eec.14.1777419945425;\n Tue, 28 Apr 2026 16:45:45 -0700 (PDT)",
            "by 2002:a05:7300:1908:b0:2b8:5159:eca5 with SMTP id\n 5a478bee46e88-2ed0a0f47ebmr2812686eec.14.1777419944900;\n Tue, 28 Apr 2026 16:45:44 -0700 (PDT)"
        ],
        "From": "Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>",
        "To": "qemu-devel@nongnu.org",
        "Cc": "Markus Armbruster <armbru@redhat.com>, =?utf-8?q?Daniel_P=2E_Berrang?=\n\t=?utf-8?q?=C3=A9?= <berrange@redhat.com>,\n Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>, =?utf-8?q?Philippe_Ma?=\n\t=?utf-8?q?thieu-Daud=C3=A9?= <philmd@linaro.org>,\n Anton Johansson <anjo@rev.ng>,\n Richard Henderson <richard.henderson@linaro.org>,\n Paolo Bonzini <pbonzini@redhat.com>",
        "Subject": "[PATCH 2/6] target-info: introduce TargetInfo in QOM",
        "Date": "Tue, 28 Apr 2026 16:45:15 -0700",
        "Message-ID": "<20260428234519.1812371-3-pierrick.bouvier@oss.qualcomm.com>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20260428234519.1812371-1-pierrick.bouvier@oss.qualcomm.com>",
        "References": "<20260428234519.1812371-1-pierrick.bouvier@oss.qualcomm.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Authority-Analysis": "v=2.4 cv=C/7ZDwP+ c=1 sm=1 tr=0 ts=69f146aa cx=c_pps\n a=cFYjgdjTJScbgFmBucgdfQ==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17\n a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22\n a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=EUspDBNiAAAA:8\n a=957eaOmehK1HrViG9FMA:9 a=scEy_gLbYbu1JhEsrz4S:22",
        "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjYwNDI4MDIzMiBTYWx0ZWRfXzYMVbxZuwBSR\n xXJH58ZKvmvcCY51z3exURa3Xy7rzJC/ehvJyJWPz5xSj5Cw0ZSsIFnENlVIVcgt2JCz6nk8zAw\n /8OQ4QLRwyEll8DSnm+h2JvVX6mGF74tDbW+dBGNhdy3fH2KtoxabElcPekGFB+b/fPoaWj0C8M\n sh0E0fhEaAV6s7oWBacaoA/dD7922HKV46RViuf3Zx0ehR0+bcdW8Xf5jS5AqfjHg1EKn+Cc8aj\n OFXBx/JxWfeFCI0z49X0QybTaDhMrsj/4X8qEB7YmA1q6JmTmnuTMsMwz5QaGfQt0C7kI98HiNF\n mIWR9r874lvZtgxwGRbVYzsLqfi6ROXs7IRWrTtSPEA1Ps/7t66cpNbht+2FNrUeCgfsj6k2ThX\n Ho1oyM4OF9PiBidvFFJgT/I2fNrgPI8HhYcxGTEt/7HNwpD1ww2NMjFkZz3HUyJQgWO/YesNla3\n lmqwp44Z5qtfela7QKA==",
        "X-Proofpoint-GUID": "GGOn6CUyqYiFBk0DI-zUHCHR3KrVV4BI",
        "X-Proofpoint-ORIG-GUID": "GGOn6CUyqYiFBk0DI-zUHCHR3KrVV4BI",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-04-28_05,2026-04-28_01,2025-10-01_01",
        "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n impostorscore=0 lowpriorityscore=0 malwarescore=0 adultscore=0 spamscore=0\n priorityscore=1501 bulkscore=0 phishscore=0 suspectscore=0 clxscore=1015\n classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0\n reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604280232",
        "Received-SPF": "pass client-ip=205.220.168.131;\n envelope-from=pierrick.bouvier@oss.qualcomm.com;\n helo=mx0a-0031df01.pphosted.com",
        "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, 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": "For the single-binary, we want to be able to retrieve at runtime the\ncurrent target among the different ones available.\nA consequence is that we can't rely on existing target_info() definition\nsince it will create a conflict once more than one target is available.\n\nTo solve this, we add TargetInfo in QOM, with this hierarchy.\nWe define one class \"target-info-X\" per target, that inherits from\nabstract class \"target-info\". Using concrete vs abstract class ensure we\ncan easily filter \"target-info-X\" from all QOM types.\nAssociated TargetInfo is directly set through class initialization,\nwithout relying on any instance.\n\nFor user mode, we simply define target_info() like it was done\npreviously. In this patch, we keep the same definition for system-mode\nalso, and it will be replaced in next commits.\n\nSigned-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>\n---\n include/qemu/target-info-init.h | 48 +++++++++++++++++++++++++++++++++\n include/qemu/target-info-qom.h  | 23 ++++++++++++++++\n target-info-qom.c               | 10 +++++++\n 3 files changed, 81 insertions(+)\n create mode 100644 include/qemu/target-info-qom.h",
    "diff": "diff --git a/include/qemu/target-info-init.h b/include/qemu/target-info-init.h\nindex 9be06d8523a..f3cea985540 100644\n--- a/include/qemu/target-info-init.h\n+++ b/include/qemu/target-info-init.h\n@@ -11,10 +11,58 @@\n \n #ifndef TARGET_INFO_DEF_H\n \n+#ifdef CONFIG_USER_ONLY\n+\n+/*\n+ * User mode does not support multiple targets in the same binary, so just\n+ * define target_info().\n+ */\n #define target_info_init(ti_var)        \\\n const TargetInfo *target_info(void)     \\\n {                                       \\\n     return &ti_var;                     \\\n }\n \n+#else /* CONFIG_USER_ONLY */\n+\n+#include \"qemu/target-info-qom.h\"\n+#include \"qom/object.h\"\n+\n+#define TYPE_TARGET_INFO_TARGET TYPE_TARGET_INFO\"-\"TARGET_NAME\n+\n+typedef struct TargetInfoQomTarget {\n+    TargetInfoQom parent;\n+} TargetInfoQomTarget;\n+\n+typedef struct TargetInfoQomTargetClass {\n+    TargetInfoQomClass parent_class;\n+} TargetInfoQomTargetClass;\n+\n+OBJECT_DECLARE_TYPE(TargetInfoQomTarget, TargetInfoQomTargetClass, TARGET_INFO_TARGET)\n+\n+#define target_info_init(ti_var)                                            \\\n+const TargetInfo *target_info(void)                                         \\\n+{                                                                           \\\n+    return &ti_var;                                                         \\\n+}                                                                           \\\n+                                                                            \\\n+static void target_info_qom_class_init(ObjectClass *oc, const void * data)  \\\n+{                                                                           \\\n+    TargetInfoQomTargetClass *klass = TARGET_INFO_TARGET_CLASS(oc);         \\\n+    klass->parent_class.target_info = &ti_var;                              \\\n+}                                                                           \\\n+                                                                            \\\n+static const TypeInfo target_info_qom_target_type_info[] = {                \\\n+{                                                                           \\\n+    .name = TYPE_TARGET_INFO_TARGET,                                        \\\n+    .parent = TYPE_TARGET_INFO,                                             \\\n+    .instance_size = sizeof(TargetInfoQomTarget),                           \\\n+    .class_size = sizeof(TargetInfoQomTargetClass),                         \\\n+    .class_init = target_info_qom_class_init,                               \\\n+    .abstract = false,                                                      \\\n+} };                                                                        \\\n+DEFINE_TYPES(target_info_qom_target_type_info)\n+\n+#endif /* CONFIG_USER_ONLY */\n+\n #endif /* TARGET_INFO_DEF_H */\ndiff --git a/include/qemu/target-info-qom.h b/include/qemu/target-info-qom.h\nnew file mode 100644\nindex 00000000000..db069db718a\n--- /dev/null\n+++ b/include/qemu/target-info-qom.h\n@@ -0,0 +1,23 @@\n+/*\n+ * QEMU target info QOM types\n+ *\n+ * Copyright (c) Qualcomm\n+ *\n+ * SPDX-License-Identifier: GPL-2.0-or-later\n+ */\n+\n+#include \"qemu/target-info-impl.h\"\n+#include \"qom/object.h\"\n+\n+#define TYPE_TARGET_INFO \"target-info\"\n+\n+typedef struct TargetInfoQom {\n+    Object parent_obj;\n+} TargetInfoQom;\n+\n+typedef struct TargetInfoQomClass {\n+    ObjectClass parent_class;\n+    const TargetInfo *target_info;\n+} TargetInfoQomClass;\n+\n+OBJECT_DECLARE_TYPE(TargetInfoQom, TargetInfoQomClass, TARGET_INFO)\ndiff --git a/target-info-qom.c b/target-info-qom.c\nindex 7fd58d24818..5ce29f80301 100644\n--- a/target-info-qom.c\n+++ b/target-info-qom.c\n@@ -7,10 +7,20 @@\n  */\n \n #include \"qemu/osdep.h\"\n+#include \"qapi/error.h\"\n #include \"qom/object.h\"\n+#include \"qemu/target-info-impl.h\"\n+#include \"qemu/target-info-qom.h\"\n #include \"hw/arm/machines-qom.h\"\n \n static const TypeInfo target_info_types[] = {\n+    {\n+        .name = TYPE_TARGET_INFO,\n+        .parent = TYPE_OBJECT,\n+        .instance_size = sizeof(TargetInfoQom),\n+        .class_size = sizeof(TargetInfoQomClass),\n+        .abstract = true,\n+    },\n     {\n         .name           = TYPE_TARGET_ARM_MACHINE,\n         .parent         = TYPE_INTERFACE,\n",
    "prefixes": [
        "2/6"
    ]
}