Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2235275/?format=api
{ "id": 2235275, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2235275/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260509005453.3984184-4-pierrick.bouvier@oss.qualcomm.com/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/1.2/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": "<20260509005453.3984184-4-pierrick.bouvier@oss.qualcomm.com>", "list_archive_url": null, "date": "2026-05-09T00:54:50", "name": "[v5,3/6] target-info: extract target_info() definition in target-info-init.h", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "c05d2c680be7b2298258df0e4a51745825035557", "submitter": { "id": 93152, "url": "http://patchwork.ozlabs.org/api/1.2/people/93152/?format=api", "name": "Pierrick Bouvier", "email": "pierrick.bouvier@oss.qualcomm.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260509005453.3984184-4-pierrick.bouvier@oss.qualcomm.com/mbox/", "series": [ { "id": 503469, "url": "http://patchwork.ozlabs.org/api/1.2/series/503469/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=503469", "date": "2026-05-09T00:54:47", "name": "single-binary: deduplicate target_info()", "version": 5, "mbox": "http://patchwork.ozlabs.org/series/503469/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2235275/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2235275/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=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256\n header.s=qcppdkim1 header.b=YFPNUj7Z;\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=A0n6OmER;\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 4gC6xg714wz1yCg\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 09 May 2026 10:56:23 +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 1wLVyd-0000dU-7G; Fri, 08 May 2026 20:55:31 -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 1wLVyO-0000Th-VN\n for qemu-devel@nongnu.org; Fri, 08 May 2026 20:55:20 -0400", "from mx0b-0031df01.pphosted.com ([205.220.180.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 1wLVyL-0005xw-Qv\n for qemu-devel@nongnu.org; Fri, 08 May 2026 20:55:16 -0400", "from pps.filterd (m0279873.ppops.net [127.0.0.1])\n by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 6490JhC81767965\n for <qemu-devel@nongnu.org>; Sat, 9 May 2026 00:55:12 GMT", "from mail-dl1-f71.google.com (mail-dl1-f71.google.com\n [74.125.82.71])\n by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4e1t9q01sw-1\n (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)\n for <qemu-devel@nongnu.org>; Sat, 09 May 2026 00:55:12 +0000 (GMT)", "by mail-dl1-f71.google.com with SMTP id\n a92af1059eb24-12dece274b1so2702810c88.1\n for <qemu-devel@nongnu.org>; Fri, 08 May 2026 17:55:12 -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-2f888c3b301sm5352610eec.23.2026.05.08.17.55.09\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 08 May 2026 17:55:09 -0700 (PDT)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=\n cc:content-transfer-encoding:content-type:date:from:in-reply-to\n :message-id:mime-version:references:subject:to; s=qcppdkim1; bh=\n ccJY+iG0pd89Vp/075sBmYMQIkXmTwvv+melW/PueCk=; b=YFPNUj7ZGzSKhn0O\n 7mX2eiROdvzOakNGpjCnijDvJKwrZPKIvs3+bE/6uBcdJG4q1PhYWX2GFYDz41Yu\n 2SeaQAkQUHu47KXlmHmvgJoR/I9gUcEEvRcSKI7Y1Myz+Gl+qZYf0oVdTEQQEU1W\n MWZ4knGRbYfmaxERAvGTc8PNceNX04iK55UKJ+h6r7KCmAYrsI961Po/lBx2h5Mr\n JenJRL5uI6lNNo0FIBPVxfnW5kfArmGsol9cFUtX8cYiK/c41WkANiLYs7HMrD0d\n a7p8D/9buvcO0DDbc6gTbsA9E/dqlLqBtwp4owdq6mawRQz+fDa2GKxVqSEW4Mwq\n GGKuVg==", "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=oss.qualcomm.com; s=google; t=1778288111; x=1778892911; 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=ccJY+iG0pd89Vp/075sBmYMQIkXmTwvv+melW/PueCk=;\n b=A0n6OmERbQsg+03sIV6/k8Y0RMJNMkULsxVIR6gnOsTTwP+F8vw1TfPjG9v12VO/G4\n tRVvfjV7cVm4r8L4Ump6ndByGp+Yfp4U0bGKe3Nc59dae6Q7Ug1EaZAhyexQzoQmJd8b\n Vroy0ESsdGyqqsG5b6kETsZwsPqltRNp48n75uJTCAr4NT5tMuEYJn+ZMof/ARjH5kVz\n 1im1q0FPsEQjs9L3wQ0UIm/I+tsw7piAcNB4u8DadKDmVsDM235S6HOzjv0XNSIouvX9\n T0xwYcOjIdC7GfJXkWHzuLGBMgewHjY7+8TbrrZ+kpB1/0hiQeTBGCKcrwZ/4kBuf2Ni\n Ocpg==" ], "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1778288111; x=1778892911;\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=ccJY+iG0pd89Vp/075sBmYMQIkXmTwvv+melW/PueCk=;\n b=jh79VhPx1oWviOYDtP0MCYwGIH5ZD+WkF1x6UyOSFg4EMARXIOhBpDe+deZWWSucyC\n +KVDuu11SVun9f7koUf7b7q/lKzqPi8pAT+K+qOqW078ZOV93D5knnKw3RKdHlxNHaWq\n ZGAtsKGJRMeBGZ5ADIVXoIIjONhuieaBvJFc12YDOcvq4dhT0ScY6CTRq+Gc8ruZ7aKh\n b26V3p/evs2k1xmwZd+wsdAVXecxQxrtSdm4XK8iYfANT/Xt+yjV/bfvhcvt/XgVhw5U\n Xnh0uhoGmtmMaJ0Oy3S3OfmSOP1s63H8a1XK81+7P9xyKesDaY9kVyqGlcqm6OAOktwS\n aNkw==", "X-Gm-Message-State": "AOJu0YxF2cM4KuLiB+eXOsu/9IulI/FkBGQZXPxtX1bSLM8FFRe0UEuP\n yAUBLw250UTKGrtihbWuSpN35Qh8jJpXVTzV+trh9h5zyHkNLN8E3vHzpOEqBDo80NMLEXvJ4ia\n ddIQ8APSC0dgIm3XN5OHuA+xD4HSbcaMmERGfntKlr65hPLnG09ED3dg+/kfHqvwTyc6q", "X-Gm-Gg": "AeBDiesgKJKzUd9a6qDAKluIDmlnZuUn1LH1XjpJo6cEJLIuMJOvEucHV3XzvTjiPdf\n WXxVxHABRUHPek9czIxgCVHny4SQ8zOMusdr4z9xX0Brfph8PBQg/jUoINlBJd1iXuTqgdcvRqg\n /+J4XJ+ikUpVpjU8tU0gJqZFYpqWnzkGgVKO9hNEmPIlrEQkLHWQe+Tgwwpgmxi3gvlcQdhOd0i\n NtHiFApfzCb63/jlVybpReYQLBksH/Bbj7Bf5VF/wav9URnxPv7148t9Hj5TOubROpimzxXBR27\n /4fKqvMc0z76Nf5wdSTo2YMaPd8zulcMsuY7/htNJyZh9JS+Vi4foWtWvkyDjfSWXbw9HrNqrRm\n 5DPvUvQeKZOVNY9ysW0PUfmGT78mEhP3Rm7/S+dG1u11rk+fnmLKBahBCNDoKy1qPpdiV5MKIym\n Ul+TtYCg==", "X-Received": [ "by 2002:a05:7022:625:b0:128:d715:b717 with SMTP id\n a92af1059eb24-131852d534fmr7296470c88.13.1778288111107;\n Fri, 08 May 2026 17:55:11 -0700 (PDT)", "by 2002:a05:7022:625:b0:128:d715:b717 with SMTP id\n a92af1059eb24-131852d534fmr7296453c88.13.1778288110512;\n Fri, 08 May 2026 17:55:10 -0700 (PDT)" ], "From": "Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>", "To": "qemu-devel@nongnu.org", "Cc": "Richard Henderson <richard.henderson@linaro.org>, =?utf-8?q?Daniel_P=2E_?=\n\t=?utf-8?q?Berrang=C3=A9?= <berrange@redhat.com>, =?utf-8?q?Marc-Andr=C3=A9_?=\n\t=?utf-8?q?Lureau?= <marcandre.lureau@redhat.com>,\n Markus Armbruster <armbru@redhat.com>, Max Filippov <jcmvbkbc@gmail.com>,\n Paolo Bonzini <pbonzini@redhat.com>,\n =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>,\n Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>,\n Anton Johansson <anjo@rev.ng>", "Subject": "[PATCH v5 3/6] target-info: extract target_info() definition in\n target-info-init.h", "Date": "Fri, 8 May 2026 17:54:50 -0700", "Message-ID": "<20260509005453.3984184-4-pierrick.bouvier@oss.qualcomm.com>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20260509005453.3984184-1-pierrick.bouvier@oss.qualcomm.com>", "References": "<20260509005453.3984184-1-pierrick.bouvier@oss.qualcomm.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "X-Proofpoint-GUID": "nn1Awcif12AurF78UJb6K7OddsBjBcGv", "X-Proofpoint-ORIG-GUID": "nn1Awcif12AurF78UJb6K7OddsBjBcGv", "X-Authority-Analysis": "v=2.4 cv=J7yaKgnS c=1 sm=1 tr=0 ts=69fe85f0 cx=c_pps\n a=JYo30EpNSr/tUYqK9jHPoA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17\n a=IkcTkHD0fZMA:10 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10\n a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22\n a=20KFwNOVAAAA:8 a=EUspDBNiAAAA:8 a=l1QZgXgEFyKk2KBU3EsA:9 a=3ZKOabzyN94A:10\n a=QEXdDO2ut3YA:10 a=Fk4IpSoW4aLDllm1B1p-:22", "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjYwNTA5MDAwNiBTYWx0ZWRfX+GP9gaInVIaw\n FNxzKmJeJSX+5K5IQczXYfIIckT7obEczufdvTzSTz+SswF6y2gk2h1JFK0UrZqI18hrYsx7Ev6\n +IUzsnmyb0BH3BNl9GMyXx2U3Amo8aWkKEkrjynBwfkjfal5R/P8sFNRYVl6pBYWuI1l+Mr6tMp\n RN13t6vFXFzMSRW/BYf4CGZBvMIEtU5eweUYCO24No4V3IB65AMlLKGA21L6Okv6QHiKZiygOfp\n FZziuVqyt4+NL5mjsKxypRp5joS54Na95cTDPgVKtVX+neNpdD3VXo3wp91EQ/I4NXY62IqDsnH\n GK+2bwNu1zIIkAjB+8zhFIdLVEG/qdbeV0pat4wfPmxaH1dEaQNybzvEB9WoQrqD2xiBpLaeVbb\n Oe/j8Qrd6qHS85USuNGgE8NSU0SThtZlSru8Q1jlj1ydM1zAwxdFjTXfYakPGEXDEDT4D4qhL8d\n jtW8vTJNOgOC31hjNEQ==", "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-05-09_01,2026-05-08_02,2025-10-01_01", "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n bulkscore=0 impostorscore=0 clxscore=1015 suspectscore=0 priorityscore=1501\n adultscore=0 lowpriorityscore=0 malwarescore=0 phishscore=0 spamscore=0\n classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0\n reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2605090006", "Received-SPF": "pass client-ip=205.220.180.131;\n envelope-from=pierrick.bouvier@oss.qualcomm.com;\n helo=mx0b-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": "This allows us to prepare next commits, which will introduce qom\nregistration for system mode.\n\nReviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>\nSigned-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>\n---\n configs/targets/aarch64-softmmu.c | 6 +--\n configs/targets/arm-softmmu.c | 6 +--\n include/qemu/module.h | 1 +\n include/qemu/target-info-init.h | 78 +++++++++++++++++++++++++++++++\n include/qemu/target-info-qom.h | 28 +++++++++++\n system/vl.c | 2 +\n target-info-qom.c | 14 ++++++\n target-info-stub.c | 6 +--\n 8 files changed, 129 insertions(+), 12 deletions(-)\n create mode 100644 include/qemu/target-info-init.h\n create mode 100644 include/qemu/target-info-qom.h", "diff": "diff --git a/configs/targets/aarch64-softmmu.c b/configs/targets/aarch64-softmmu.c\nindex 82ccb575759..75d95b0e743 100644\n--- a/configs/targets/aarch64-softmmu.c\n+++ b/configs/targets/aarch64-softmmu.c\n@@ -8,6 +8,7 @@\n \n #include \"qemu/osdep.h\"\n #include \"qemu/target-info-impl.h\"\n+#include \"qemu/target-info-init.h\"\n #include \"hw/arm/machines-qom.h\"\n #include \"target/arm/cpu-qom.h\"\n #include \"target/arm/cpu-param.h\"\n@@ -23,7 +24,4 @@ static const TargetInfo target_info_aarch64_system = {\n .page_bits_init = TARGET_PAGE_BITS_LEGACY,\n };\n \n-const TargetInfo *target_info(void)\n-{\n- return &target_info_aarch64_system;\n-}\n+target_info_init(target_info_aarch64_system)\ndiff --git a/configs/targets/arm-softmmu.c b/configs/targets/arm-softmmu.c\nindex 18940e51e55..73546fa5737 100644\n--- a/configs/targets/arm-softmmu.c\n+++ b/configs/targets/arm-softmmu.c\n@@ -8,6 +8,7 @@\n \n #include \"qemu/osdep.h\"\n #include \"qemu/target-info-impl.h\"\n+#include \"qemu/target-info-init.h\"\n #include \"hw/arm/machines-qom.h\"\n #include \"target/arm/cpu-qom.h\"\n #include \"target/arm/cpu-param.h\"\n@@ -23,7 +24,4 @@ static const TargetInfo target_info_arm_system = {\n .page_bits_init = TARGET_PAGE_BITS_LEGACY,\n };\n \n-const TargetInfo *target_info(void)\n-{\n- return &target_info_arm_system;\n-}\n+target_info_init(target_info_arm_system)\ndiff --git a/include/qemu/module.h b/include/qemu/module.h\nindex 9885ac9afb3..fccf017bf9e 100644\n--- a/include/qemu/module.h\n+++ b/include/qemu/module.h\n@@ -43,6 +43,7 @@ typedef enum {\n MODULE_INIT_MIGRATION,\n MODULE_INIT_BLOCK,\n MODULE_INIT_OPTS,\n+ MODULE_INIT_TARGET_INFO,\n MODULE_INIT_QOM,\n MODULE_INIT_TRACE,\n MODULE_INIT_XEN_BACKEND,\ndiff --git a/include/qemu/target-info-init.h b/include/qemu/target-info-init.h\nnew file mode 100644\nindex 00000000000..3f4eda19083\n--- /dev/null\n+++ b/include/qemu/target-info-init.h\n@@ -0,0 +1,78 @@\n+/*\n+ * QEMU target info initialization\n+ *\n+ * Copyright (c) Qualcomm\n+ *\n+ * SPDX-License-Identifier: GPL-2.0-or-later\n+ *\n+ * This file is included by each file defining a TargetInfo structure and is\n+ * responsible for registering it.\n+ */\n+\n+#ifndef QEMU_TARGET_INFO_INIT_H\n+#define QEMU_TARGET_INFO_INIT_H\n+\n+#define DEFINE_TARGET_INFO_TYPE(info) \\\n+static void do_qemu_init_target_info(void) \\\n+{ \\\n+ type_register_static(&info); \\\n+} \\\n+module_init(do_qemu_init_target_info, MODULE_INIT_TARGET_INFO)\n+\n+#ifdef COMPILING_PER_TARGET\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+ .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+ \\\n+DEFINE_TARGET_INFO_TYPE(target_info_qom_target_type_info)\n+\n+#endif /* CONFIG_USER_ONLY */\n+#endif /* COMPILING_PER_TARGET */\n+\n+#endif /* QEMU_TARGET_INFO_INIT_H */\ndiff --git a/include/qemu/target-info-qom.h b/include/qemu/target-info-qom.h\nnew file mode 100644\nindex 00000000000..585995c7ad0\n--- /dev/null\n+++ b/include/qemu/target-info-qom.h\n@@ -0,0 +1,28 @@\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+#ifndef QEMU_TARGET_INFO_QOM_H\n+#define QEMU_TARGET_INFO_QOM_H\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)\n+\n+#endif /* QEMU_TARGET_INFO_QOM_H */\ndiff --git a/system/vl.c b/system/vl.c\nindex d2f4044e5d8..e44da0941d4 100644\n--- a/system/vl.c\n+++ b/system/vl.c\n@@ -2889,6 +2889,8 @@ void qemu_init(int argc, char **argv)\n \n os_setup_limits();\n \n+ module_call_init(MODULE_INIT_TARGET_INFO);\n+\n module_init_info(qemu_modinfo);\n module_allow_arch(target_name());\n \ndiff --git a/target-info-qom.c b/target-info-qom.c\nindex 7fd58d24818..ba2c7923760 100644\n--- a/target-info-qom.c\n+++ b/target-info-qom.c\n@@ -7,7 +7,11 @@\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-init.h\"\n+#include \"qemu/target-info-qom.h\"\n #include \"hw/arm/machines-qom.h\"\n \n static const TypeInfo target_info_types[] = {\n@@ -22,3 +26,13 @@ static const TypeInfo target_info_types[] = {\n };\n \n DEFINE_TYPES(target_info_types)\n+\n+static const TypeInfo target_info_parent_type = {\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+DEFINE_TARGET_INFO_TYPE(target_info_parent_type)\ndiff --git a/target-info-stub.c b/target-info-stub.c\nindex 07d8647ed8e..22b7911201c 100644\n--- a/target-info-stub.c\n+++ b/target-info-stub.c\n@@ -9,6 +9,7 @@\n #include \"qemu/osdep.h\"\n #include \"qemu/target-info.h\"\n #include \"qemu/target-info-impl.h\"\n+#include \"qemu/target-info-init.h\"\n #include \"hw/core/boards.h\"\n #include \"cpu.h\"\n #include \"exec/cpu-defs.h\"\n@@ -41,7 +42,4 @@ static const TargetInfo target_info_stub = {\n #endif\n };\n \n-const TargetInfo *target_info(void)\n-{\n- return &target_info_stub;\n-}\n+target_info_init(target_info_stub)\n", "prefixes": [ "v5", "3/6" ] }