From nobody Mon Nov 23 04:34:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490409; cv=none; d=zohomail.com; s=zohoarc; b=ezHEx6+csj6fJaFUlpS+DO/b1VZQ0JPXE4dnWXCvdBtNQvRnqHxsw2RxJjhuX9sCdf+y5StW6/dTGN71E4O67FM2dsvaViXdaBhoUAr28YJ58IHXPA/yd0cXXqJ55+DYX1DjwstQHW4oqQbInFY5JQ29a+dnZCv3KXnEXk8tN1M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490409; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=JZvkPD842YdHB6EH4X7Ut/a7FE1rx4KX+x7FeiOC1ek=; b=Pi8d+fe6cyHEU3f98APPIlNKatiQVn7Vz0XEM2aw62iE8I9kXclNHP/OetIh38CqMCb44AB0pyzXaaSYdzxX1+Fo7V6o0CYr3PVEhmiJ1+vKtyoz4xllbHKmERDatITljFlk5MMw4ZN+B6C7JWia/YFhky2NOACICpWrhJ1ho5c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17944904094381002.963951430538; Thu, 12 Nov 2026 05:33:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUtf-0005ot-Cg; Thu, 12 Nov 2026 08:31:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtO-0005gh-Of for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:16 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtM-0000oY-UR for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:06 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-150-ZOrrRSuZMeSr6UaUC_Np5g-1; Thu, 12 Nov 2026 08:31:00 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A9C281956069; Thu, 12 Nov 2026 13:30:59 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 380501956089; Thu, 12 Nov 2026 13:30:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JZvkPD842YdHB6EH4X7Ut/a7FE1rx4KX+x7FeiOC1ek=; b=QPLNMwUoUiWsYqtN7EBfh0CvBnp5QlaxRisLo3BEP7UppYk2H70FAcdutIMfOGNwKZb20Y VpwNyWdv4kaYVo8iXDt4hB+1IHTBk9i4+E8LEs/YMyXBlxYYiRUvFcWW0S5nbMi6cmYe6P WZdM7EbNU4IMVhKuOWv4nkZRQDDsZ+Y= X-MC-Unique: ZOrrRSuZMeSr6UaUC_Np5g-1 X-Mimecast-MFC-AGG-ID: ZOrrRSuZMeSr6UaUC_Np5g_1794490259 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 01/48] iotests: better heuristics to find I/O tests build/source dirs Date: Thu, 12 Nov 2026 13:30:07 +0000 Message-ID: <20261112133054.1977618-2-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490411095158500 Currently the I/O tests cannot be run if executing directly from the source directory, even when wrapped by the 'run' script, due to inadequate heuristics to guess the directories. If using the 'run' script, meson can tell us exactly where the top level build and source directories are, so we don't need to guess. Just read MESON_BUILD_ROOT and MESON_SOURCE_ROOT env variables if present. If not using the 'run' script, we can do a bit better at guessing the path from the 'check' filename. Always resolve from sys.argv[0], even when it is not a symlink, instead of falling back to 'cwd()' which doesn't work since we stopped having in-tree builds. If invoked directly from the source tree, guess that the build root is the default 'build' name which often works. With this change the following all work: 1. From root of build dir, with run script cd build ./run tests/qemu-iotests/check 5 2. From root of build dir, without run script cd build tests/qemu-iotests/check 5 3. From I/O tests subdir of build dir, with run script cd build/tests/qemu-iotests ../../run ./check 5 4. From I/O tests subdir of build dir, without run script cd build/tests/qemu-iotests ./check 5 5. From root of source dir, with run script ./build/run tests/qemu-iotests/check 5 6. From root of source dir, without run script tests/qemu-iotests/check 5 7. From I/O tests subdir of source dir, with run script cd tests/qemu-iotests ../../build/run ./check 5 8. From I/O tests subdir of source dir, without run script cd tests/qemu-iotests ./check 5 Before this commit, items 5-8 would always fail. Items 6 and 8 will not work if using a build directory with a name other than the default 'build'. For those scenarios use one of the other 6 possible variants. Signed-off-by: Daniel P. Berrang=C3=A9 --- meson.build | 1 + tests/qemu-iotests/check | 52 +++++++++++++++++++++++++++++----------- 2 files changed, 39 insertions(+), 14 deletions(-) diff --git a/meson.build b/meson.build index d7bcb581c18..9d15f2e9551 100644 --- a/meson.build +++ b/meson.build @@ -3502,6 +3502,7 @@ genh +=3D config_host_h =20 devenv =3D environment() devenv.set('MESON_BUILD_ROOT', meson.project_build_root()) +devenv.set('MESON_SOURCE_ROOT', meson.project_source_root()) devenv.set('VIRTUAL_ENV', meson.project_build_root() / 'pyvenv') devenv.prepend('PATH', meson.project_build_root() / 'pyvenv'/ 'bin') devenv.prepend('PYTHONPATH', meson.current_source_dir() / 'tests' / 'funct= ional') diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index c8ba536970c..40baa2b4107 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -28,18 +28,42 @@ from findtests import TestFinder from testenv import TestEnv from testrunner import TestRunner =20 -def get_default_path(follow_link=3DFalse): - """ - Try to automagically figure out the path we are running from. - """ - # called from the build tree? - if os.path.islink(sys.argv[0]): - if follow_link: - return os.path.dirname(os.readlink(sys.argv[0])) + +def get_build_dir(): + if "MESON_BUILD_ROOT" in os.environ: + br =3D os.environ["MESON_BUILD_ROOT"] + return os.path.join(br, "tests", "qemu-iotests") + else: + if os.path.islink(sys.argv[0]): + iobr =3D os.path.dirname(sys.argv[0]) + else: + iobr =3D os.path.join(os.path.dirname(sys.argv[0]), + "..", "..", "build", "tests", "qemu-iotest= s") + if (not os.path.exists(os.path.join(iobr, "check")) or + os.path.exists(os.path.join(iobr, "testenv.py"))): + raise Exception(f"MESON_BUILD_ROOT is not set, and guessed " + "I/O tests build root {iobr} does not look " + "valid. Please use the 'run' script to invoke " + "the I/O tests") + return os.path.abspath(iobr) + + +def get_source_dir(): + if "MESON_SOURCE_ROOT" in os.environ: + sr =3D os.environ["MESON_SOURCE_ROOT"] + return os.path.join(sr, "tests", "qemu-iotests") + else: + if os.path.islink(sys.argv[0]): + iosr =3D os.path.dirname(os.readlink(sys.argv[0])) else: - return os.path.dirname(os.path.abspath(sys.argv[0])) - else: # or source tree? - return os.getcwd() + iosr =3D os.path.dirname(sys.argv[0]) + if not os.path.exists(os.path.join(iosr, "testenv.py")): + raise Exception(f"MESON_SOURCE_ROOT is not set, and guessed " + "I/O tests source root {iosr} does not look " + "valid. Please use the 'run' script to invoke " + "the I/O tests") + return os.path.abspath(iosr) + =20 def make_argparser() -> argparse.ArgumentParser: p =3D argparse.ArgumentParser( @@ -131,11 +155,11 @@ def make_argparser() -> argparse.ArgumentParser: 'middle of the process.') g_sel.add_argument('tests', metavar=3D'TEST_FILES', nargs=3D'*', help=3D'tests to run, or "--" followed by a command= ') - g_sel.add_argument('--build-dir', default=3Dget_default_path(), + g_sel.add_argument('--build-dir', default=3Dget_build_dir(), help=3D'Path to iotests build directory') g_sel.add_argument('--source-dir', - default=3Dget_default_path(follow_link=3DTrue), - help=3D'Path to iotests build directory') + default=3Dget_source_dir(), + help=3D'Path to iotests source directory') =20 return p =20 --=20 2.56.1 From nobody Mon Nov 23 04:34:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490602; cv=none; d=zohomail.com; s=zohoarc; b=CZ8z/nXgEX5FxG/L0NCD5RLYkxlwsT71UIRg7YARzOqCV8I6knFwOyb01wCokA+FRTI5ip4T7lCIJb7Y/6RjSqqD0m8hdKemaJokNklBw8mbaAFhq6u2l/WHobMyLNc+oMQwKfKb9B6nCnemO2yutdvKmVQF1hRtj0OlYxOdW0c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490602; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UNhVyDQV08ndeLXfuw+LM4WtU1I1yz5fWjVBYtZZV7M=; b=ViQKJnHLTQocFBljshYoPpRzvBvcUzYgocRDBTTwJ9WYsa1RcgbgU6o9I7fa4PPWFNLtEQjCMT1v6y/ygguCtt7dJp1re4mckx4/pQLFW2LYSNxWOCzJ1m3YKbwdmByj8AI85PtKH85YIVuncY068bRx/CffbsuUhhEGa4ONn4c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490602073357.7379896739733; Thu, 12 Nov 2026 05:36:42 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUth-0005qJ-JV; Thu, 12 Nov 2026 08:31:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtR-0005h4-36 for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:16 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtP-0000pw-Al for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:08 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-286-sfdRJEF3NoC3UpaQipnpEg-1; Thu, 12 Nov 2026 08:31:02 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 74C8F1800A79; Thu, 12 Nov 2026 13:31:01 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 042911956087; Thu, 12 Nov 2026 13:30:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UNhVyDQV08ndeLXfuw+LM4WtU1I1yz5fWjVBYtZZV7M=; b=PUUpuo12m6kU6mDFVf6CJxPxGiolUatdQNW6QL956rDLWHyX03ZqUkKuqxZuh8is2hBCL1 R2TLD37BjYGQIa8g/B6koaC9lQpaO8O+FbnYmvFLcqm8WimPo9O9abYJeopx/7UCuS3TQE 45W6e+PbXj8UUF1stReZ7OsLgKaJcjM= X-MC-Unique: sfdRJEF3NoC3UpaQipnpEg-1 X-Mimecast-MFC-AGG-ID: sfdRJEF3NoC3UpaQipnpEg_1794490261 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 02/48] target-info: add target_mask_selected() Date: Thu, 12 Nov 2026 13:30:08 +0000 Message-ID: <20261112133054.1977618-3-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490604141158501 From: Yonggang Luo Return the QEMU_ARCH_* mask of the selected target. System mode returns QEMU_ARCH_ALL until a target is selected. User mode returns that target's bit. Tools return 0. Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Yonggang Luo --- include/qemu/target-info-init.h | 15 ++++++++++----- include/qemu/target-info.h | 9 +++++++++ stubs/meson.build | 1 + stubs/target-mask-selected.c | 13 +++++++++++++ target-info-def.c | 3 +++ target-info-qom.c | 10 ++++++++++ 6 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 stubs/target-mask-selected.c diff --git a/include/qemu/target-info-init.h b/include/qemu/target-info-ini= t.h index b7024c9faef..84929868328 100644 --- a/include/qemu/target-info-init.h +++ b/include/qemu/target-info-init.h @@ -24,12 +24,17 @@ module_init(do_qemu_init_target_info, MODULE_INIT_TARGE= T_INFO) =20 /* * User mode does not support multiple targets in the same binary, so just - * define target_info(). + * define target_info() and target_mask_selected(). The target is always + * selected. */ -#define target_info_init(ti_var) \ -const TargetInfo *target_info(void) \ -{ \ - return &ti_var; \ +#define target_info_init(ti_var) \ +const TargetInfo *target_info(void) \ +{ \ + return &ti_var; \ +} \ +uint64_t target_mask_selected(void) \ +{ \ + return QEMU_ARCH_BIT((ti_var).target_arch); \ } =20 #else /* CONFIG_USER_ONLY */ diff --git a/include/qemu/target-info.h b/include/qemu/target-info.h index 2cd4cc5671b..5673d10ebae 100644 --- a/include/qemu/target-info.h +++ b/include/qemu/target-info.h @@ -134,4 +134,13 @@ bool target_base_riscv(void); */ bool target_riscv64(void); =20 +/** + * target_mask_selected: + * + * Returns the QEMU_ARCH_* mask of the selected target. System mode + * returns QEMU_ARCH_ALL until a target is selected. User mode returns + * that target's bit. Tools return 0. + */ +uint64_t target_mask_selected(void); + #endif diff --git a/stubs/meson.build b/stubs/meson.build index 744fb759a2f..49cede8582f 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -12,6 +12,7 @@ stub_ss.add(files('monitor-hmp.c')) stub_ss.add(files('qapi-event-emit.c')) stub_ss.add(files('replay-mode.c')) stub_ss.add(files('trace-control.c')) +stub_ss.add(files('target-mask-selected.c')) =20 if have_block stub_ss.add(files('bdrv-next-monitor-owned.c')) diff --git a/stubs/target-mask-selected.c b/stubs/target-mask-selected.c new file mode 100644 index 00000000000..510a515851c --- /dev/null +++ b/stubs/target-mask-selected.c @@ -0,0 +1,13 @@ +/* + * Tools have no selected target. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "qemu/target-info.h" + +uint64_t target_mask_selected(void) +{ + return 0; +} diff --git a/target-info-def.c b/target-info-def.c index bcf9cfe1e43..a9920196266 100644 --- a/target-info-def.c +++ b/target-info-def.c @@ -9,6 +9,9 @@ #include "qemu/osdep.h" #include "qemu/target-info.h" #include "qemu/target-info-def.h" +#ifdef CONFIG_USER_ONLY +#include "qemu/base-arch-defs.h" +#endif #include "qemu/target-info-init.h" #include "hw/core/boards.h" #include "cpu.h" diff --git a/target-info-qom.c b/target-info-qom.c index aeeedb7e818..fb4c9835e5a 100644 --- a/target-info-qom.c +++ b/target-info-qom.c @@ -9,6 +9,8 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qom/object.h" +#include "qemu/base-arch-defs.h" +#include "qemu/target-info.h" #include "qemu/target-info-def.h" #include "qemu/target-info-init.h" #include "qemu/target-info-qom.h" @@ -40,6 +42,14 @@ const TargetInfo *target_info(void) return target_info_ptr; } =20 +uint64_t target_mask_selected(void) +{ + if (!target_info_ptr) { + return QEMU_ARCH_ALL; + } + return QEMU_ARCH_BIT(target_info_ptr->target_arch); +} + void target_info_qom_set_target(void) { g_autoptr(GSList) targets =3D object_class_get_list(TYPE_TARGET_INFO, = false); --=20 2.56.1 From nobody Mon Nov 23 04:34:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490308; cv=none; d=zohomail.com; s=zohoarc; b=hcboAFTgRGUq6vqtG/K2o8GA5+bGYpekjgJ8jsTXbZfh1nG0ql9t2TbIS2LGhFqDulQ95UYd/PYYGkOYt/nWHGN/lgzJ6j7C4JqYBM2a9I3uqkxM8/GJCVgxFYGd5Hbp5TIUIPFU/+f8i6yxDDoMRhnJhZdTSRyynxLNpZuBWmY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490308; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=X5tqEPnDpval/zjsjFv7UUZTZpNNNmOXJzS8goVRL+Q=; b=EhzKyTGcWRzo/Amysel/jY0aEv2fwBBS1lZVJO7G2hHGL2J9XWKYxbysf3Wuv9C6uaj/PHRAaT5xSjhn+CnbW2ZzjzfY26FK0vCiAqfsVIo4VMajgGS4S2E84lQqIRHzJXnR6oaJO/zZLDhZtu55jWwzsgaHUvs/OF6ei8KKJ0o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490308951542.354148401014; Thu, 12 Nov 2026 05:31:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUtc-0005lo-Pl; Thu, 12 Nov 2026 08:31:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtS-0005hC-KM for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:17 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtQ-0000xr-Rw for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:10 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-633-kqI2eBHZMQqtH0Paass_Bw-1; Thu, 12 Nov 2026 08:31:04 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5956818C3DFE; Thu, 12 Nov 2026 13:31:03 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DEE401956089; Thu, 12 Nov 2026 13:31:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=X5tqEPnDpval/zjsjFv7UUZTZpNNNmOXJzS8goVRL+Q=; b=GR/hSCFQXwbU096o2Nk2ccCALCbvyOQ5bZbNH4ADXiJV2vAs1iC+gSoKrqxgaXgH3So66C 8GtMFu0XTKfvkkciCVb+cTUxn8prcU0mlq86bhnyN0pLGBIdEtlWJInIEVNEoLPQQlfobe a0Iws9rbj1iLaoE8dBO2qy9FQipqE+k= X-MC-Unique: kqI2eBHZMQqtH0Paass_Bw-1 X-Mimecast-MFC-AGG-ID: kqI2eBHZMQqtH0Paass_Bw_1794490263 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 03/48] qom: define a TargetSpecific interface Date: Thu, 12 Nov 2026 13:30:09 +0000 Message-ID: <20261112133054.1977618-4-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490312091158500 This can be used to declare a type as being target specific. Implementing the interface just records the target metadata, applying the enforcement requires the object creation path to call 'target_specific_class_check()' to validate the system state. This approach is intended to allow classes to be unconditionally registered, which allows introspection at any time. The target specific enforcement is applied at runtime in the object creation codepaths that need to apply restrictions. This implies that QOM class names must be globally unique across all targets known to QEMU. Signed-off-by: Daniel P. Berrang=C3=A9 --- include/qom/object_interfaces.h | 75 +++++++++++++++++++++++++++++++++ qom/object_interfaces.c | 31 ++++++++++++++ 2 files changed, 106 insertions(+) diff --git a/include/qom/object_interfaces.h b/include/qom/object_interface= s.h index afd0fb93b2b..d222a3d7481 100644 --- a/include/qom/object_interfaces.h +++ b/include/qom/object_interfaces.h @@ -16,6 +16,17 @@ DECLARE_CLASS_CHECKERS(UserCreatableClass, USER_CREATABL= E, =20 typedef struct UserCreatable UserCreatable; =20 +#define TYPE_TARGET_SPECIFIC "target-specific" + +typedef struct TargetSpecificClass TargetSpecificClass; +DECLARE_CLASS_CHECKERS(TargetSpecificClass, TARGET_SPECIFIC, + TYPE_TARGET_SPECIFIC) +#define TARGET_SPECIFIC(obj) \ + INTERFACE_CHECK(TargetSpecific, (obj), \ + TYPE_TARGET_SPECIFIC) + +typedef struct TargetSpecific TargetSpecific; + /** * UserCreatableClass: * @parent_class: the base class @@ -167,4 +178,68 @@ bool user_creatable_del(const char *id, Error **errp); */ void user_creatable_cleanup(void); =20 +/** + * TargetSpecificClass: + * @parent_class: the base class + * + * Interface for classes that want to declare they have target + * specific restrictions. This is intended to allow classes to + * be registered and introspected unconditionally, while + * preventing creation of instances unless a compatible target + * is selected. + */ +struct TargetSpecificClass { + InterfaceClass parent_class; + + /* + * Leave as 0 to indicate no target specific creation restrictions, + * or set to a bitmask of QEMU_ARCH_nnn constants to limit what + * targets it can be created under. + */ + int targets; +}; + + +/** + * target_specific_class_creatable: + * @oc: the object class to check + * + * Determine whether @oc implements the TargetSpecific + * interface and if so, whether its declared targets + * allow creation in the current system state. + * + * If @oc does not implement the TargetSpecific interface + * it is assumed there are no creation restrictions. + * + * If @oc implements the TargetSpecific interface but leaves + * the 'targets' field as zero, it is assumed there are + * no creation restrictions. + * + * If @oc implements the TargetSpecific interface and the + * 'targets' field is non-zero, it is compared to + * target_mask_selected() to determine if it is valid to + * create an instance of @oc. + * + * Returns: true if it is valid to create an instance of @oc + * in the current system state, false otherwise. + */ +bool target_specific_class_creatable(ObjectClass *oc); + + +/** + * target_specific_class_check: + * @oc: the object class to check + * @errp: pointer to a NULL-initialized error object + * + * Check whether it is permitted to create an instance + * of @oc in the current system target state. + * + * This validates @oc against target_specific_class_creatable + * and sets @errp if it is not creatable. + * + * Returns: @oc if it is creatable, NULL otherwise with @errp set. + */ +ObjectClass *target_specific_class_check(ObjectClass *oc, + Error **errp); + #endif diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c index d83c12744b7..f523a55b93a 100644 --- a/qom/object_interfaces.c +++ b/qom/object_interfaces.c @@ -20,6 +20,7 @@ #include "qapi/opts-visitor.h" #include "qemu/config-file.h" #include "qemu/keyval.h" +#include "qemu/target-info.h" #include "trace.h" =20 bool user_creatable_complete(UserCreatable *uc, Error **errp) @@ -280,6 +281,30 @@ void user_creatable_cleanup(void) object_unparent(object_get_objects_root()); } =20 + +bool target_specific_class_creatable(ObjectClass *oc) +{ + TargetSpecificClass *tsc =3D + (TargetSpecificClass *)object_class_dynamic_cast( + oc, TYPE_TARGET_SPECIFIC); + + return !tsc || !tsc->targets || (tsc->targets & target_mask_selected()= ); +} + + +ObjectClass *target_specific_class_check(ObjectClass *oc, + Error **errp) +{ + if (!target_specific_class_creatable(oc)) { + error_setg(errp, "Object '%s' not compatible with selected target", + object_class_get_name(oc)); + return NULL; + } + + return oc; +} + + static void register_types(void) { static const TypeInfo uc_interface_info =3D { @@ -287,8 +312,14 @@ static void register_types(void) .parent =3D TYPE_INTERFACE, .class_size =3D sizeof(UserCreatableClass), }; + static const TypeInfo ts_interface_info =3D { + .name =3D TYPE_TARGET_SPECIFIC, + .parent =3D TYPE_INTERFACE, + .class_size =3D sizeof(TargetSpecificClass), + }; =20 type_register_static(&uc_interface_info); + type_register_static(&ts_interface_info); } =20 type_init(register_types) --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490619; cv=none; d=zohomail.com; s=zohoarc; b=ZcsM1NIzEFBDn2UWvRsmoN5YmIu+IR3cBZ6zg/ifpI515guXRvxVn7Z0i3iAVebXzB0Wsi7uq4kSmR77g2UW1ND8XGqatSnYHt5TY5N3V0TRWtV2Vjnje7LJoQ4hhL4KgwapjqimFyqv3JPYCF7Y8Uiln0lwn+zkgkEGKpO7T6c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490619; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+pIzL/WSrmMfTXw89n2ufJWD7L4b5O+pHiMvq4kaeQE=; b=jSBEVY9TTWxWMsAbq5xjZOuaXm3g5uwGDGnbjW2jIu7hNrqq5MIq3kJVIBe8qT1rbhqR3F4KKVsHtZab+ZTsaFbmakrDwexYUFxHLWZ3ChbMdmJmfO8BXabUxexHF1oTtcPPnuashXgFbzrxWWFmByQROYXA0K9KA39tlrlpnE8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490619967786.9667601274808; Thu, 12 Nov 2026 05:36:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUth-0005q2-Al; Thu, 12 Nov 2026 08:31:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtU-0005hP-J8 for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:17 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtS-000173-TZ for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:12 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-22-XztZ-TWTNlKgm0oQCY_bPA-1; Thu, 12 Nov 2026 08:31:06 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 535AF18974F7; Thu, 12 Nov 2026 13:31:05 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DB05B195608A; Thu, 12 Nov 2026 13:31:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+pIzL/WSrmMfTXw89n2ufJWD7L4b5O+pHiMvq4kaeQE=; b=D+WGRgGPcNqoYa9w51RUjQccKJ+pvpIpYdMu70UNjdVBNDSww/VabjfxYEWVQI2boG1+UR EndPIHf7bzQcs2rvFRzbmskXnE47cmBkpmtxM1LnUFX5tjyngvekxWSoU3XCNUBMORwTBF XAm3G1sRfc7M+9cVfShxtYP/D+T0PDw= X-MC-Unique: XztZ-TWTNlKgm0oQCY_bPA-1 X-Mimecast-MFC-AGG-ID: XztZ-TWTNlKgm0oQCY_bPA_1794490265 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 04/48] qom: define an Aliased interface Date: Thu, 12 Nov 2026 13:30:10 +0000 Message-ID: <20261112133054.1977618-5-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490620434158500 All QOM types must have a globally unique typename, however, for user convenience, some might also want to have aliases which are permitted to be ambiguous. Define an "Aliased" interface which can be implemented by types which want to support aliases. When resolving an alias, if there are multiple QOM types with a matching alias this is considered an error. Ambiguity can be resolved by matching system state, with the selected target being the currently implemented filter. Signed-off-by: Daniel P. Berrang=C3=A9 --- include/qom/object_interfaces.h | 77 +++++++++++++++++++++++++++++++++ qom/object_interfaces.c | 57 ++++++++++++++++++++++++ 2 files changed, 134 insertions(+) diff --git a/include/qom/object_interfaces.h b/include/qom/object_interface= s.h index d222a3d7481..010e37d63f7 100644 --- a/include/qom/object_interfaces.h +++ b/include/qom/object_interfaces.h @@ -27,6 +27,17 @@ DECLARE_CLASS_CHECKERS(TargetSpecificClass, TARGET_SPECI= FIC, =20 typedef struct TargetSpecific TargetSpecific; =20 +#define TYPE_ALIASED "aliased" + +typedef struct AliasedClass AliasedClass; +DECLARE_CLASS_CHECKERS(AliasedClass, ALIASED, + TYPE_ALIASED) +#define ALIASED(obj) \ + INTERFACE_CHECK(Aliased, (obj), \ + TYPE_ALIASED) + +typedef struct Aliased Aliased; + /** * UserCreatableClass: * @parent_class: the base class @@ -242,4 +253,70 @@ bool target_specific_class_creatable(ObjectClass *oc); ObjectClass *target_specific_class_check(ObjectClass *oc, Error **errp); =20 +/** + * AliasedClass + * @parent_class: the base class + * + * Interface for classes that want to declare they have aliases + * for their primary type name. + * + * While QOM type names are required to be unique, aliases allow + * for ambiguity across classes. The ambiguity is resolved at + * runtime based on system state, typically by the selection of + * a specific target. If ambiguity cannot be resolved, the user + * will need to use the unique QOM type name instead. + */ +struct AliasedClass { + InterfaceClass parent_class; + + const char *const *aliases; /* NULL terminated list of typenames */ +}; + + +/** + * aliased_class_matches: + * @oc: the class object to check + * @typename: the possible type name alias to check + * + * Determine whether @oc implements the Aliased interface + * and has declared an alias that matches @typename. + * + * Returns: true if @oc implements Aliased and has an + * alias named @typename, false otherwise + */ +bool aliased_class_matches(ObjectClass *oc, + const char *typename); + + +/** + * aliased_class_resolve: + * @implements: a parent type to validate + * @typename: a type name to search for + * @errp: pointer to a NULL initialized error object + * + * Search all registered QOM types that implement + * both @implements and the Aliased interface for + * one that declares an alias @typename. + * + * If there is a single QOM class with a matching alias + * it will be returned. + * + * If there are multiple QOM classes with a matching + * alias an error will be raised about the ambiguous + * match. + * + * If the QOM class also implements the TargetSpecific + * interface and the current system target does not + * match the declared supported targets, aliases for + * that QOM class will be ignored. This is usually + * sufficient to resolve ambiguity between types. + * + * Returns: a unique QOM class with an alias @typename, + * or NULL if zero or multiple aliases match, with @errp + * set. + */ + ObjectClass *aliased_class_resolve(const char *implements, + const char *typename, + Error **errp); + #endif diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c index f523a55b93a..136629f88b2 100644 --- a/qom/object_interfaces.c +++ b/qom/object_interfaces.c @@ -305,6 +305,57 @@ ObjectClass *target_specific_class_check(ObjectClass *= oc, } =20 =20 +bool aliased_class_matches(ObjectClass *oc, const char *typename) +{ + AliasedClass *alc =3D + (AliasedClass *)object_class_dynamic_cast( + oc, TYPE_ALIASED); + + return alc && alc->aliases && g_strv_contains(alc->aliases, typename); +} + + +ObjectClass *aliased_class_resolve(const char *implements, + const char *typename, + Error **errp) +{ + g_autoptr(GSList) objs =3D object_class_get_list(implements, false); + GSList *el; + ObjectClass *ret =3D NULL; + g_autofree const char **matches =3D NULL; + size_t nmatches =3D 0; + + for (el =3D objs; el; el =3D el->next) { + ObjectClass *oc =3D el->data; + + if (aliased_class_matches(oc, typename) && + target_specific_class_creatable(oc)) { + matches =3D g_renew(const char *, matches, nmatches + 2); + matches[nmatches] =3D object_class_get_name(oc); + matches[nmatches + 1] =3D NULL; + + ret =3D oc; + } + } + + if (nmatches > 1) { + g_autofree char *matchesstr =3D g_strjoinv(", ", (char **)matches); + error_setg(errp, + "Object alias '%s' is not unique, matches %s", + typename, matchesstr); + return NULL; + } + + if (!ret) { + error_setg(errp, "Object '%s' not found, no child of '%s' register= ed", + typename, implements); + return NULL; + } + + return ret; +} + + static void register_types(void) { static const TypeInfo uc_interface_info =3D { @@ -317,9 +368,15 @@ static void register_types(void) .parent =3D TYPE_INTERFACE, .class_size =3D sizeof(TargetSpecificClass), }; + static const TypeInfo al_interface_info =3D { + .name =3D TYPE_ALIASED, + .parent =3D TYPE_INTERFACE, + .class_size =3D sizeof(AliasedClass), + }; =20 type_register_static(&uc_interface_info); type_register_static(&ts_interface_info); + type_register_static(&al_interface_info); } =20 type_init(register_types) --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490532; cv=none; d=zohomail.com; s=zohoarc; b=LNyBCS4fUqJ02a9aoNwH0ERBMBQed3obz1E+uONIcMLsUFVkKp9iqqsP59HvQh1Roph9AMmntNmH9kwCZ6ryPqv4pl5FmHA3km+vgIU7vgb/iaBMh242M0rE6Dy+Z5vcgnA862YJQZqNSvpz0ssKpSY4rJbdk5oyg274VUfgC60= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490532; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=LlneQmjnKE9WT1F9Xz9iD9ar5TKhxHjLqfpr2u0vw64=; b=VtAmSeTlJHQXPhb0+Sqde8j40JyBnUdUbzNEk7SxyQcGc1drSv2903MOgsCEOnYdiSj3+4voEYK4FkK+ReeVlQ9zrcLWlJpJdhGPfbWiudlq37bVVlf6+VSm2YfUh7J+ydBNOwYLDVf9wEU3AxMJEYBzzBLdJaSmYdz1ogba/C8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490532837585.4682242006181; Thu, 12 Nov 2026 05:35:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUtj-0005r3-HY; Thu, 12 Nov 2026 08:31:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtV-0005hf-E7 for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:17 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtT-000175-1m for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:13 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-371-Lt1y-CojPd2KIm9Xi4OdmQ-1; Thu, 12 Nov 2026 08:31:08 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BFF0318850FA; Thu, 12 Nov 2026 13:31:07 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B49A01956087; Thu, 12 Nov 2026 13:31:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LlneQmjnKE9WT1F9Xz9iD9ar5TKhxHjLqfpr2u0vw64=; b=b4DZjen7nd8KgpsELBy3L3AVjEuscnK2jfrhvavseNefX1YUfKjcaUj0nh0BeHwSo2Dcvy 04USncuqoFQFXExu4IzgvNmScNVxX1afRbl6oapYJCT21m8gcQ3h37wjjrps98e7q9dHhD 7YX020xQOLLeU6JAiBZFzz/pdBV88d4= X-MC-Unique: Lt1y-CojPd2KIm9Xi4OdmQ-1 X-Mimecast-MFC-AGG-ID: Lt1y-CojPd2KIm9Xi4OdmQ_1794490267 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 05/48] hw: tweak approach to setting alias in machine macros Date: Thu, 12 Nov 2026 13:30:11 +0000 Message-ID: <20261112133054.1977618-6-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490535004158500 Currently the pattern for DEFINE_MACHINE macros is to pass a boolean "latest" flag as a macro parameter, which is then used in a test. For example ... if (latest) { mc->alias =3D "s390-ccw-virtio"; mc->is_default =3D true; } On the surface this looks fine, but this is actually taking a build time static characteristic of the machine type and turning it into a runtime tunable that only ever has a single code path. ie the macro code expands to: if (true) { mc->alias =3D "s390-ccw-virtio"; mc->is_default =3D true; } or if (false) { mc->alias =3D "s390-ccw-virtio"; mc->is_default =3D true; } The compiler should optimize out the condition, but we can do do this explicitly by passing the desired extra initializers to the macro directly. This makes the macro definition a bit more verbose, but it will facilitate forthcoming changes that require more complex initialization to be added to the class initializer methods. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- hw/arm/virt.c | 12 ++++++------ hw/i386/pc_piix.c | 7 +++++-- hw/i386/pc_q35.c | 10 +++++++--- hw/loongarch/virt.c | 14 +++++++------- hw/m68k/virt.c | 12 ++++++------ hw/ppc/spapr.c | 19 +++++++------------ hw/s390x/s390-virtio-ccw.c | 14 +++++++------- include/hw/core/boards.h | 18 +++++++++--------- include/hw/i386/pc.h | 5 ++--- 9 files changed, 56 insertions(+), 55 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 0b11f7e328c..e481d0e548b 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -112,7 +112,7 @@ static void arm_virt_compat_default_set(MachineClass *m= c) arm_virt_compat_defaults_len); } =20 -#define DEFINE_VIRT_MACHINE_IMPL(latest, ...) \ +#define DEFINE_VIRT_MACHINE_IMPL(classinitextra, ...) \ static void MACHINE_VER_SYM(class_init, virt, __VA_ARGS__)( \ ObjectClass *oc, \ const void *data) \ @@ -122,9 +122,7 @@ static void arm_virt_compat_default_set(MachineClass *m= c) MACHINE_VER_SYM(options, virt, __VA_ARGS__)(mc); \ mc->desc =3D "QEMU " MACHINE_VER_STR(__VA_ARGS__) " ARM Virtual Ma= chine"; \ MACHINE_VER_DEPRECATION(__VA_ARGS__); \ - if (latest) { \ - mc->alias =3D "virt"; \ - } \ + classinitextra \ } \ static const TypeInfo MACHINE_VER_SYM(info, virt, __VA_ARGS__) =3D \ { \ @@ -142,9 +140,11 @@ static void arm_virt_compat_default_set(MachineClass *= mc) type_init(MACHINE_VER_SYM(register, virt, __VA_ARGS__)); =20 #define DEFINE_VIRT_MACHINE_AS_LATEST(major, minor) \ - DEFINE_VIRT_MACHINE_IMPL(true, major, minor) + DEFINE_VIRT_MACHINE_IMPL({ \ + mc->alias =3D "virt"; \ + }, major, minor) #define DEFINE_VIRT_MACHINE(major, minor) \ - DEFINE_VIRT_MACHINE_IMPL(false, major, minor) + DEFINE_VIRT_MACHINE_IMPL({}, major, minor) =20 =20 /* Number of external interrupt lines to configure the GIC with */ diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 446590e4e55..88356bf0d77 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -363,10 +363,13 @@ static void pc_i440fx_init(MachineState *machine) } =20 #define DEFINE_I440FX_MACHINE(major, minor) \ - DEFINE_PC_VER_MACHINE(pc_i440fx, "pc-i440fx", pc_i440fx_init, false, N= ULL, major, minor); + DEFINE_PC_VER_MACHINE(pc_i440fx, "pc-i440fx", pc_i440fx_init, \ + {}, major, minor); =20 #define DEFINE_I440FX_MACHINE_AS_LATEST(major, minor) \ - DEFINE_PC_VER_MACHINE(pc_i440fx, "pc-i440fx", pc_i440fx_init, true, "p= c", major, minor); + DEFINE_PC_VER_MACHINE(pc_i440fx, "pc-i440fx", pc_i440fx_init, { \ + mc->is_default =3D true; mc->alias =3D "pc"; \ + }, major, minor); =20 static void pc_i440fx_machine_options(MachineClass *m) { diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index c3ce9c56492..9c6459b934d 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -339,13 +339,17 @@ static void pc_q35_machine_set_wdat(Object *o, bool v= alue, Error **errp) } =20 #define DEFINE_Q35_MACHINE(major, minor) \ - DEFINE_PC_VER_MACHINE(pc_q35, "pc-q35", pc_q35_init, false, NULL, majo= r, minor); + DEFINE_PC_VER_MACHINE(pc_q35, "pc-q35", pc_q35_init, {}, \ + major, minor); =20 #define DEFINE_Q35_MACHINE_AS_LATEST(major, minor) \ - DEFINE_PC_VER_MACHINE(pc_q35, "pc-q35", pc_q35_init, false, "q35", maj= or, minor); + DEFINE_PC_VER_MACHINE(pc_q35, "pc-q35", pc_q35_init, { \ + mc->alias =3D "q35"; \ + }, major, minor); =20 #define DEFINE_Q35_MACHINE_BUGFIX(major, minor, micro) \ - DEFINE_PC_VER_MACHINE(pc_q35, "pc-q35", pc_q35_init, false, NULL, majo= r, minor, micro); + DEFINE_PC_VER_MACHINE(pc_q35, "pc-q35", pc_q35_init, {}, \ + major, minor, micro); =20 static void pc_q35_machine_options(MachineClass *m) { diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index c67dad095ab..30a2ab6be9d 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -1521,7 +1521,7 @@ static void virt_class_init(ObjectClass *oc, const vo= id *data) "for PCI MMIO"); } =20 -#define DEFINE_VIRT_MACHINE_VERSION(latest, ...) \ +#define DEFINE_VIRT_MACHINE_VERSION(classinitextra, ...) \ static void MACHINE_VER_SYM(class_init, virt, __VA_ARGS__)( \ ObjectClass *oc, \ const void *data) \ @@ -1530,10 +1530,7 @@ static void virt_class_init(ObjectClass *oc, const v= oid *data) MACHINE_VER_SYM(options, virt, __VA_ARGS__)(mc); \ mc->desc =3D "QEMU " MACHINE_VER_STR(__VA_ARGS__) " LoongArch Virt= ual Machine"; \ MACHINE_VER_DEPRECATION(__VA_ARGS__); \ - if (latest) { \ - mc->alias =3D "virt"; \ - mc->is_default =3D true; \ - } \ + classinitextra \ } \ static const TypeInfo MACHINE_VER_SYM(info, virt, __VA_ARGS__) =3D \ { \ @@ -1550,9 +1547,12 @@ static void virt_class_init(ObjectClass *oc, const v= oid *data) type_init(MACHINE_VER_SYM(register, virt, __VA_ARGS__)); =20 #define DEFINE_VIRT_MACHINE_AS_LATEST(major, minor) \ - DEFINE_VIRT_MACHINE_VERSION(true, major, minor) + DEFINE_VIRT_MACHINE_VERSION({ \ + mc->alias =3D "virt"; \ + mc->is_default =3D true; \ + }, major, minor) #define DEFINE_VIRT_MACHINE(major, minor) \ - DEFINE_VIRT_MACHINE_VERSION(false, major, minor) + DEFINE_VIRT_MACHINE_VERSION({}, major, minor) =20 static void virt_instance_finalize(Object *obj) { diff --git a/hw/m68k/virt.c b/hw/m68k/virt.c index e52546e4fab..2418bd3d503 100644 --- a/hw/m68k/virt.c +++ b/hw/m68k/virt.c @@ -337,7 +337,7 @@ static void virt_machine_register_types(void) =20 type_init(virt_machine_register_types) =20 -#define DEFINE_VIRT_MACHINE_IMPL(latest, ...) \ +#define DEFINE_VIRT_MACHINE_IMPL(classinitextra, ...) \ static void MACHINE_VER_SYM(class_init, virt, __VA_ARGS__)( \ ObjectClass *oc, \ const void *data) \ @@ -346,9 +346,7 @@ type_init(virt_machine_register_types) MACHINE_VER_SYM(options, virt, __VA_ARGS__)(mc); \ mc->desc =3D "QEMU " MACHINE_VER_STR(__VA_ARGS__) " M68K Virtual M= achine"; \ MACHINE_VER_DEPRECATION(__VA_ARGS__); \ - if (latest) { \ - mc->alias =3D "virt"; \ - } \ + classinitextra \ } \ static const TypeInfo MACHINE_VER_SYM(info, virt, __VA_ARGS__) =3D \ { \ @@ -365,9 +363,11 @@ type_init(virt_machine_register_types) type_init(MACHINE_VER_SYM(register, virt, __VA_ARGS__)); =20 #define DEFINE_VIRT_MACHINE_AS_LATEST(major, minor) \ - DEFINE_VIRT_MACHINE_IMPL(true, major, minor) + DEFINE_VIRT_MACHINE_IMPL({ \ + mc->alias =3D "virt"; \ + }, major, minor) #define DEFINE_VIRT_MACHINE(major, minor) \ - DEFINE_VIRT_MACHINE_IMPL(false, major, minor) + DEFINE_VIRT_MACHINE_IMPL({}, major, minor) =20 static void virt_machine_11_2_options(MachineClass *mc) { diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 54e3cc3cbe4..8816f607a8f 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -4728,13 +4728,7 @@ static const TypeInfo spapr_machine_info =3D { }, }; =20 -static void spapr_machine_latest_class_options(MachineClass *mc) -{ - mc->alias =3D "pseries"; - mc->is_default =3D true; -} - -#define DEFINE_SPAPR_MACHINE_IMPL(latest, ...) \ +#define DEFINE_SPAPR_MACHINE_IMPL(classinitextra, ...) \ static void MACHINE_VER_SYM(class_init, spapr, __VA_ARGS__)( \ ObjectClass *oc, \ const void *data) \ @@ -4742,9 +4736,7 @@ static void spapr_machine_latest_class_options(Machin= eClass *mc) MachineClass *mc =3D MACHINE_CLASS(oc); \ MACHINE_VER_SYM(class_options, spapr, __VA_ARGS__)(mc); \ MACHINE_VER_DEPRECATION(__VA_ARGS__); \ - if (latest) { \ - spapr_machine_latest_class_options(mc); \ - } \ + classinitextra; \ } \ static const TypeInfo MACHINE_VER_SYM(info, spapr, __VA_ARGS__) =3D \ { \ @@ -4761,9 +4753,12 @@ static void spapr_machine_latest_class_options(Machi= neClass *mc) type_init(MACHINE_VER_SYM(register, spapr, __VA_ARGS__)) =20 #define DEFINE_SPAPR_MACHINE_AS_LATEST(major, minor) \ - DEFINE_SPAPR_MACHINE_IMPL(true, major, minor) + DEFINE_SPAPR_MACHINE_IMPL({ \ + mc->alias =3D "pseries"; \ + mc->is_default =3D true; \ + }, major, minor) #define DEFINE_SPAPR_MACHINE(major, minor) \ - DEFINE_SPAPR_MACHINE_IMPL(false, major, minor) + DEFINE_SPAPR_MACHINE_IMPL({}, major, minor) =20 /* * pseries-11.2 diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 214445c018f..eafb603f3e0 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -961,7 +961,7 @@ static const TypeInfo ccw_machine_info =3D { }, }; =20 -#define DEFINE_CCW_MACHINE_IMPL(latest, ...) = \ +#define DEFINE_CCW_MACHINE_IMPL(classinitextra, ...) = \ static void MACHINE_VER_SYM(mach_init, ccw, __VA_ARGS__)(MachineState = *mach) \ { = \ MACHINE_VER_SYM(instance_options, ccw, __VA_ARGS__)(mach); = \ @@ -979,10 +979,7 @@ static const TypeInfo ccw_machine_info =3D { mc->desc =3D "Virtual s390x machine (version " MACHINE_VER_STR(__V= A_ARGS__) ")"; \ mc->init =3D MACHINE_VER_SYM(mach_init, ccw, __VA_ARGS__); = \ MACHINE_VER_DEPRECATION(__VA_ARGS__); = \ - if (latest) { = \ - mc->alias =3D "s390-ccw-virtio"; = \ - mc->is_default =3D true; = \ - } = \ + classinitextra = \ } = \ static const TypeInfo MACHINE_VER_SYM(info, ccw, __VA_ARGS__) =3D = \ { = \ @@ -999,10 +996,13 @@ static const TypeInfo ccw_machine_info =3D { type_init(MACHINE_VER_SYM(register, ccw, __VA_ARGS__)) =20 #define DEFINE_CCW_MACHINE_AS_LATEST(major, minor) \ - DEFINE_CCW_MACHINE_IMPL(true, major, minor) + DEFINE_CCW_MACHINE_IMPL({ \ + mc->alias =3D "s390-ccw-virtio"; \ + mc->is_default =3D true; \ + }, major, minor) =20 #define DEFINE_CCW_MACHINE(major, minor) \ - DEFINE_CCW_MACHINE_IMPL(false, major, minor) + DEFINE_CCW_MACHINE_IMPL({}, major, minor) =20 =20 static void ccw_machine_11_2_instance_options(MachineState *machine) diff --git a/include/hw/core/boards.h b/include/hw/core/boards.h index d0e4ad98201..a25c627c0c8 100644 --- a/include/hw/core/boards.h +++ b/include/hw/core/boards.h @@ -464,7 +464,7 @@ struct MachineState { * For example, a macro that can be used to define versioned * 'virt' machine types would look like: * - * #define DEFINE_VIRT_MACHINE_IMPL(latest, ...) \ + * #define DEFINE_VIRT_MACHINE_IMPL(classinitextra, ...) \ * static void MACHINE_VER_SYM(class_init, virt, __VA_ARGS__)( \ * ObjectClass *oc, \ * void *data) \ @@ -473,9 +473,7 @@ struct MachineState { * MACHINE_VER_SYM(options, virt, __VA_ARGS__)(mc); \ * mc->desc =3D "QEMU " MACHINE_VER_STR(__VA_ARGS__) " Virtual Ma= chine"; \ * MACHINE_VER_DEPRECATION(__VA_ARGS__); \ - * if (latest) { \ - * mc->alias =3D "virt"; \ - * } \ + * classinitextra \ * } \ * static const TypeInfo MACHINE_VER_SYM(info, virt, __VA_ARGS__) =3D= { \ * .name =3D MACHINE_VER_TYPE_NAME("virt", __VA_ARGS__), \ @@ -494,23 +492,25 @@ struct MachineState { * * // Normal 2 digit, marked as latest e.g. 'virt-9.0' * #define DEFINE_VIRT_MACHINE_LATEST(major, minor) \ - * DEFINE_VIRT_MACHINE_IMPL(true, major, minor) + * DEFINE_VIRT_MACHINE_IMPL({ \ + * mc->alias =3D "virt"; \ + * }, major, minor) * * // Normal 2 digit e.g. 'virt-9.0' * #define DEFINE_VIRT_MACHINE(major, minor) \ - * DEFINE_VIRT_MACHINE_IMPL(false, major, minor) + * DEFINE_VIRT_MACHINE_IMPL({}, major, minor) * * // Bugfix 3 digit e.g. 'virt-9.0.1' * #define DEFINE_VIRT_MACHINE_BUGFIX(major, minor, micro) \ - * DEFINE_VIRT_MACHINE_IMPL(false, major, minor, micro) + * DEFINE_VIRT_MACHINE_IMPL({}, major, minor, micro) * * // Tagged 2 digit e.g. 'virt-9.0-extra' * #define DEFINE_VIRT_MACHINE_TAGGED(major, minor, tag) \ - * DEFINE_VIRT_MACHINE_IMPL(false, major, minor, _, tag) + * DEFINE_VIRT_MACHINE_IMPL({}, major, minor, _, tag) * * // Tagged bugfix 2 digit e.g. 'virt-9.0.1-extra' * #define DEFINE_VIRT_MACHINE_TAGGED(major, minor, micro, tag) \ - * DEFINE_VIRT_MACHINE_IMPL(false, major, minor, micro, _, tag) + * DEFINE_VIRT_MACHINE_IMPL({}, major, minor, micro, _, tag) */ =20 #define DEFINE_MACHINE_EXTENDED(namestr, PARENT_NAME, InstanceName, \ diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 844ae835784..190d966c7bb 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -308,7 +308,7 @@ extern const size_t pc_compat_4_1_len; DEFINE_PC_MACHINE_EXTENDED(suffix, namestr, initfn, optsfn, true) =20 =20 -#define DEFINE_PC_VER_MACHINE(namesym, namestr, initfn, isdefault, malias,= ...) \ +#define DEFINE_PC_VER_MACHINE(namesym, namestr, initfn, classinitextra, ..= .) \ static void MACHINE_VER_SYM(init, namesym, __VA_ARGS__)( \ MachineState *machine) \ { \ @@ -322,8 +322,7 @@ extern const size_t pc_compat_4_1_len; MACHINE_VER_SYM(options, namesym, __VA_ARGS__)(mc); \ mc->init =3D MACHINE_VER_SYM(init, namesym, __VA_ARGS__); \ MACHINE_VER_DEPRECATION(__VA_ARGS__); \ - mc->is_default =3D isdefault; \ - mc->alias =3D malias; \ + classinitextra \ } \ static const TypeInfo MACHINE_VER_SYM(info, namesym, __VA_ARGS__) =3D \ { \ --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490325; cv=none; d=zohomail.com; s=zohoarc; b=NCFX1o2VS3vZTwUqbJhNaHJqdpUnUzo0mhZSlspYVJ5Jx6LrESxUPlCG6Ou1SqYz6j6UuKIp7WqzAjKT0lK/dmHqN4PrJetq/nDrq0N0tX+Vc4iO8Hjad/ZALIuTwrSmia8PxlOvawAjNFYgrvEVDTQOTg1mGaaD+TWiUg+tbv4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490325; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ozvZdr3jGqKLilEMWFZjVQKrkpIpvLsHtTiBL5BNrp0=; b=eLLNcY21ojgEHJh/wI2SAT2f5v5idNE/HEm9SqRGwlPT91/swEtdQ4VzGjNLViRqTLlstOrsmw1AeahZI82ndFUkkYDAo1WQGaCDbzAiJnEj+DppflbaKjr1eO8v5ZctaqqnItTimRtR8AKLIqamdxD3R6dckliXKRrdlf3ULCM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490325687590.6377418276279; Thu, 12 Nov 2026 05:32:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUtc-0005ld-N8; Thu, 12 Nov 2026 08:31:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtZ-0005i6-DT for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:18 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtW-0001FQ-Ue for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:17 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-331-8NldZlW2NKicCbzzRzLNHQ-1; Thu, 12 Nov 2026 08:31:10 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AD53819775F4; Thu, 12 Nov 2026 13:31:09 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1CF711956087; Thu, 12 Nov 2026 13:31:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490274; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ozvZdr3jGqKLilEMWFZjVQKrkpIpvLsHtTiBL5BNrp0=; b=TU3B7sg8SoM70MuaybY9eGtpI+TCYNwKQRp1OZhVzMFlgN7zlrzOXAr5Avbc9DgMeig8Uc FN8Qo16mzioRcAzjZFymjqATyQ1XxX2OxjcOy/cJZjgdzmeDNcIvg9dWCPCXwp5hQiCOi/ +lsjmD15/A8o5/KqeYwv8lR+6W74wz4= X-MC-Unique: 8NldZlW2NKicCbzzRzLNHQ-1 X-Mimecast-MFC-AGG-ID: 8NldZlW2NKicCbzzRzLNHQ_1794490269 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 06/48] hw/core: implement TYPE_ALIASED interface in machines Date: Thu, 12 Nov 2026 13:30:12 +0000 Message-ID: <20261112133054.1977618-7-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490327929158500 Make the TYPE_MACHINE class implement the TYPE_ALIASED interface which will replace use of the 'alias' parameter in MachineClass. The current 'alias' records the user facing machine name, while 'aliases' in TYPE_ALIASED will report an internal type name alias. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- hw/core/machine.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/core/machine.c b/hw/core/machine.c index ed9bf8f5008..f7406537aa7 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -1802,6 +1802,10 @@ static const TypeInfo machine_info =3D { .instance_size =3D sizeof(MachineState), .instance_init =3D machine_initfn, .instance_finalize =3D machine_finalize, + .interfaces =3D (const InterfaceInfo[]) { + { TYPE_ALIASED }, + { } + } }; =20 static void machine_register_types(void) --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490308; cv=none; d=zohomail.com; s=zohoarc; b=NplqzwEKTlCU8/VWnl4W/A2GtztK3/gsjHYfI3az4y4r96C7E2QfOxTy7qkFIBF6PYHCTn+DVkb62MblihMoY2O8EWgCq1OgjBEB83UO5qCif1rfQoR2VqbRqeuWKslAYpU1W+1YX42p49lE6OtO2tbEYhTSc0r1PJP/RlwdQrs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490308; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Lwn56zNkYqAvYtlO4GevRmmSKH6d6k6649k/+dHppWw=; b=BsNjX5njzrSSJXGBsRhbOp4JhF8k8QuZjqE8GiuGVau/uKtLAvuYjZ8pd/JBwFJjEelvUZ1DYPKNaOPS7uhy6u4s4dc+6j/MGFAi6OPiILnqSrBvYw/BnPzigTtBz7iyLZD5u7veehbbbxS5Qom9CJ6ETeBdkWubeH7RIao+S7Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490308605882.8404713451966; Thu, 12 Nov 2026 05:31:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUtd-0005mk-H1; Thu, 12 Nov 2026 08:31:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUta-0005jO-4T for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:18 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtY-0001Ia-17 for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:17 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-117-dBH6RHHuO9efW6v6C6ZeEQ-1; Thu, 12 Nov 2026 08:31:12 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5E89C1800548; Thu, 12 Nov 2026 13:31:11 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E51FE1956089; Thu, 12 Nov 2026 13:31:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490274; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Lwn56zNkYqAvYtlO4GevRmmSKH6d6k6649k/+dHppWw=; b=PmrrkZiV3s03MByH6mgXmB/7jw/qtQKv2iKygfs97T/G691HQnooA8JgGJnE9bx5HY0+Ed +LLXBGhjD5pt0l5D2l0wAcSJKDlmvCtkr+Ovf1Okyy1FU38hM4atQhnO1tChir2wyr8Mxh uMNrhItqEHMqcsyDsHFfAPGPrcmCZAY= X-MC-Unique: dBH6RHHuO9efW6v6C6ZeEQ-1 X-Mimecast-MFC-AGG-ID: dBH6RHHuO9efW6v6C6ZeEQ_1794490271 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 07/48] qapi: report multiple aliases in MachineInfo Date: Thu, 12 Nov 2026 13:30:13 +0000 Message-ID: <20261112133054.1977618-8-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490309992158500 The MachineInfo struct is extended to report the list of aliases from the TYPE_ALIASED interface, in preference to the traditional alias from the TYPE_MACHINE struct. Initially we use 'alias' to fill the 'aliases' field in QOM. As machines get converted to set 'aliases', the first 'aliases' element will get used to fill 'alias. This provides backcompat during the transition phase. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- hw/core/machine-qmp-cmds.c | 25 +++++++++++++++++++++++++ qapi/machine.json | 3 +++ 2 files changed, 28 insertions(+) diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index 0558d6d703c..787c69e176f 100644 --- a/hw/core/machine-qmp-cmds.c +++ b/hw/core/machine-qmp-cmds.c @@ -33,6 +33,7 @@ #include "system/runstate.h" #include "system/system.h" #include "hw/s390x/storage-keys.h" +#include "qom/object_interfaces.h" =20 /* * QMP query for enabled and present accelerators @@ -163,6 +164,7 @@ MachineInfoList *qmp_query_machines(bool has_compat_pro= ps, bool compat_props, MachineClass *mc =3D el->data; const char *default_cpu_type =3D machine_class_default_cpu_type(mc= ); MachineInfo *info; + AliasedClass *alc =3D ALIASED_CLASS(mc); =20 info =3D g_malloc0(sizeof(*info)); if (mc->is_default) { @@ -170,8 +172,31 @@ MachineInfoList *qmp_query_machines(bool has_compat_pr= ops, bool compat_props, info->is_default =3D true; } =20 + if (alc->aliases) { + strList **aliases =3D &info->aliases; + size_t i; + info->has_aliases =3D true; + for (i =3D 0; alc->aliases[i] !=3D NULL; i++) { + /* + * We record type names internally, but publically + * we report machine types to the user, hence must + * strip the typename suffix + */ + int len =3D strlen(alc->aliases[i]) - strlen(TYPE_MACHINE_= SUFFIX); + QAPI_LIST_APPEND(aliases, + g_strndup(alc->aliases[i], len)); + } + if (!mc->alias) { + int len =3D strlen(alc->aliases[0]) - strlen(TYPE_MACHINE_= SUFFIX); + info->alias =3D g_strndup(alc->aliases[0], len); + } + } if (mc->alias) { info->alias =3D g_strdup(mc->alias); + if (!info->aliases) { + strList **aliases =3D &info->aliases; + QAPI_LIST_APPEND(aliases, g_strdup(mc->alias)); + } } =20 info->name =3D g_strdup(mc->name); diff --git a/qapi/machine.json b/qapi/machine.json index 18d9dce849b..c25a492a4e8 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -163,6 +163,8 @@ # # @alias: an alias for the machine name # +# @aliases: a list of aliases for the machine type name (since 12.0) +# # @is-default: whether the machine is default # # @cpu-max: maximum number of CPUs supported by the machine type @@ -202,6 +204,7 @@ ## { 'struct': 'MachineInfo', 'data': { 'name': 'str', '*alias': 'str', + '*aliases': ['str'], '*is-default': 'bool', 'cpu-max': 'int', 'hotpluggable-cpus': 'bool', 'numa-mem-supported': 'bool', 'deprecated': 'bool', '*default-cpu-type': 'str', --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490561; cv=none; d=zohomail.com; s=zohoarc; b=KRY099WfRVVjqUemD06ql0aF0wCkg/lKmIeerGG2Qe7zqnazuXmQWP19Gjv8lUlGLSVHMgSuE4NaetF/Y0ja2jRWIeSMp1fPEKYu/hjRP2HUnuaHB9U1zn38U03HW3U7mq1/5f9SreA+1N7yyM6a2sY6xYN5LzczMh9qM4qS7j8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490561; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=BPaxD+58rMoD11btABnQQHBVsrBGwaloGhguMFy2YEw=; b=ZWWnT4/+8j46NEb0ejYOC6FMPNUeTs8G7A3Ovlc++C+JuifBEB8HcO1ohC4HWgGl/78rgnwogqkt+w+i5PZub24CYN5/Is3Zml18K2ilFNtOuYsfLWuVOFnhcxyTXY1y65iBD/fOkzxJJ/p9OvqUQIVUz9t0tuAI1OBIAZyPWlU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17944905614795.9243332577718775; Thu, 12 Nov 2026 05:36:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUti-0005qd-AN; Thu, 12 Nov 2026 08:31:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtb-0005kr-JN for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:19 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUta-0001TF-3d for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:19 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-561-UYPcaQCDNESdNyl0fLVVxQ-1; Thu, 12 Nov 2026 08:31:14 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 25C511955F56; Thu, 12 Nov 2026 13:31:13 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id AEFD6195608A; Thu, 12 Nov 2026 13:31:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490277; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BPaxD+58rMoD11btABnQQHBVsrBGwaloGhguMFy2YEw=; b=e2IINH1j6KILxoToRsMful9pC+Zcprc5NRaR32onYHs5oSGUwpq6sYZakLqQfWoSWwoExV Kcrj9jxQhl0ClZm45KuBKHYGmDjjdpGM5loDYJ8TtB9WhlBhDYi6E98aUvoyYNo00dPC0y 8qz1u4XeR3AS1Jpqay1CfV+BUmn64oY= X-MC-Unique: UYPcaQCDNESdNyl0fLVVxQ-1 X-Mimecast-MFC-AGG-ID: UYPcaQCDNESdNyl0fLVVxQ_1794490273 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 08/48] system: report multiple machine aliases in help output Date: Thu, 12 Nov 2026 13:30:14 +0000 Message-ID: <20261112133054.1977618-9-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490563509158500 Update '-machine help' to report 'aliases' from the TYPE_ALIASED interface, in preference to the traditional 'alias' from the TYPE_MACHINE class. It is assumed that only one of the two fields will be set at any time give a given class. Shortly existing machines will be converted to the new approach and the old field removed. '-machine help' output will remain unchanged across this transition. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- system/vl.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/system/vl.c b/system/vl.c index e7b759d5442..8ddf306002f 100644 --- a/system/vl.c +++ b/system/vl.c @@ -1583,7 +1583,16 @@ static void machine_help_func(const QDict *qdict) machines =3D g_slist_sort_with_data(machines, machine_class_cmp, NULL); for (el =3D machines; el; el =3D el->next) { MachineClass *mc =3D el->data; - if (mc->alias) { + AliasedClass *alc =3D ALIASED_CLASS(mc); + if (alc->aliases) { + size_t i; + for (i =3D 0; alc->aliases[i] !=3D NULL; i++) { + printf("%-*.20s %s (alias of %s)\n", + (int)(strlen(alc->aliases[i]) - + strlen(TYPE_MACHINE_SUFFIX)), + alc->aliases[i], mc->desc, mc->name); + } + } else if (mc->alias) { printf("%-20s %s (alias of %s)\n", mc->alias, mc->desc, mc->na= me); } printf("%-20s %s%s%s%s\n", mc->name, mc->desc, --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490344; cv=none; d=zohomail.com; s=zohoarc; b=P9SIVFOcpkhYnpJZaeyDJ6mSaxqscJ5y3WitBHgKCZqHHXuhttYhmg4ldF/pztsrLLaIu9SSodLDHldgY00HVo5xPO4HEKEWsqR1hEm8lXaHP4gLxDJak+nl6lYWrUjOCXni3V3vwTbpaGve1QgzwzYFyNNzYWHtpK3wSMIBM4Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490344; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=WHmlrT6x2Z+e3pV4booPfzaFRLaAbFH/jbo3F2VkbBY=; b=CL4s/LoU7f9bzIMsVmKVV1qe05vUbfpq9MQ/a3gXwqfgBUiR3qG4YK8Dj2YjzW/vURDljdxkaIfpwwVWDVTq8vl1ZD27X5kky1cMbWzOzPCB+f22FLZ/ekVqt7u8WPjFYJNYgUqV6gDwD3D6vFS6OidWAQ37hwfCFnycZ+lL5CQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490344921435.3583474310286; Thu, 12 Nov 2026 05:32:24 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUtf-0005p5-FD; Thu, 12 Nov 2026 08:31:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtd-0005nM-Tp for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:22 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtc-0001d6-FD for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:21 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-599-lPIu499aM6SED3aA5D3_cg-1; Thu, 12 Nov 2026 08:31:16 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1FA2219773EB; Thu, 12 Nov 2026 13:31:15 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8F4F61956087; Thu, 12 Nov 2026 13:31:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490279; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WHmlrT6x2Z+e3pV4booPfzaFRLaAbFH/jbo3F2VkbBY=; b=Tnw5QDi/1mfPZZAbjhmTseLsMGi936FfP91BXVmx9pMaVAMF16i4JhEUq7fHYIBEKf6KSs UJb/g1kKhKbGIPCome0Vy0IOzEKhM4DtTEZTNIChWP8q5kNF3kEPR35P2oDiYUtQ2xKbQq VbuK42big3asR5A7Qui3tFlNogcxJWk= X-MC-Unique: lPIu499aM6SED3aA5D3_cg-1 X-Mimecast-MFC-AGG-ID: lPIu499aM6SED3aA5D3_cg_1794490275 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 09/48] system: increase space for machine name in '-machine help' Date: Thu, 12 Nov 2026 13:30:15 +0000 Message-ID: <20261112133054.1977618-10-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490346213158500 The 20 character space allowed for machine names is quite tight and is about to be exceeded, so bump it up to 25 characters. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- system/vl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/vl.c b/system/vl.c index 8ddf306002f..daf0637fb5e 100644 --- a/system/vl.c +++ b/system/vl.c @@ -1587,15 +1587,15 @@ static void machine_help_func(const QDict *qdict) if (alc->aliases) { size_t i; for (i =3D 0; alc->aliases[i] !=3D NULL; i++) { - printf("%-*.20s %s (alias of %s)\n", + printf("%-*.25s %s (alias of %s)\n", (int)(strlen(alc->aliases[i]) - strlen(TYPE_MACHINE_SUFFIX)), alc->aliases[i], mc->desc, mc->name); } } else if (mc->alias) { - printf("%-20s %s (alias of %s)\n", mc->alias, mc->desc, mc->na= me); + printf("%-25s %s (alias of %s)\n", mc->alias, mc->desc, mc->na= me); } - printf("%-20s %s%s%s%s\n", mc->name, mc->desc, + printf("%-25s %s%s%s%s\n", mc->name, mc->desc, mc->is_default ? " (default)" : "", mc->deprecation_reason ? " (deprecated)" : "", object_class_is_secure(OBJECT_CLASS(mc)) ? " (secure)" : ""= ); --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490308; cv=none; d=zohomail.com; s=zohoarc; b=fhIky+YXMKDRaNMPDFDBF/0iq0ijpZvyRn6m8cFy+1ND5KryXMuD9mlSfzI5S+IsAsRidW7kyYA8HPGtE9vhazLyd6vP/SjawwGspb9387d1qVczDTyej5KHNnR425mPHJUwQZKa5AecL6LaHU7RYF10ZQfOMYtHXi0EtMIi83M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490308; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=tx67dajEb5MwQkM63ainQDS0KtI3/omZOdYN0DWawIg=; b=nybhR9BgRkFL0tK3yiCoYrhx4Y0UgDxg6AjcF8tB7Qe5lqFjmo2U9vjDja43QovU0B6LtggQoEYByWPMCETfM5crbEyzRNbybpQ/0yJugh3fntDo6ktwArw5qQCYohQh08sIYM2LDOZZi0pXXI8sC3ZQcVg79eHMwQQfV/qdO/k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490308467485.01966396078933; Thu, 12 Nov 2026 05:31:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUtj-0005qu-68; Thu, 12 Nov 2026 08:31:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtg-0005pm-9N for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:24 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUte-0001ki-Pn for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:24 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-653-Iem5twsIPY2hEPfeUhc5vQ-1; Thu, 12 Nov 2026 08:31:17 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C733E195606B; Thu, 12 Nov 2026 13:31:16 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5B252195608D; Thu, 12 Nov 2026 13:31:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tx67dajEb5MwQkM63ainQDS0KtI3/omZOdYN0DWawIg=; b=dGEVXToWZs2BJVQKaHTejQePhXZa7GXUf1baFZJgBmHhOKbz//oCD9bi9fxy7N0P60REF+ mCHorydfxmC2c7SU8aNrs2uqNemNstjA4QPoTGKroN2L82Roe1dI1qEEYulFkeP4/NxZwM vBCYwH2AFwT7HlfDgtNfvWU0EpkU6ZQ= X-MC-Unique: Iem5twsIPY2hEPfeUhc5vQ-1 X-Mimecast-MFC-AGG-ID: Iem5twsIPY2hEPfeUhc5vQ_1794490276 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 10/48] system: resolve multiple aliases when creating machines Date: Thu, 12 Nov 2026 13:30:16 +0000 Message-ID: <20261112133054.1977618-11-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490309980158500 Use aliased_class_resolve() to lookup a machine class when no primary QOM type or MachineClass alias matches. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- system/vl.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/system/vl.c b/system/vl.c index daf0637fb5e..f4e17173f96 100644 --- a/system/vl.c +++ b/system/vl.c @@ -843,19 +843,22 @@ static bool usb_parse(const char *cmdline, Error **er= rp) /***********************************************************/ /* machine registration */ =20 -static MachineClass *find_machine(const char *name, GSList *machines) +static ObjectClass *find_machine(const char *name, GSList *machines, + Error **errp) { GSList *el; + g_autofree char *typename =3D NULL; =20 for (el =3D machines; el; el =3D el->next) { MachineClass *mc =3D el->data; =20 if (!strcmp(mc->name, name) || !g_strcmp0(mc->alias, name)) { - return mc; + return OBJECT_CLASS(mc); } } =20 - return NULL; + typename =3D g_strdup_printf("%s" TYPE_MACHINE_SUFFIX, name); + return aliased_class_resolve(TYPE_MACHINE, typename, errp); } =20 static MachineClass *find_default_machine(GSList *machines) @@ -1572,11 +1575,14 @@ static void machine_help_func(const QDict *qdict) =20 machines =3D object_class_get_list(TYPE_MACHINE, false); if (type) { - ObjectClass *machine_class =3D OBJECT_CLASS(find_machine(type, mac= hines)); - if (machine_class) { - type_print_class_properties(object_class_get_name(machine_clas= s)); + Error *local_err =3D NULL; + ObjectClass *machine_class =3D find_machine(type, machines, &local= _err); + if (local_err) { + error_report_err(local_err); return; } + type_print_class_properties(object_class_get_name(machine_class)); + return; } =20 printf("Supported machines are:\n"); @@ -1696,10 +1702,8 @@ static MachineClass *select_machine(QDict *qdict, Er= ror **errp) MachineClass *machine_class =3D NULL; =20 if (machine_type) { - machine_class =3D find_machine(machine_type, machines); - if (!machine_class) { - error_setg(errp, "unsupported machine type: \"%s\"", machine_t= ype); - } + machine_class =3D MACHINE_CLASS( + find_machine(machine_type, machines, errp)); qdict_del(qdict, "type"); } else { machine_class =3D find_default_machine(machines); --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490351; cv=none; d=zohomail.com; s=zohoarc; b=RN9X7itSzo+PhuMkuchGNt1fWpi0kFASwVefb4+4jLXkJD4eJIjngY2YtkflpdccEmUOz3au7MLrOIPrYY9QPqX325xIMRSXAzPOz4XIrWXHNBKKY6H9CRfXOzM/zeGzcgQ3BtpyDJknZ42WywwnEfcj+LwB8PQtswO53OzqYvM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490351; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=zDB/t69YcV9+wOnwq+uR0Sraiwdsys/oblUVgaG/je4=; b=Uo53S5oeOrHPaefu+5fapjIWqyZlDSTul/IscVCPn2y1nH1Xt+2maaKTovYddVyORK7M8dKSv77gifjTbaB0BtZNBT4Zr1hAXRMRM11p9VQ8lJrZjUODlmXsrlJKjFT7Ef4ihPsP4+iINw0LFuhkqWLNkkDsmAJc6iz+ZMkQ8/c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490351151243.57631889378013; Thu, 12 Nov 2026 05:32:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUtm-0005sk-LW; Thu, 12 Nov 2026 08:31:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUti-0005qf-9N for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:26 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtg-0001uT-P8 for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:26 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-250-cNzXGphRPLaCPf_uwXmkFg-1; Thu, 12 Nov 2026 08:31:19 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8FD7D1801F1B; Thu, 12 Nov 2026 13:31:18 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 248791956089; Thu, 12 Nov 2026 13:31:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490284; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zDB/t69YcV9+wOnwq+uR0Sraiwdsys/oblUVgaG/je4=; b=R1hdYU/XkVINmG2VgYwtRFTWKYbLzO7dXj6JRZVtclAzVEwQcuQixOpdl7Tm4oFVZ9IYTK qdhfCm14pZb7Cf3cFa8NiCm7MGzs6vKb2rxeFqgf6EBNYjzNji+9K52+JNvQ3Xc20xBmco RC5wW5qde9rTIff4vfDJLQapFTwQ6hU= X-MC-Unique: cNzXGphRPLaCPf_uwXmkFg-1 X-Mimecast-MFC-AGG-ID: cNzXGphRPLaCPf_uwXmkFg_1794490278 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 11/48] qapi: deprecate 'alias' field in MachineInfo Date: Thu, 12 Nov 2026 13:30:17 +0000 Message-ID: <20261112133054.1977618-12-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490352272158500 It is replaced by the new 'aliases' field. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- docs/about/deprecated.rst | 7 +++++++ qapi/machine.json | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 0891bbc44de..88b21a018f9 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -182,6 +182,13 @@ execution. This special treatment of ``"no"`` is depr= ecated. Use an empty string instead. In a future version, ``"no"`` will be treated as a plain file name. =20 +``alias`` field of ``MachineInfo`` (since 12.0) +''''''''''''''''''''''''''''''''''''''''''''''' + +The ``MachineInfo`` struct now has an ``aliases`` field which +can report multiple aliases per machine, thus the ``alias`` +field is now redundant. + Human Machine Protocol (HMP) commands ------------------------------------- =20 diff --git a/qapi/machine.json b/qapi/machine.json index c25a492a4e8..40fda705462 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -199,11 +199,13 @@ # Features: # # @unstable: Member @compat-props is experimental. +# @deprecated: Member @alias is replaced by @aliases. # # Since: 1.2 ## { 'struct': 'MachineInfo', - 'data': { 'name': 'str', '*alias': 'str', + 'data': { 'name': 'str', + '*alias': { 'type': 'str', 'features': ['deprecated'] }, '*aliases': ['str'], '*is-default': 'bool', 'cpu-max': 'int', 'hotpluggable-cpus': 'bool', 'numa-mem-supported': 'bool', --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490370; cv=none; d=zohomail.com; s=zohoarc; b=La+FY0d9R/9iH6I1c0JKmWgCLyw5+IaltCaT3ZO4UxU9rWJtUfZdIya/gUvRVejnAXZIawBxSREVbxxCOZk2SE0IitfOdY8Enu8U+13Z6ZOmepa0cBRMbPEBv+zRVNVcQhSpbBIX2tlccvEeheo6to4YyDaFzO5mDkXcKDI+M6M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490370; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=q3eclov/igAnmE0+S7yPMMU+UcIdDryFtvptHE205fI=; b=Z3LeFJckUhBowiueZPIyNWHNql25n+K2uGoyChU6qgXF/Gq69rR5v+BfGQnhRpv3qNYTDfQ5sCogjIE/sP/Zf3VFWajsMlBjvEi+90mSEr7xGm3Bu0XyfvzhmTwWs8zp2q7aZ3CtJixJ4xg0o5tfaesedVU9ThsDWDA3XxVPT6s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490370126704.5389244481686; Thu, 12 Nov 2026 05:32:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUtm-0005so-QP; Thu, 12 Nov 2026 08:31:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtj-0005qt-0r for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:27 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUth-0001xU-Eb for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:26 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-199-TJo3aDEZMGKgtUY9KBEPxQ-1; Thu, 12 Nov 2026 08:31:21 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 58FED1977687; Thu, 12 Nov 2026 13:31:20 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E08BD195608A; Thu, 12 Nov 2026 13:31:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490284; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=q3eclov/igAnmE0+S7yPMMU+UcIdDryFtvptHE205fI=; b=F6HZ3z1Y5CWzUGoa1nEJ+yPEkyf+fQMgZDaMekAAPX/ezpGTIkKr45TSMbIV75mgfebw8y +YvfYiw/TJCC8XH4bl+H9VfkDVCLwFiSgUwZIt3lawBSvzGAshl8aoOp6ubb5QaH9QtO4N 041NZ/AcnfVRnib/qXJttbE7sOGoWt0= X-MC-Unique: TJo3aDEZMGKgtUY9KBEPxQ-1 X-Mimecast-MFC-AGG-ID: TJo3aDEZMGKgtUY9KBEPxQ_1794490280 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 12/48] hw/arm: convert machines to use AliasedClass interface Date: Thu, 12 Nov 2026 13:30:18 +0000 Message-ID: <20261112133054.1977618-13-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490372756158501 Stop setting 'alias' in the MachineClass and instead set 'aliases' in the AliasedClass. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- hw/arm/aspeed_ast27x0_evb.c | 7 ++++++- hw/arm/virt.c | 12 +++++++++++- hw/arm/xlnx-versal-virt.c | 7 ++++++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/hw/arm/aspeed_ast27x0_evb.c b/hw/arm/aspeed_ast27x0_evb.c index 460c9ff0d2e..9f7d4395114 100644 --- a/hw/arm/aspeed_ast27x0_evb.c +++ b/hw/arm/aspeed_ast27x0_evb.c @@ -11,6 +11,7 @@ #include "hw/arm/aspeed.h" #include "hw/arm/aspeed_soc.h" #include "hw/sensor/tmp105.h" +#include "qom/object_interfaces.h" =20 /* AST2700 evb hardware value */ /* SCU HW Strap1 */ @@ -53,8 +54,12 @@ static void aspeed_machine_ast2700a2_evb_class_init(Obje= ctClass *oc, { MachineClass *mc =3D MACHINE_CLASS(oc); AspeedMachineClass *amc =3D ASPEED_MACHINE_CLASS(oc); + AliasedClass *alc =3D ALIASED_CLASS(oc); + static const char *const aliases[] =3D { + MACHINE_TYPE_NAME("ast2700-evb"), NULL, + }; =20 - mc->alias =3D "ast2700-evb"; + alc->aliases =3D aliases; mc->desc =3D "Aspeed AST2700 A2 EVB (Cortex-A35)"; amc->soc_name =3D "ast2700-a2"; amc->hw_strap1 =3D AST2700_EVB_HW_STRAP1; diff --git a/hw/arm/virt.c b/hw/arm/virt.c index e481d0e548b..60385971b6a 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -94,6 +94,7 @@ #include "hw/cxl/cxl_host.h" #include "qemu/guest-random.h" #include "hw/watchdog/sbsa_gwdt.h" +#include "qom/object_interfaces.h" =20 static GlobalProperty arm_virt_compat_defaults[] =3D { { TYPE_VIRTIO_IOMMU_PCI, "aw-bits", "48" }, @@ -139,9 +140,18 @@ static void arm_virt_compat_default_set(MachineClass *= mc) } \ type_init(MACHINE_VER_SYM(register, virt, __VA_ARGS__)); =20 +#define DEFINE_VIRT_MACHINE_ALIASES_LATEST(...) \ + AliasedClass *alc =3D ALIASED_CLASS(oc); \ + static const char *const MACHINE_VER_SYM(aliases, virt, __VA_ARGS__)[]= =3D \ + { \ + MACHINE_TYPE_NAME("virt"), \ + NULL, \ + }; \ + alc->aliases =3D MACHINE_VER_SYM(aliases, virt, __VA_ARGS__) + #define DEFINE_VIRT_MACHINE_AS_LATEST(major, minor) \ DEFINE_VIRT_MACHINE_IMPL({ \ - mc->alias =3D "virt"; \ + DEFINE_VIRT_MACHINE_ALIASES_LATEST(major, minor); \ }, major, minor) #define DEFINE_VIRT_MACHINE(major, minor) \ DEFINE_VIRT_MACHINE_IMPL({}, major, minor) diff --git a/hw/arm/xlnx-versal-virt.c b/hw/arm/xlnx-versal-virt.c index 4018f2bf7d1..309063d38d8 100644 --- a/hw/arm/xlnx-versal-virt.c +++ b/hw/arm/xlnx-versal-virt.c @@ -23,6 +23,7 @@ #include "hw/arm/boot.h" #include "qom/object.h" #include "target/arm/cpu.h" +#include "qom/object_interfaces.h" =20 #define TYPE_XLNX_VERSAL_VIRT_BASE_MACHINE \ MACHINE_TYPE_NAME("amd-versal-virt-base") @@ -368,9 +369,13 @@ static void versal_virt_machine_class_init(ObjectClass= *oc, const void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); VersalVirtClass *vvc =3D XLNX_VERSAL_VIRT_BASE_MACHINE_CLASS(oc); + AliasedClass *alc =3D ALIASED_CLASS(oc); + static const char *const aliases[] =3D { + MACHINE_TYPE_NAME("xlnx-versal-virt"), NULL, + }; =20 mc->desc =3D "AMD Versal Virtual development board"; - mc->alias =3D "xlnx-versal-virt"; + alc->aliases =3D aliases; vvc->version =3D VERSAL_VER_VERSAL; =20 versal_virt_machine_class_init_common(oc); --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490335; cv=none; d=zohomail.com; s=zohoarc; b=Nb5m6ZwKO9UEklz7xmYszmzr/uxwI5Vdg7QyTBZ3s0CYY+jF18NyAXw/Jb5hOl/ATMifl4nUjSpQHZBUXDJANtLHcD2bPTVng5bzgqZCCVHC3AGslp1bYttcFQNqJU02gBp/3PA4fAJw996ZlK2BN6CZhUOZmp/BCuXsITZuG60= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490335; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=RUzFWFtSUedVfRo+7wUDvuFIpBlo7nzvNHrYqCgurLc=; b=TqucjkvFEdTYiJa3el7Y6flqMbMEgIuTnG+6GkE5d21f3R1tJVEPWLyE5zwqPRV/F79D4NeOzhUg6vUz5SV/fXicYN28ReBANW2Viwd4WSLiQ4zCCj0AtdxgYkCzXmTaiaA+MGPwfAi3uuxLmxDpm0H0C0jvX6aCvgliQOBYYsM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490335927239.50250335345618; Thu, 12 Nov 2026 05:32:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUto-0005tk-GD; Thu, 12 Nov 2026 08:31:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtk-0005rL-At for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:28 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUti-00022x-Fn for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:27 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-274-zI_7leHIOP-7IewCYOJSow-1; Thu, 12 Nov 2026 08:31:24 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 25B4A1899FF6; Thu, 12 Nov 2026 13:31:22 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id AB2F21955DB9; Thu, 12 Nov 2026 13:31:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RUzFWFtSUedVfRo+7wUDvuFIpBlo7nzvNHrYqCgurLc=; b=YIBcdd7bt27469qSmWibHzGZ11vdmumbsT5zhrbkPHvefichwS8aTwrmgVGlav6692rkkv zjNtBqADnas4MzSW0d8Q4ItJNncQGCt74mqKNRdSXqCZFyRHf0wIXTcF5nhzpgm/b+MwT0 4DC83t+Tf64KonBkwYgyNQQnCinPbMI= X-MC-Unique: zI_7leHIOP-7IewCYOJSow-1 X-Mimecast-MFC-AGG-ID: zI_7leHIOP-7IewCYOJSow_1794490282 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 13/48] hw/avr: convert machines to use AliasedClass interface Date: Thu, 12 Nov 2026 13:30:19 +0000 Message-ID: <20261112133054.1977618-14-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490338039158500 Stop setting 'alias' in the MachineClass and instead set 'aliases' in the AliasedClass. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- hw/avr/arduino.c | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/hw/avr/arduino.c b/hw/avr/arduino.c index e166ca18e11..fbcdc32a21f 100644 --- a/hw/avr/arduino.c +++ b/hw/avr/arduino.c @@ -14,7 +14,7 @@ #include "qapi/error.h" #include "atmega.h" #include "boot.h" -#include "qom/object.h" +#include "qom/object_interfaces.h" =20 struct ArduinoMachineState { /*< private >*/ @@ -73,13 +73,18 @@ static void arduino_duemilanove_class_init(ObjectClass = *oc, const void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); ArduinoMachineClass *amc =3D ARDUINO_MACHINE_CLASS(oc); + AliasedClass *alc =3D ALIASED_CLASS(mc); + static const char *const aliases[] =3D { + MACHINE_TYPE_NAME("2009"), NULL, + }; + + alc->aliases =3D aliases; =20 /* * https://www.arduino.cc/en/Main/ArduinoBoardDuemilanove * https://www.arduino.cc/en/uploads/Main/arduino-duemilanove-schemati= c.pdf */ mc->desc =3D "Arduino Duemilanove (ATmega168)", - mc->alias =3D "2009"; amc->mcu_type =3D TYPE_ATMEGA168_MCU; amc->xtal_hz =3D 16 * 1000 * 1000; }; @@ -88,13 +93,18 @@ static void arduino_uno_class_init(ObjectClass *oc, con= st void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); ArduinoMachineClass *amc =3D ARDUINO_MACHINE_CLASS(oc); + AliasedClass *alc =3D ALIASED_CLASS(mc); + static const char *const aliases[] =3D { + MACHINE_TYPE_NAME("uno"), NULL, + }; + + alc->aliases =3D aliases; =20 /* * https://store.arduino.cc/arduino-uno-rev3 * https://www.arduino.cc/en/uploads/Main/arduino-uno-schematic.pdf */ mc->desc =3D "Arduino UNO (ATmega328P)"; - mc->alias =3D "uno"; amc->mcu_type =3D TYPE_ATMEGA328_MCU; amc->xtal_hz =3D 16 * 1000 * 1000; }; @@ -103,13 +113,18 @@ static void arduino_mega_class_init(ObjectClass *oc, = const void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); ArduinoMachineClass *amc =3D ARDUINO_MACHINE_CLASS(oc); + AliasedClass *alc =3D ALIASED_CLASS(mc); + static const char *const aliases[] =3D { + MACHINE_TYPE_NAME("mega"), NULL, + }; + + alc->aliases =3D aliases; =20 /* * https://www.arduino.cc/en/Main/ArduinoBoardMega * https://www.arduino.cc/en/uploads/Main/arduino-mega2560-schematic.p= df */ mc->desc =3D "Arduino Mega (ATmega1280)"; - mc->alias =3D "mega"; amc->mcu_type =3D TYPE_ATMEGA1280_MCU; amc->xtal_hz =3D 16 * 1000 * 1000; }; @@ -118,13 +133,18 @@ static void arduino_mega2560_class_init(ObjectClass *= oc, const void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); ArduinoMachineClass *amc =3D ARDUINO_MACHINE_CLASS(oc); + AliasedClass *alc =3D ALIASED_CLASS(mc); + static const char *const aliases[] =3D { + MACHINE_TYPE_NAME("mega2560"), NULL, + }; + + alc->aliases =3D aliases; =20 /* * https://store.arduino.cc/arduino-mega-2560-rev3 * https://www.arduino.cc/en/uploads/Main/arduino-mega2560_R3-sch.pdf */ mc->desc =3D "Arduino Mega 2560 (ATmega2560)"; - mc->alias =3D "mega2560"; amc->mcu_type =3D TYPE_ATMEGA2560_MCU; amc->xtal_hz =3D 16 * 1000 * 1000; /* CSTCE16M0V53-R0 */ }; --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490354; cv=none; d=zohomail.com; s=zohoarc; b=oGyt6ipjNUGaHICh/T4L7CoNxkbYBPfD0dDPFUEj4VaOPO4j3tKcMjF9qn9tEnuGgVOYPnEia5u+NxBjRZoqqS60HZESA0DfGNAbLLnKfFuZZYlOUmhXZgDroYV1GwPu0vwWy5jBtvmDFz7b+1H33RQkoTWsZCfBEiHudyxS3zE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490354; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=2mD7HEUdihQNVf6P9p46SI4wSm6+WgjyaOYOewM+v5Q=; b=kmB9nHXKJLwPiial9geAiZW71s6XbAEDr5NjvBCQaMSTyfnOJEatw6LsIzNoDAXI/PVvJ01Spq0rwAn/+CP4EBQN9135FSSKOJkRsWQOAHXqvMnJ2ZDDworfIKWK7Fn3wAPBbBO7nZfw9c2San7iEOZKN63qiOPLDucnZKRodHc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490354640272.9726358388988; Thu, 12 Nov 2026 05:32:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUtt-0005uX-PH; Thu, 12 Nov 2026 08:31:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtp-0005u7-Kq for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:33 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtm-0002Ir-8J for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:33 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-394-8HxXDR4wON23hrZqWqtkJQ-1; Thu, 12 Nov 2026 08:31:25 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E3E8918867A3; Thu, 12 Nov 2026 13:31:23 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7658A1956087; Thu, 12 Nov 2026 13:31:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490289; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2mD7HEUdihQNVf6P9p46SI4wSm6+WgjyaOYOewM+v5Q=; b=axhgbEMrPeFYgnFfs6D8f3C+06ScoUoLo6HV/r0nS9tMmz56BtDey1yNzeTE57qXSZcmlI lvt9F9wYSThTViN5BG731ZnOxmOqsJOAIEF00jIS2ypRpcIeFr3tBCfyQKqDSNpTslYI1u 9qcU+X3nYIic/H8h3f5AckvpuliamTI= X-MC-Unique: 8HxXDR4wON23hrZqWqtkJQ-1 X-Mimecast-MFC-AGG-ID: 8HxXDR4wON23hrZqWqtkJQ_1794490284 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 14/48] hw/hexagon: convert machines to use AliasedClass interface Date: Thu, 12 Nov 2026 13:30:20 +0000 Message-ID: <20261112133054.1977618-15-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490356302158501 Stop setting 'alias' in the MachineClass and instead set 'aliases' in the AliasedClass. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- hw/hexagon/hexagon_dsp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/hexagon/hexagon_dsp.c b/hw/hexagon/hexagon_dsp.c index eddf69545ee..584b943cebf 100644 --- a/hw/hexagon/hexagon_dsp.c +++ b/hw/hexagon/hexagon_dsp.c @@ -38,6 +38,7 @@ #include "machine_cfg_v81qa_1.h.inc" #include "machine_cfg_v85na_1.h.inc" #include "machine_cfg_v85qa_1.h.inc" +#include "qom/object_interfaces.h" =20 #define TYPE_HEXAGON_DSP_MACHINE "hexagon-dsp-machine" #define HEXAGON_DSP_SUBSYSTEM_BASE 0xfc900000 @@ -365,9 +366,13 @@ static void v85na_1_config_init(MachineState *machine) static void v85na_1_init(ObjectClass *oc, const void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); + AliasedClass *alc =3D ALIASED_CLASS(oc); + static const char *const aliases[] =3D { + MACHINE_TYPE_NAME("sim"), NULL, + }; =20 mc->desc =3D "Hexagon V85NA_1"; - mc->alias =3D "sim"; + alc->aliases =3D aliases; mc->init =3D v85na_1_config_init; init_mc(mc); mc->default_cpu_type =3D TYPE_HEXAGON_CPU_V85; --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490765; cv=none; d=zohomail.com; s=zohoarc; b=dcKpizEEDfJF+UVEEg8vAGIjSoZsyjI+PGyeQMKLCBl05Gq6ZpXJATC8ZG2aO4YydV9Em3Jbhqz2YIBjJ44DXqX29NlAECDb6cYSH/zME2+8CvKSaUNiAOB/qBlWi82tu77ZqfvFyanzxkeXUDeCvxZbsXPnFJEVqQoUauL9Brw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490765; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=TgY5UT+Fe0KtLMph0z3ZhpKDf9pJ89rY4qFKKMqe/AA=; b=ZQnomxh84VRs7aWxXNMGvGUM0N/JBa3zPQh8bxPQy+Ejv0dmiD/nXzCKjqHmsdlSkJO39Fr5recwVJsQhzmkNiciPVVfxgR4GSFALJCkg+8LDmPFr76j+UixQKUEKGzdtnV+7Wsw0HpC5xrjEg4GqRGK++j/u+LaWkK1r25H4dk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490765275888.9341947966622; Thu, 12 Nov 2026 05:39:25 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUtv-0005vd-8a; Thu, 12 Nov 2026 08:31:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtp-0005uA-PV for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:33 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtn-0002Lq-2S for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:33 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-299-itS2SE_UMoODZBjxj_rlUA-1; Thu, 12 Nov 2026 08:31:26 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id ACE2B1955F25; Thu, 12 Nov 2026 13:31:25 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3F1DB1955DB9; Thu, 12 Nov 2026 13:31:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TgY5UT+Fe0KtLMph0z3ZhpKDf9pJ89rY4qFKKMqe/AA=; b=YGkP4zWWQhKBF2rMFAVQa4H9KiSUJI5QvrOSjKb1e9UVTOdghog6QRsItBxjr4LXENy1qs QAjGsmkitcqbV7zTMjsBZ4MwGFOkbOFn+aghiCFFwlsIMyKk2gYH84SIqcKW2/+pmstz9C jFQlHPhaKi7FogtnRURstaP/L4MEbhk= X-MC-Unique: itS2SE_UMoODZBjxj_rlUA-1 X-Mimecast-MFC-AGG-ID: itS2SE_UMoODZBjxj_rlUA_1794490285 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 15/48] hw/i386: convert machines to use AliasedClass interface Date: Thu, 12 Nov 2026 13:30:21 +0000 Message-ID: <20261112133054.1977618-16-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490766663158500 Stop setting 'alias' in the MachineClass and instead set 'aliases' in the AliasedClass. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- hw/i386/pc_piix.c | 20 ++++++++++++++++++-- hw/i386/pc_q35.c | 12 +++++++++++- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 88356bf0d77..8498dbeda81 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -66,6 +66,7 @@ #include "hw/uefi/var-service-api.h" #include "hw/i386/acpi-build.h" #include "target/i386/cpu.h" +#include "qom/object_interfaces.h" =20 #define XEN_IOAPIC_NUM_PIRQS 128ULL =20 @@ -362,13 +363,23 @@ static void pc_i440fx_init(MachineState *machine) pc_init1(machine, TYPE_I440FX_PCI_DEVICE); } =20 +#define DEFINE_I440FX_MACHINE_ALIASES_LATEST(...) \ + AliasedClass *alc =3D ALIASED_CLASS(oc); \ + static const char *const MACHINE_VER_SYM(aliases, virt, __VA_ARGS__)[]= =3D \ + { \ + MACHINE_TYPE_NAME("pc"), \ + NULL, \ + }; \ + alc->aliases =3D MACHINE_VER_SYM(aliases, virt, __VA_ARGS__) + #define DEFINE_I440FX_MACHINE(major, minor) \ DEFINE_PC_VER_MACHINE(pc_i440fx, "pc-i440fx", pc_i440fx_init, \ {}, major, minor); =20 #define DEFINE_I440FX_MACHINE_AS_LATEST(major, minor) \ DEFINE_PC_VER_MACHINE(pc_i440fx, "pc-i440fx", pc_i440fx_init, { \ - mc->is_default =3D true; mc->alias =3D "pc"; \ + DEFINE_I440FX_MACHINE_ALIASES_LATEST(major, minor); \ + mc->is_default =3D true; \ }, major, minor); =20 static void pc_i440fx_machine_options(MachineClass *m) @@ -637,9 +648,14 @@ DEFINE_I440FX_MACHINE(4, 1); #ifdef CONFIG_XEN static void xenfv_machine_4_2_options(MachineClass *m) { + AliasedClass *alc =3D ALIASED_CLASS(m); + static const char *const aliases[] =3D { + MACHINE_TYPE_NAME("xenfv"), NULL, + }; + pc_i440fx_machine_4_2_options(m); m->desc =3D "Xen Fully-virtualized PC"; - m->alias =3D "xenfv"; + alc->aliases =3D aliases; m->max_cpus =3D HVM_MAX_VCPUS; m->default_machine_opts =3D "accel=3Dxen,suppress-vmdesc=3Don"; } diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 9c6459b934d..37fbb58ef39 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -63,6 +63,7 @@ #include "hw/uefi/var-service-api.h" #include "hw/i386/acpi-build.h" #include "target/i386/cpu.h" +#include "qom/object_interfaces.h" =20 /* ICH9 AHCI has 6 ports */ #define MAX_SATA_PORTS 6 @@ -338,13 +339,22 @@ static void pc_q35_machine_set_wdat(Object *o, bool v= alue, Error **errp) pcms->wdat_enabled =3D value; } =20 +#define DEFINE_Q35_MACHINE_ALIASES_LATEST(...) \ + AliasedClass *alc =3D ALIASED_CLASS(oc); \ + static const char *const MACHINE_VER_SYM(aliases, virt, __VA_ARGS__)[]= =3D \ + { \ + MACHINE_TYPE_NAME("q35"), \ + NULL, \ + }; \ + alc->aliases =3D MACHINE_VER_SYM(aliases, virt, __VA_ARGS__) + #define DEFINE_Q35_MACHINE(major, minor) \ DEFINE_PC_VER_MACHINE(pc_q35, "pc-q35", pc_q35_init, {}, \ major, minor); =20 #define DEFINE_Q35_MACHINE_AS_LATEST(major, minor) \ DEFINE_PC_VER_MACHINE(pc_q35, "pc-q35", pc_q35_init, { \ - mc->alias =3D "q35"; \ + DEFINE_Q35_MACHINE_ALIASES_LATEST(major, minor); \ }, major, minor); =20 #define DEFINE_Q35_MACHINE_BUGFIX(major, minor, micro) \ --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490769; cv=none; d=zohomail.com; s=zohoarc; b=bnCZDQaxjoTUptQUN+3cn2vrTNkLCHXETo4JeogiV75ZusazRGYaJ1E3K/C2gEHif6cpyoUuWZUt7BTn/DgzjQg1SA0yx5byc70hRErUZ+VBUcSSDpIQxKAfWGtvjShncvIfBFvfXXasg/aM936GZojJTS+ko6XVE4UGVaOuD0Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490769; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8Lh3/yLudYxeIVohtUrC7Zwb780n48E1Zl0RJReWLQU=; b=Yue4zR3wpeAeMmCnQUdWE2h6oZO4RvWb9A6d04TDzpnneb0MFhZMLHdxQ+B4MN6SodPDfJHL5etUdjr7GAo/Lj81SYNdaAsS6eYd8VPBuDdPSRQPvdhRHY/qxrh95OkJanx765/X0a/nkkacEfo47bJA5FDqCpdeXpk1Iwh81Ls= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490769447348.2661811303683; Thu, 12 Nov 2026 05:39:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUtv-0005wB-UL; Thu, 12 Nov 2026 08:31:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtq-0005uZ-MR for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:37 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtn-0002OW-J1 for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:34 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-433-4FYKVWMbOvGS3wyCJPAsEA-1; Thu, 12 Nov 2026 08:31:29 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 71B931801318; Thu, 12 Nov 2026 13:31:27 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 07E741955DB9; Thu, 12 Nov 2026 13:31:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8Lh3/yLudYxeIVohtUrC7Zwb780n48E1Zl0RJReWLQU=; b=auJfmgOwZ2uZRlAaKuJp8GjXgp2e5SvutQuBdoT9hUwbfHGDJ8m4uPy9sRfY4CaR+KdXuL nsi7o7VrwDJzeHH9MIY5IZEjtqrZYAnE7coKEWPDt9qavk8oYKsKoTQhUpz9ux2gpsi9+s vgU720YwHG4NSGFc1I5BSt/kaCMU+XI= X-MC-Unique: 4FYKVWMbOvGS3wyCJPAsEA-1 X-Mimecast-MFC-AGG-ID: 4FYKVWMbOvGS3wyCJPAsEA_1794490287 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 16/48] hw/loongarch: convert machines to use AliasedClass interface Date: Thu, 12 Nov 2026 13:30:22 +0000 Message-ID: <20261112133054.1977618-17-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490770678158500 Stop setting 'alias' in the MachineClass and instead set 'aliases' in the AliasedClass. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- hw/loongarch/virt.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 30a2ab6be9d..52b40883f4e 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -51,6 +51,7 @@ #include "qemu/error-report.h" #include "qemu/log.h" #include "kvm/kvm_loongarch.h" +#include "qom/object_interfaces.h" =20 static int virt_get_dmsi(Object *obj, Error **errp) { @@ -1546,9 +1547,18 @@ static void virt_class_init(ObjectClass *oc, const v= oid *data) } \ type_init(MACHINE_VER_SYM(register, virt, __VA_ARGS__)); =20 +#define DEFINE_VIRT_MACHINE_ALIASES_LATEST(...) \ + AliasedClass *alc =3D ALIASED_CLASS(oc); \ + static const char *const MACHINE_VER_SYM(aliases, virt, __VA_ARGS__)[]= =3D \ + { \ + MACHINE_TYPE_NAME("virt"), \ + NULL, \ + }; \ + alc->aliases =3D MACHINE_VER_SYM(aliases, virt, __VA_ARGS__) + #define DEFINE_VIRT_MACHINE_AS_LATEST(major, minor) \ DEFINE_VIRT_MACHINE_VERSION({ \ - mc->alias =3D "virt"; \ + DEFINE_VIRT_MACHINE_ALIASES_LATEST(major, minor); \ mc->is_default =3D true; \ }, major, minor) #define DEFINE_VIRT_MACHINE(major, minor) \ --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490539; cv=none; d=zohomail.com; s=zohoarc; b=JPRiWptONAK3JvJRSuYGo5rJXu3PU/vkpiWcFH/9e/CCFUGRN4JjeXWutkntp59cQo/hISDvk1Sqk336I19f4tetyGAraUwEjs9dG4R/2Ahjn3wKmeI4fFpIXENUqbc3uxpF3ik+9vpHe6QPh7NSfpvLJhbKcdm9qm2QFyd5qx8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490539; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UNNq8oixdBHXOAhHUjtXqdWFxGzS3Ad+oPsMBMZL+EA=; b=LzcWPVZtkLJEtxin7MVxyp1iwepXT7W2mI5glOuya9k3krICo4f5K1eWixxwicliR/gaLD2Nv57oZ3osSu6iwiAg1oMPoK6tZnr4X4PvbvFXUwf6PImffI8cmuKTVXJ5nfBLoWq8+cznES2kJ6bSZE3MXCUIzXRoKyavwQYeacE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 179449053936750.04216649302214; Thu, 12 Nov 2026 05:35:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUtx-0005wN-9c; Thu, 12 Nov 2026 08:31:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtt-0005ut-9C for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:37 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtr-0002go-Mm for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:37 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-616-9Y0tR6d8Puu9MjmE7V2aCA-1; Thu, 12 Nov 2026 08:31:30 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 42D3918301B7; Thu, 12 Nov 2026 13:31:29 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C20651956089; Thu, 12 Nov 2026 13:31:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UNNq8oixdBHXOAhHUjtXqdWFxGzS3Ad+oPsMBMZL+EA=; b=Za2mghXzwRk8AkdS6fgLQBVi15ZgFbHxOtX/3ZLNRxe2i0B+HR8B7bb6f7jTqCGXCc5J7D +Am18ZUwfw2Nn36644PROppDXbMQqbZTo5c3ymcpIjQU9cHDov9sy13maE/TFKx642GI7D zns0Tbxsu0zLtj8ThByba8WoRv1q3j4= X-MC-Unique: 9Y0tR6d8Puu9MjmE7V2aCA-1 X-Mimecast-MFC-AGG-ID: 9Y0tR6d8Puu9MjmE7V2aCA_1794490289 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 17/48] hw/m68k: convert machines to use AliasedClass interface Date: Thu, 12 Nov 2026 13:30:23 +0000 Message-ID: <20261112133054.1977618-18-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490541136158500 Stop setting 'alias' in the MachineClass and instead set 'aliases' in the AliasedClass. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- hw/m68k/virt.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/hw/m68k/virt.c b/hw/m68k/virt.c index 2418bd3d503..487d9bcc8d0 100644 --- a/hw/m68k/virt.c +++ b/hw/m68k/virt.c @@ -36,6 +36,7 @@ #include "hw/intc/goldfish_pic.h" #include "hw/virtio/virtio-mmio.h" #include "hw/virtio/virtio-blk.h" +#include "qom/object_interfaces.h" =20 /* * 6 goldfish-pic for CPU IRQ #1 to IRQ #6 @@ -362,10 +363,19 @@ type_init(virt_machine_register_types) } \ type_init(MACHINE_VER_SYM(register, virt, __VA_ARGS__)); =20 +#define DEFINE_VIRT_MACHINE_ALIASES_LATEST(...) \ + AliasedClass *alc =3D ALIASED_CLASS(oc); \ + static const char *const MACHINE_VER_SYM(aliases, virt, __VA_ARGS__)[]= =3D \ + { \ + MACHINE_TYPE_NAME("virt"), \ + NULL, \ + }; \ + alc->aliases =3D MACHINE_VER_SYM(aliases, virt, __VA_ARGS__) + #define DEFINE_VIRT_MACHINE_AS_LATEST(major, minor) \ DEFINE_VIRT_MACHINE_IMPL({ \ - mc->alias =3D "virt"; \ - }, major, minor) + DEFINE_VIRT_MACHINE_ALIASES_LATEST(major, minor); \ + }, major, minor) #define DEFINE_VIRT_MACHINE(major, minor) \ DEFINE_VIRT_MACHINE_IMPL({}, major, minor) =20 --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490553; cv=none; d=zohomail.com; s=zohoarc; b=XDmTLKkpfywMrJ5W8tID5M4n9SyCb/KAJpT9tLYf/1+4GDnRmwwOn2sULD3w72hHo6ctH5NkFJTvvW5KNzgOXbWg70dyonMVoR9uxXTbUE98t9o9PO6loLLc8DKZb3bxJ42qukiZTHQk+CI7gWHjR72A017qZpD+nYUaCz6j5jE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490553; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=pskDY9UXLntxsMXAn7nnyy6LvDGLXm2iPTQ888sClKk=; b=KQ8VwSvN1dmyNYlUmOMzfi9GjVKeRRVhSuLvH0NEltLPMvWAD0/55C+1Fzgd9vIffJZEu3sRrmw0rJudjsB9FpC12d57CITy2UhjvpJFnMC+EdQY8W7JD2Yh/q1NUlXDd+1U/nDuMFrWh/SKdK6oZ0Mde0WYUnFYyCY+Zq4lwLQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490553678909.4517911512977; Thu, 12 Nov 2026 05:35:53 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUtw-0005wH-AS; Thu, 12 Nov 2026 08:31:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtv-0005vZ-3N for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUts-0002kq-To for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:38 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-125-MULHDot7OhmvUqF5pf2B_A-1; Thu, 12 Nov 2026 08:31:32 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 200C01801316; Thu, 12 Nov 2026 13:31:31 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8FF21195608A; Thu, 12 Nov 2026 13:31:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pskDY9UXLntxsMXAn7nnyy6LvDGLXm2iPTQ888sClKk=; b=MxZejT2eBKl3m2XPA5jA9TISy4w/h3+xDQcnaqMQ0R/8N3KH3hjPN3qt4wvO1bB2b8vHjP 7eYFW+5XafbWSvoKl85vTHxQEh8vbjTCjCy52NWq7B5gso/BAo7R8kgfZv4C2RBfgUk5xN uZRPgmic752HflP9rNPERl+RcPtS8SI= X-MC-Unique: MULHDot7OhmvUqF5pf2B_A-1 X-Mimecast-MFC-AGG-ID: MULHDot7OhmvUqF5pf2B_A_1794490291 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 18/48] hw/ppc: convert machines to use AliasedClass interface Date: Thu, 12 Nov 2026 13:30:24 +0000 Message-ID: <20261112133054.1977618-19-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490555358158500 Stop setting 'alias' in the MachineClass and instead set 'aliases' in the AliasedClass. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- hw/ppc/pnv.c | 7 ++++++- hw/ppc/spapr.c | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index f9478545ff9..a93d2953604 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -62,6 +62,7 @@ #include "hw/char/serial-isa.h" #include "hw/rtc/mc146818rtc.h" #include "exec/cpu-common.h" +#include "qom/object_interfaces.h" =20 #include =20 @@ -3472,6 +3473,10 @@ static void pnv_machine_power11_class_init(ObjectCla= ss *oc, const void *data) PnvMachineClass *pmc =3D PNV_MACHINE_CLASS(oc); XiveFabricClass *xfc =3D XIVE_FABRIC_CLASS(oc); static const char compat[] =3D "qemu,powernv11\0ibm,powernv"; + AliasedClass *alc =3D ALIASED_CLASS(oc); + static const char *const aliases[] =3D { + MACHINE_TYPE_NAME("powernv"), NULL + }; =20 static GlobalProperty phb_compat[] =3D { { TYPE_PNV_PHB, "version", "5" }, @@ -3493,7 +3498,7 @@ static void pnv_machine_power11_class_init(ObjectClas= s *oc, const void *data) mc->desc =3D "IBM PowerNV (Non-Virtualized) Power11"; mc->default_cpu_type =3D POWERPC_CPU_TYPE_NAME("power11_v2.0"); =20 - mc->alias =3D "powernv"; + alc->aliases =3D aliases; =20 object_class_property_add_bool(oc, "big-core", pnv_machine_get_big_core, diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 8816f607a8f..aa14322222c 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -92,6 +92,7 @@ #include "hw/ppc/spapr_tpm_proxy.h" #include "hw/ppc/spapr_nvdimm.h" #include "hw/ppc/spapr_numa.h" +#include "qom/object_interfaces.h" =20 #include =20 @@ -4752,9 +4753,18 @@ static const TypeInfo spapr_machine_info =3D { } \ type_init(MACHINE_VER_SYM(register, spapr, __VA_ARGS__)) =20 -#define DEFINE_SPAPR_MACHINE_AS_LATEST(major, minor) \ +#define DEFINE_SPAPR_MACHINE_ALIASES_LATEST(...) \ + AliasedClass *alc =3D ALIASED_CLASS(oc); \ + static const char *const MACHINE_VER_SYM(aliases, virt, __VA_ARGS__)[]= =3D \ + { \ + MACHINE_TYPE_NAME("pseries"), \ + NULL, \ + }; \ + alc->aliases =3D MACHINE_VER_SYM(aliases, virt, __VA_ARGS__) + +#define DEFINE_SPAPR_MACHINE_AS_LATEST(major, minor) \ DEFINE_SPAPR_MACHINE_IMPL({ \ - mc->alias =3D "pseries"; \ + DEFINE_SPAPR_MACHINE_ALIASES_LATEST(major, minor); \ mc->is_default =3D true; \ }, major, minor) #define DEFINE_SPAPR_MACHINE(major, minor) \ --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490588; cv=none; d=zohomail.com; s=zohoarc; b=Ilut0zjSTm3JiFYbr63S0BRBbwNTk4ba9gshiaueQ8xjbqtzPtzN9J0omMlqW/94eW1o0rrqGlMOhVNwh6rDtiCWXRa70KUQUq7pvszU9L1RouV5GV9ahNDsP8peSiwNcF2T8t7QCGq/ZKHELYtJGorcTV7n+Ip1jYEUZtPnBDU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490588; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+ewU8bBTYU6KDAdI+hwDBjKzRtYtYrBKkami7/5wJyM=; b=GV/BhrjlQvdQan2yYwFjiBiDHIyN7UCkQDyZiOixXNzMHnwWdNWb4BVjtKXnRTX2S53kp83VOlfaAONuxm10UKUCOAwZR71PqNKiFEWtfhlyvIqSbHgopm/LL99jethoVEhFuG7DWdHwJk/OTT4pRyEytRVRLtqlI2mgtoLlXrc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490588540837.2492684838035; Thu, 12 Nov 2026 05:36:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUtw-0005wI-G5; Thu, 12 Nov 2026 08:31:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtv-0005vp-Dn for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtu-0002rF-0D for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:39 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-536-jI-25Wh6PxaKxZamk-z66g-1; Thu, 12 Nov 2026 08:31:33 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C5A911800848; Thu, 12 Nov 2026 13:31:32 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5A6A91956087; Thu, 12 Nov 2026 13:31:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490297; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+ewU8bBTYU6KDAdI+hwDBjKzRtYtYrBKkami7/5wJyM=; b=f7fhXKDfVJOrNy6nrT4EHKh+dlLzOITqBrpHIeXvvvuvdOSCU6JXZpGE1NDe8s5vC/49p0 TVOUDy2ncNUfSfzVLGi0gsKXtqwjMvTLHhDyupC6gDIEK8nQOQAx6UkiqGXubVptkyfdPI pt55yyjkvpdsukELUkeP1LTvjXH/ccE= X-MC-Unique: jI-25Wh6PxaKxZamk-z66g-1 X-Mimecast-MFC-AGG-ID: jI-25Wh6PxaKxZamk-z66g_1794490292 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 19/48] hw/s390x: convert machines to use AliasedClass interface Date: Thu, 12 Nov 2026 13:30:25 +0000 Message-ID: <20261112133054.1977618-20-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490589824158500 Stop setting 'alias' in the MachineClass and instead set 'aliases' in the AliasedClass. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- hw/s390x/s390-virtio-ccw.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index eafb603f3e0..3e14df4800f 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -52,6 +52,7 @@ #include "hw/virtio/virtio-md-pci.h" #include "hw/s390x/virtio-ccw-md.h" #include "system/replay.h" +#include "qom/object_interfaces.h" #include CONFIG_DEVICES =20 static Error *pv_mig_blocker; @@ -995,9 +996,18 @@ static const TypeInfo ccw_machine_info =3D { } = \ type_init(MACHINE_VER_SYM(register, ccw, __VA_ARGS__)) =20 +#define DEFINE_CCW_MACHINE_ALIASES_LATEST(...) \ + AliasedClass *alc =3D ALIASED_CLASS(oc); \ + static const char *const MACHINE_VER_SYM(aliases, virt, __VA_ARGS__)[]= =3D \ + { \ + MACHINE_TYPE_NAME("s390-ccw-virtio"), \ + NULL, \ + }; \ + alc->aliases =3D MACHINE_VER_SYM(aliases, virt, __VA_ARGS__) + #define DEFINE_CCW_MACHINE_AS_LATEST(major, minor) \ DEFINE_CCW_MACHINE_IMPL({ \ - mc->alias =3D "s390-ccw-virtio"; \ + DEFINE_CCW_MACHINE_ALIASES_LATEST(major, minor); \ mc->is_default =3D true; \ }, major, minor) =20 --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490590; cv=none; d=zohomail.com; s=zohoarc; b=lp+zFLKTtIydHQAFjFEh1rcuouemrp+maqjYT66YRVtE03gBZH9/DyyOqXjL/J6UpsIBib59FZrwl2dUOJxA3p+6du1U2zmDOHXnP1ywZkXCf+i5v8HESjgZ+OjI7jARDOjGndilaNeGHchTXeOjmkbM9VNn1gxm/SxZuE2Qz4I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490590; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=dv8FTxzLWTP1fqVyFjemHm7VHEaaxHiMog4k5XQJmeA=; b=kKrLA+4NT33qNk+D8uP6NzL1QDUmhwmLyb0jr4bO3roqWvc/hkts/QM/aKJ1pyMMWP/Otc5Lt66BuUobGp57easDE1NyiiP0NWTRz9Z91w/E8ZGmOvhDBKXy7ZgQwcXg+AhDBT80RB7tog8MpGxmrbUoAZt10sY8LGtJCHLdVT4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17944905900522.482377788085387; Thu, 12 Nov 2026 05:36:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUu0-0005xt-0H; Thu, 12 Nov 2026 08:31:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtx-0005wQ-FT for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:41 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtv-0002yo-Tx for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:41 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-395-n6ZvyNtAN6ees4HiVYk4ZA-1; Thu, 12 Nov 2026 08:31:35 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8D8111800A36; Thu, 12 Nov 2026 13:31:34 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 215AA1956087; Thu, 12 Nov 2026 13:31:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dv8FTxzLWTP1fqVyFjemHm7VHEaaxHiMog4k5XQJmeA=; b=H8aeOGdHZmkP2qnXYlq75aVfNt/+nwnpCFCtjYfibYvTT4CZHPKAZAN+m/ta3M5Lvn+01m pn/eiaKBYnsTNSa/0wF/SAtHatGNwJLCPDdoePVcJU1q4Jb4opDXeRJl5r1mmgkNzFwt5v KR4fiVg6l//cDEkTsCn1H9z2730jCIc= X-MC-Unique: n6ZvyNtAN6ees4HiVYk4ZA-1 X-Mimecast-MFC-AGG-ID: n6ZvyNtAN6ees4HiVYk4ZA_1794490294 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 20/48] include/hw: convert machine docs to use AliasedClass interface Date: Thu, 12 Nov 2026 13:30:26 +0000 Message-ID: <20261112133054.1977618-21-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490592016158500 Stop illustrating setting 'alias' in the MachineClass and instead show setting 'aliases' in the AliasedClass. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- include/hw/core/boards.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/include/hw/core/boards.h b/include/hw/core/boards.h index a25c627c0c8..ea1e26a8c52 100644 --- a/include/hw/core/boards.h +++ b/include/hw/core/boards.h @@ -490,10 +490,20 @@ struct MachineState { * Following this, one (or more) helpers can be added for * whichever scenarios need to be catered for with a machine: * + * + * #define DEFINE_VIRT_MACHINE_ALIASES_LATEST(...) \ + * AliasedClass *alc =3D ALIASED_CLASS(oc); \ + * static const char *const MACHINE_VER_SYM(aliases, virt, __VA_ARGS_= _)[] =3D \ + * { \ + * MACHINE_TYPE_NAME("virt"), \ + * NULL, \ + * }; \ + * alc->aliases =3D MACHINE_VER_SYM(aliases, virt, __VA_ARGS__) + * * // Normal 2 digit, marked as latest e.g. 'virt-9.0' * #define DEFINE_VIRT_MACHINE_LATEST(major, minor) \ * DEFINE_VIRT_MACHINE_IMPL({ \ - * mc->alias =3D "virt"; \ + * DEFINE_VIRT_MACHINE_ALIASES_LATEST(major, minor); \ * }, major, minor) * * // Normal 2 digit e.g. 'virt-9.0' --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490401; cv=none; d=zohomail.com; s=zohoarc; b=GeXmJTbnD090rPpzlTA8QyHwhyUJCkup7CgRU/UAbTpsYvYUYvGl1UMSwjSlHO1yjO1KIMGGMD/WJKH2dp37MIXyMVeGYw3lA7xyNIhCMMTbbrSQ35ZotTBZgwJo5TB1p/2ITznVvkjfiUdXYKY+6BEiL6++/WiRY4TbO1wLCL4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490401; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8Ugvuoln11bq7jPfoM7ohSVFem72ITV9HCZSrAhhzFg=; b=lDv/BAV+Vc75CGParsh65pDWuXNvTU0ih6ZOdLoV+pGz5VdqnQEOEWo0r89sCx4oehi+PCbF5ihBKazetNA2YKIIFGxTkAAMleOcf5zxyDQavGuktjeEMO8D3o0mSndFp6yLZA90xlYW4OTR7sW8cFivmMW9VqyWQNYvq/CRCtg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490401073477.2516542974728; Thu, 12 Nov 2026 05:33:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUtz-0005xs-SS; Thu, 12 Nov 2026 08:31:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtx-0005wP-FA for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:41 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtv-0002yh-Sp for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:41 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-257-upCHXbiBO3G4Iv3Hv2AEaQ-1; Thu, 12 Nov 2026 08:31:37 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6EF501899FC9; Thu, 12 Nov 2026 13:31:36 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DDC7F1956087; Thu, 12 Nov 2026 13:31:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8Ugvuoln11bq7jPfoM7ohSVFem72ITV9HCZSrAhhzFg=; b=FbMHM33bjKvXSvQKKPksKMXuEAfa7jO0KySAf59lxjjXlNf6rANTBr4vAjCMSu1ujs6uMK hng/WbUjibhRiZAVhH5b0iwpj2IdsTNvjQm3ttl6NhgOXWEkQj1FCIhHoy4heJps0b+Fs3 MRhUwFBeYkn0gGjqzAWTa+6XtjCOf7A= X-MC-Unique: upCHXbiBO3G4Iv3Hv2AEaQ-1 X-Mimecast-MFC-AGG-ID: upCHXbiBO3G4Iv3Hv2AEaQ_1794490296 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 21/48] hw: drop 'alias' field from MachineClass Date: Thu, 12 Nov 2026 13:30:27 +0000 Message-ID: <20261112133054.1977618-22-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490402956158500 Everything is converted to use the AliasedClass 'aliases' field now. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- hw/core/machine-qmp-cmds.c | 16 ++++------------ include/hw/core/boards.h | 1 - system/vl.c | 4 +--- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index 787c69e176f..ade5a31c239 100644 --- a/hw/core/machine-qmp-cmds.c +++ b/hw/core/machine-qmp-cmds.c @@ -175,6 +175,7 @@ MachineInfoList *qmp_query_machines(bool has_compat_pro= ps, bool compat_props, if (alc->aliases) { strList **aliases =3D &info->aliases; size_t i; + int len; info->has_aliases =3D true; for (i =3D 0; alc->aliases[i] !=3D NULL; i++) { /* @@ -182,21 +183,12 @@ MachineInfoList *qmp_query_machines(bool has_compat_p= rops, bool compat_props, * we report machine types to the user, hence must * strip the typename suffix */ - int len =3D strlen(alc->aliases[i]) - strlen(TYPE_MACHINE_= SUFFIX); + len =3D strlen(alc->aliases[i]) - strlen(TYPE_MACHINE_SUFF= IX); QAPI_LIST_APPEND(aliases, g_strndup(alc->aliases[i], len)); } - if (!mc->alias) { - int len =3D strlen(alc->aliases[0]) - strlen(TYPE_MACHINE_= SUFFIX); - info->alias =3D g_strndup(alc->aliases[0], len); - } - } - if (mc->alias) { - info->alias =3D g_strdup(mc->alias); - if (!info->aliases) { - strList **aliases =3D &info->aliases; - QAPI_LIST_APPEND(aliases, g_strdup(mc->alias)); - } + len =3D strlen(alc->aliases[0]) - strlen(TYPE_MACHINE_SUFFIX); + info->alias =3D g_strndup(alc->aliases[0], len); } =20 info->name =3D g_strdup(mc->name); diff --git a/include/hw/core/boards.h b/include/hw/core/boards.h index ea1e26a8c52..0a5517a2a13 100644 --- a/include/hw/core/boards.h +++ b/include/hw/core/boards.h @@ -270,7 +270,6 @@ struct MachineClass { =20 const char *family; /* NULL iff @name identifies a standalone machtype= */ char *name; - const char *alias; const char *desc; const char *deprecation_reason; =20 diff --git a/system/vl.c b/system/vl.c index f4e17173f96..fb5d55f3d68 100644 --- a/system/vl.c +++ b/system/vl.c @@ -852,7 +852,7 @@ static ObjectClass *find_machine(const char *name, GSLi= st *machines, for (el =3D machines; el; el =3D el->next) { MachineClass *mc =3D el->data; =20 - if (!strcmp(mc->name, name) || !g_strcmp0(mc->alias, name)) { + if (!strcmp(mc->name, name)) { return OBJECT_CLASS(mc); } } @@ -1598,8 +1598,6 @@ static void machine_help_func(const QDict *qdict) strlen(TYPE_MACHINE_SUFFIX)), alc->aliases[i], mc->desc, mc->name); } - } else if (mc->alias) { - printf("%-25s %s (alias of %s)\n", mc->alias, mc->desc, mc->na= me); } printf("%-25s %s%s%s%s\n", mc->name, mc->desc, mc->is_default ? " (default)" : "", --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490338; cv=none; d=zohomail.com; s=zohoarc; b=ck1w/BfrAOPHhEMRFnSJl/JcSbqwzJjmBisF5rhu4hsUtqnmN+HkawNdxxo6BFfXbImRt+4kO87cimse14SBSDPAU4vpU+hma3KGSi6U4VQ272hMKEEE/biJ2cx5shpelXCPAC6jhJ+XuSYKqShwRhcqjK/3kU1nGQRTony/DcU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490338; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=KLf1q0+8G9aiuEuBD1vAlQvEF+NJwf72FpVSRdt6Xlo=; b=csGx1RdK8C78gMOw8zWN1oYfquZIabsrOM6M+kIeK/JVxL5guUP5vqJ7B+Syuz2UXDhegbrmPt/yJLIPRgtN7izxu/m+Ne8V1JPQRvrKVBde3UGefK8GtlI8hffhpI6hh1zUMOHCjisq6S3mCUm69AFvVfGPcnAh9oK9eX88PlM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490338910535.8467711857538; Thu, 12 Nov 2026 05:32:18 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUu1-0005yg-O0; Thu, 12 Nov 2026 08:31:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUu0-0005xv-49 for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:44 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUtx-000355-Fk for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:43 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-167-uskjcdyrOR2VYBtacQLyZQ-1; Thu, 12 Nov 2026 08:31:39 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3762C180AE16; Thu, 12 Nov 2026 13:31:38 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BEBBB1956087; Thu, 12 Nov 2026 13:31:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KLf1q0+8G9aiuEuBD1vAlQvEF+NJwf72FpVSRdt6Xlo=; b=QplGl/6FWcq0eU9QQzFPp1gh4KxeqcrFRRHz7bahLTMNgItqIAqgqQ3F19XGwMPkLC1DRk 1Vdc4o/71YHz+DY+lCARn5ZRI+hD/XH+W4FnBGiG2GI7IH9Va/YmaqgoD8swwDCJjdvQsW FC99ssVn19YNx9UlYV+Jbplilx6vht8= X-MC-Unique: uskjcdyrOR2VYBtacQLyZQ-1 X-Mimecast-MFC-AGG-ID: uskjcdyrOR2VYBtacQLyZQ_1794490298 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 22/48] hw/arm: rename the 'virt' machines to 'arm-virt' Date: Thu, 12 Nov 2026 13:30:28 +0000 Message-ID: <20261112133054.1977618-23-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490340081158500 This introduces a globally unique QOM typename 'arm-virt' for the virt machine types. Aliases are added to resolve existing convenience names 'virt-$VER' and 'virt'. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- hw/arm/virt.c | 17 +++++++++++++++-- include/hw/arm/virt.h | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 60385971b6a..6217771032e 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -127,7 +127,7 @@ static void arm_virt_compat_default_set(MachineClass *m= c) } \ static const TypeInfo MACHINE_VER_SYM(info, virt, __VA_ARGS__) =3D \ { \ - .name =3D MACHINE_VER_TYPE_NAME("virt", __VA_ARGS__), \ + .name =3D MACHINE_VER_TYPE_NAME("arm-virt", __VA_ARGS__), \ .parent =3D TYPE_VIRT_MACHINE, \ .class_init =3D MACHINE_VER_SYM(class_init, virt, __VA_ARGS__), \ .is_available =3D target_base_arm, \ @@ -145,6 +145,17 @@ static void arm_virt_compat_default_set(MachineClass *= mc) static const char *const MACHINE_VER_SYM(aliases, virt, __VA_ARGS__)[]= =3D \ { \ MACHINE_TYPE_NAME("virt"), \ + MACHINE_VER_TYPE_NAME("virt", __VA_ARGS__), \ + MACHINE_TYPE_NAME("arm-virt"), \ + NULL, \ + }; \ + alc->aliases =3D MACHINE_VER_SYM(aliases, virt, __VA_ARGS__) + +#define DEFINE_VIRT_MACHINE_ALIASES(...) \ + AliasedClass *alc =3D ALIASED_CLASS(oc); \ + static const char *const MACHINE_VER_SYM(aliases, virt, __VA_ARGS__)[]= =3D \ + { \ + MACHINE_VER_TYPE_NAME("virt", __VA_ARGS__), \ NULL, \ }; \ alc->aliases =3D MACHINE_VER_SYM(aliases, virt, __VA_ARGS__) @@ -154,7 +165,9 @@ static void arm_virt_compat_default_set(MachineClass *m= c) DEFINE_VIRT_MACHINE_ALIASES_LATEST(major, minor); \ }, major, minor) #define DEFINE_VIRT_MACHINE(major, minor) \ - DEFINE_VIRT_MACHINE_IMPL({}, major, minor) + DEFINE_VIRT_MACHINE_IMPL({ \ + DEFINE_VIRT_MACHINE_ALIASES(major, minor); \ + }, major, minor) =20 =20 /* Number of external interrupt lines to configure the GIC with */ diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h index 22e66d1a113..383ee320948 100644 --- a/include/hw/arm/virt.h +++ b/include/hw/arm/virt.h @@ -215,7 +215,7 @@ struct VirtMachineState { =20 #define VIRT_ECAM_ID(high) (high ? VIRT_HIGH_PCIE_ECAM : VIRT_PCIE_ECAM) =20 -#define TYPE_VIRT_MACHINE MACHINE_TYPE_NAME("virt") +#define TYPE_VIRT_MACHINE MACHINE_TYPE_NAME("arm-virt") OBJECT_DECLARE_TYPE(VirtMachineState, VirtMachineClass, VIRT_MACHINE) =20 void virt_acpi_setup(VirtMachineState *vms); --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490762; cv=none; d=zohomail.com; s=zohoarc; b=C7f4tOV0Mwi/ncD7gm0HVbYtsAy+kNoYrW5zkoU+HC2+nZ7nnNEeF8vXOEA2PhIyBGVWP0P0HTqwigLVTFh41vJWNEvdAqIL9YGg5iHospv7p9oiK4HHZ57NHMVPPjSBcNpAG9kSHl2MoXDG1j8APVbLAzZrNRISOtj2XyB/pPE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490762; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fjl3lyJVCwgeSiCwkIM+EHZVvLHaqqGFE65gLPds70g=; b=O4HE5MoskQGmqr4if76TMPoByD0aRoViuQfy6D/mUizpDPo5HMrNgaKmlONk8paRpXVzlgKhgdgQKcPyDek5rCzhIcFRUaIjLN8cWYg9AuE9RvJ0wc+SaFXTTxv0X4gKlDvV4SVjwL/48OzOa8yvIPe7MpBvJfJz1yuJWIVD0BI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490762932482.10210404321606; Thu, 12 Nov 2026 05:39:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUu6-00066J-CN; Thu, 12 Nov 2026 08:31:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUu4-000645-IQ for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUu2-0003Le-Jl for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:48 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-308-NJsA0EdiNuazkKSbbf2i-w-1; Thu, 12 Nov 2026 08:31:41 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F2CA71800614; Thu, 12 Nov 2026 13:31:39 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 88CB11956089; Thu, 12 Nov 2026 13:31:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490305; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fjl3lyJVCwgeSiCwkIM+EHZVvLHaqqGFE65gLPds70g=; b=fLMW0gdKfBGoG2mZyBwMkoZ19JXuCMMpLk6Jf9rqHzisxKZr2PcQmO5RosZm60D6lyABI0 XpFCjrCAvIGbEFc02ifMSOBHIG2irUJh60JnhuDA0llySSWUGX5J8xpawy5OincK4eURtV Fw3TJk8YgxqhqB/3JjRL4IPkjy1Jh6M= X-MC-Unique: NJsA0EdiNuazkKSbbf2i-w-1 X-Mimecast-MFC-AGG-ID: NJsA0EdiNuazkKSbbf2i-w_1794490300 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 23/48] hw/riscv: rename the 'virt' machines to 'riscv-virt' Date: Thu, 12 Nov 2026 13:30:29 +0000 Message-ID: <20261112133054.1977618-24-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490764667158500 This introduces a globally unique QOM typename 'riscv-virt' for the virt machine type. An alias is added to resolve existing convenience name 'virt'. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- hw/riscv/virt.c | 9 ++++++++- include/hw/riscv/virt.h | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 8bc5a7b0728..2901f67d796 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -61,6 +61,7 @@ #include "qapi/qapi-type-infos-common.h" #include "hw/virtio/virtio-iommu.h" #include "hw/uefi/var-service-api.h" +#include "qom/object_interfaces.h" =20 #include "aia.h" =20 @@ -1123,6 +1124,10 @@ static void virt_machine_class_init(ObjectClass *oc,= const void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); HotplugHandlerClass *hc =3D HOTPLUG_HANDLER_CLASS(oc); + AliasedClass *alc =3D ALIASED_CLASS(oc); + static const char *const aliases[] =3D { + MACHINE_TYPE_NAME("virt"), NULL, + }; =20 mc->desc =3D "RISC-V VirtIO board"; mc->init =3D virt_machine_init; @@ -1141,6 +1146,8 @@ static void virt_machine_class_init(ObjectClass *oc, = const void *data) assert(!mc->get_hotplug_handler); mc->get_hotplug_handler =3D virt_machine_get_hotplug_handler; =20 + alc->aliases =3D aliases; + hc->plug =3D virt_machine_device_plug_cb; =20 machine_class_allow_dynamic_sysbus_dev(mc, TYPE_RAMFB_DEVICE); @@ -1188,7 +1195,7 @@ static void virt_machine_class_init(ObjectClass *oc, = const void *data) } =20 static const TypeInfo virt_machine_typeinfo =3D { - .name =3D MACHINE_TYPE_NAME("virt"), + .name =3D MACHINE_TYPE_NAME("riscv-virt"), .parent =3D TYPE_MACHINE, .class_init =3D virt_machine_class_init, .secure =3D true, diff --git a/include/hw/riscv/virt.h b/include/hw/riscv/virt.h index 6e4fbf4b647..5e7fc8a0c8f 100644 --- a/include/hw/riscv/virt.h +++ b/include/hw/riscv/virt.h @@ -30,7 +30,7 @@ #define VIRT_SOCKETS_MAX_BITS 2 #define VIRT_SOCKETS_MAX (1 << VIRT_SOCKETS_MAX_BITS) =20 -#define TYPE_RISCV_VIRT_MACHINE MACHINE_TYPE_NAME("virt") +#define TYPE_RISCV_VIRT_MACHINE MACHINE_TYPE_NAME("riscv-virt") typedef struct RISCVVirtState RISCVVirtState; DECLARE_INSTANCE_CHECKER(RISCVVirtState, RISCV_VIRT_MACHINE, TYPE_RISCV_VIRT_MACHINE) --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490763; cv=none; d=zohomail.com; s=zohoarc; b=FhYy0nQKLPBvjsUvrBhwVr/X9nbT7JTVdiQFYlXUg8/6uzUq7b5TFwxLghyLcLsBsfTwZ3pTnO971XMlgtpwjUR3LP5OL6gZZAmyFS3bRUG8QCap4kzRMWB9mNwKuMXGal3VZuqsgjY79kTyvafcd8Q7lmlbC6qDt+iL9Pi001s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490763; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=yw7lN8l4l3wyiDHQvR6OM+mQPsebP989hdJ0KmZBEpU=; b=GXZ1DxVRZRGR3kX1R9vdvGWjbfqEUdtM09iPqEgjD1+8JzvBpSBBPfBl74wZuIkWpn0aAPZ9WMvN/eYx5nW+Y/dQEoLTbnIJp9F5IZhvvR/sgA0NaeYjgTATw8Egj+Oltshp5fxwk9WDTS5UBD2KnDuRyVuBppV6B1iXQWIvVvk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490763291311.5306169869939; Thu, 12 Nov 2026 05:39:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUu6-00066k-Li; Thu, 12 Nov 2026 08:31:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUu4-00064E-Lk for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUu2-0003NP-UX for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:48 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-553-vc3pqAmVOPuJLPs8Oknf7Q-1; Thu, 12 Nov 2026 08:31:42 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BE29C18005B6; Thu, 12 Nov 2026 13:31:41 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4EDC11956087; Thu, 12 Nov 2026 13:31:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yw7lN8l4l3wyiDHQvR6OM+mQPsebP989hdJ0KmZBEpU=; b=UAQ4sYtLtp3uVBOwI9VFJMgfC6r3hN5mvCnqnqWeeMX4NuISCDo24uMUDm/f3Z7dGY5ehg DxPaaHhqHWSwKzO6K5ixpQrNgo1iU7o5W0xCTNXJmiQOW+KcwlpqFfahRwpGMtFWgK0iTL bV7FnupqCN6VPGTjfBIyQEkX7IkKocs= X-MC-Unique: vc3pqAmVOPuJLPs8Oknf7Q-1 X-Mimecast-MFC-AGG-ID: vc3pqAmVOPuJLPs8Oknf7Q_1794490301 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 24/48] hw/hexagon: rename the 'virt' machine to 'hexagon-virt' Date: Thu, 12 Nov 2026 13:30:30 +0000 Message-ID: <20261112133054.1977618-25-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490764636158500 This introduces a globally unique QOM typename 'hexagon-virt' for the virt machine type. An alias is added to resolve existing convenience name 'virt'. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- hw/hexagon/virt.c | 6 ++++++ include/hw/hexagon/virt.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/hexagon/virt.c b/hw/hexagon/virt.c index 3327e28d121..645a3146810 100644 --- a/hw/hexagon/virt.c +++ b/hw/hexagon/virt.c @@ -19,6 +19,7 @@ #include "qemu/units.h" #include "machine_cfg_v68n_1024.h.inc" #include "system/device_tree.h" +#include "qom/object_interfaces.h" =20 enum { VIRT_UART0, @@ -139,7 +140,12 @@ static void virt_init(MachineState *ms) static void virt_class_init(ObjectClass *oc, const void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); + AliasedClass *alc =3D ALIASED_CLASS(mc); + static const char *const aliases[] =3D { + MACHINE_TYPE_NAME("virt"), NULL, + }; =20 + alc->aliases =3D aliases; mc->desc =3D "Hexagon Virtual Machine"; mc->init =3D virt_init; mc->default_cpu_type =3D HEXAGON_CPU_TYPE_NAME("v68"); diff --git a/include/hw/hexagon/virt.h b/include/hw/hexagon/virt.h index dc9f22a83c4..74763028b6b 100644 --- a/include/hw/hexagon/virt.h +++ b/include/hw/hexagon/virt.h @@ -20,7 +20,7 @@ struct HexagonVirtMachineState { MemoryRegion tcm; }; =20 -#define TYPE_HEXAGON_VIRT_MACHINE MACHINE_TYPE_NAME("virt") +#define TYPE_HEXAGON_VIRT_MACHINE MACHINE_TYPE_NAME("hexagon-virt") OBJECT_DECLARE_SIMPLE_TYPE(HexagonVirtMachineState, HEXAGON_VIRT_MACHINE) =20 #endif /* HW_HEXAGONVIRT_H */ --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490412; cv=none; d=zohomail.com; s=zohoarc; b=ioeg4e0bCCUo/CZ/iHVjQL4z+tzaaTxuSndX2+KwORpJDok96/HqNbHonTYsXVVAQZ1NAJdPFT6+P9CjiZwvRhYxwklqKKClgVSs2H3RQtqgUCQ1ZFv3HSV9Bt+IpbCKfDgZY/nnOiPHgubMXneXhupy5kFvAzn4TZ4v6fyRRXQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490412; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0ndKNZdoR/58rfLya+g8Y1PrRMIUmuGezmsfRor59vo=; b=XALpUbTg4t1mIoeyu4Bs/gwwFl+7Isa/Vm1H6UFN4rG4DVtHqeJHABsG/XmdoRS111fnLmdG548wDZ9gbNtu74FGs++rfmTJ3XrhRrh0k830gKHYX3dsdbuKwd8XvKvZpPiqdSTnaqkqX/4N0+YfCsSim/y9tIM67tIrBJx6v/8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490412812123.5923533915219; Thu, 12 Nov 2026 05:33:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUvB-000705-Dd; Thu, 12 Nov 2026 08:32:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUu7-000687-BC for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:52 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUu5-0003Yb-MY for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:51 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-277-Ro3fv1g7PuWNbdZ88ZuVpA-1; Thu, 12 Nov 2026 08:31:44 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8815E1801204; Thu, 12 Nov 2026 13:31:43 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1A6831956087; Thu, 12 Nov 2026 13:31:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0ndKNZdoR/58rfLya+g8Y1PrRMIUmuGezmsfRor59vo=; b=QdjzFXaoIsnKBbNfeu3PfJv7cjbeZa/1OsZCJezinFrSvoYHWE/QT/w+nBhv5XemQgk+0G qsk/PoV0/oftpYROtWAfcBnDJiIvh7RCcQZ8yxaHirCOdoCrqS9BPh2DB7+QfGlURBECXZ F2sLUHrxQ0o00cEXGUcZ/rvsEHP06DY= X-MC-Unique: Ro3fv1g7PuWNbdZ88ZuVpA-1 X-Mimecast-MFC-AGG-ID: Ro3fv1g7PuWNbdZ88ZuVpA_1794490303 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 25/48] hw/loongarch: rename the 'virt' machine to 'loongarch-virt' Date: Thu, 12 Nov 2026 13:30:31 +0000 Message-ID: <20261112133054.1977618-26-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490415111158500 This introduces a globally unique QOM typename 'loongarch-virt' for the virt machine type. An alias is added to resolve existing convenience name 'virt'. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- hw/loongarch/virt.c | 17 +++++++++++++++-- include/hw/loongarch/virt.h | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 52b40883f4e..a1ecc815a13 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -1535,7 +1535,7 @@ static void virt_class_init(ObjectClass *oc, const vo= id *data) } \ static const TypeInfo MACHINE_VER_SYM(info, virt, __VA_ARGS__) =3D \ { \ - .name =3D MACHINE_VER_TYPE_NAME("virt", __VA_ARGS__), \ + .name =3D MACHINE_VER_TYPE_NAME("loongarch-virt", __VA_ARGS__), \ .parent =3D TYPE_LOONGARCH_VIRT_MACHINE, \ .class_init =3D MACHINE_VER_SYM(class_init, virt, __VA_ARGS__), \ .secure =3D true, \ @@ -1552,6 +1552,17 @@ static void virt_class_init(ObjectClass *oc, const v= oid *data) static const char *const MACHINE_VER_SYM(aliases, virt, __VA_ARGS__)[]= =3D \ { \ MACHINE_TYPE_NAME("virt"), \ + MACHINE_VER_TYPE_NAME("virt", __VA_ARGS__), \ + MACHINE_TYPE_NAME("m68k-virt"), \ + NULL, \ + }; \ + alc->aliases =3D MACHINE_VER_SYM(aliases, virt, __VA_ARGS__) + +#define DEFINE_VIRT_MACHINE_ALIASES(...) \ + AliasedClass *alc =3D ALIASED_CLASS(oc); \ + static const char *const MACHINE_VER_SYM(aliases, virt, __VA_ARGS__)[]= =3D \ + { \ + MACHINE_VER_TYPE_NAME("virt", __VA_ARGS__), \ NULL, \ }; \ alc->aliases =3D MACHINE_VER_SYM(aliases, virt, __VA_ARGS__) @@ -1562,7 +1573,9 @@ static void virt_class_init(ObjectClass *oc, const vo= id *data) mc->is_default =3D true; \ }, major, minor) #define DEFINE_VIRT_MACHINE(major, minor) \ - DEFINE_VIRT_MACHINE_VERSION({}, major, minor) + DEFINE_VIRT_MACHINE_VERSION({ \ + DEFINE_VIRT_MACHINE_ALIASES(major, minor); \ + }, major, minor) =20 static void virt_instance_finalize(Object *obj) { diff --git a/include/hw/loongarch/virt.h b/include/hw/loongarch/virt.h index d39a9bbf5dd..09529de48bd 100644 --- a/include/hw/loongarch/virt.h +++ b/include/hw/loongarch/virt.h @@ -130,7 +130,7 @@ struct LoongArchVirtMachineState { bool highmem_mmio; }; =20 -#define TYPE_LOONGARCH_VIRT_MACHINE MACHINE_TYPE_NAME("virt") +#define TYPE_LOONGARCH_VIRT_MACHINE MACHINE_TYPE_NAME("loongarch-virt") OBJECT_DECLARE_SIMPLE_TYPE(LoongArchVirtMachineState, LOONGARCH_VIRT_MACHI= NE) void virt_acpi_setup(LoongArchVirtMachineState *lvms); void virt_fdt_setup(LoongArchVirtMachineState *lvms); --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490528; cv=none; d=zohomail.com; s=zohoarc; b=ALkeYBVNoF/hDd+On5vpkuCY7FVKVW/OB6tgpZE9XUktJ8I4MaZhaoLv9mbWK8h+jBL/LoUA/8XQL8EnN810OCvTg0q5/Vx93xR2JFZeh1m5kqH1g6i07P/8EBCB5BiEPheEhFslhdAKJkavfxfm6QayRFp0+J8TkfWDqVTLop0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490528; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=yT09c+TWZhPFeZtcufZcDwy4EHSqlKyQOrZITUkpO4k=; b=CBXSoXv0PPRInSgRRWbuBGTNGb7q+pfzJm4UGtEdeafO50cotZA7v7vU6KQQ2ude4NNfs0iWmJFurFCvY1SjOkEtHKfF9ZP/dpuNyn5bh1JVTfw53dQv5aAOHjDE6WtOmI8X9bawDlFj0Jg68aqYtzM8o5K+yWTcuE+7VHot2XY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490528516647.5719832366138; Thu, 12 Nov 2026 05:35:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUuG-0006A8-AQ; Thu, 12 Nov 2026 08:32:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUu8-00068H-Ec for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:52 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUu6-0003cc-E3 for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:51 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-386-6cxZrXykM3-nDvKUV4W-mg-1; Thu, 12 Nov 2026 08:31:46 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5286318004F6; Thu, 12 Nov 2026 13:31:45 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D862E1956087; Thu, 12 Nov 2026 13:31:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yT09c+TWZhPFeZtcufZcDwy4EHSqlKyQOrZITUkpO4k=; b=O3aAeml/mEKtsBCcytaRPneCqMDVzpXhcnQXFCo/htempKEPhg/hHX6gJdZxp7RqWrxEfg GtakaSdIufYz6nQrzEBBHOHejD545T7xYknVjSd0o00iKU6s6HbP1/LmtvwVNqzfAqyxOm Y0p2Qx3DSNr9ZjAQnXi/PHGw5g9kwsE= X-MC-Unique: 6cxZrXykM3-nDvKUV4W-mg-1 X-Mimecast-MFC-AGG-ID: 6cxZrXykM3-nDvKUV4W-mg_1794490305 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 26/48] hw/m68k: rename the 'virt' machine to 'm68k-virt' Date: Thu, 12 Nov 2026 13:30:32 +0000 Message-ID: <20261112133054.1977618-27-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490531127158501 This introduces a globally unique QOM typename 'm68k-virt' for the virt machine type. An alias is added to resolve existing convenience name 'virt'. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- hw/m68k/virt.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/hw/m68k/virt.c b/hw/m68k/virt.c index 487d9bcc8d0..398293144c8 100644 --- a/hw/m68k/virt.c +++ b/hw/m68k/virt.c @@ -324,7 +324,7 @@ static void virt_machine_class_init(ObjectClass *oc, co= nst void *data) } =20 static const TypeInfo virt_machine_info =3D { - .name =3D MACHINE_TYPE_NAME("virt"), + .name =3D MACHINE_TYPE_NAME("m68k-virt"), .parent =3D TYPE_MACHINE, .abstract =3D true, .class_init =3D virt_machine_class_init, @@ -351,8 +351,8 @@ type_init(virt_machine_register_types) } \ static const TypeInfo MACHINE_VER_SYM(info, virt, __VA_ARGS__) =3D \ { \ - .name =3D MACHINE_VER_TYPE_NAME("virt", __VA_ARGS__), \ - .parent =3D MACHINE_TYPE_NAME("virt"), \ + .name =3D MACHINE_VER_TYPE_NAME("m68k-virt", __VA_ARGS__), \ + .parent =3D MACHINE_TYPE_NAME("m68k-virt"), \ .class_init =3D MACHINE_VER_SYM(class_init, virt, __VA_ARGS__), \ .is_available =3D target_m68k, \ }; \ @@ -368,6 +368,17 @@ type_init(virt_machine_register_types) static const char *const MACHINE_VER_SYM(aliases, virt, __VA_ARGS__)[]= =3D \ { \ MACHINE_TYPE_NAME("virt"), \ + MACHINE_VER_TYPE_NAME("virt", __VA_ARGS__), \ + MACHINE_TYPE_NAME("m68k-virt"), \ + NULL, \ + }; \ + alc->aliases =3D MACHINE_VER_SYM(aliases, virt, __VA_ARGS__) + +#define DEFINE_VIRT_MACHINE_ALIASES(...) \ + AliasedClass *alc =3D ALIASED_CLASS(oc); \ + static const char *const MACHINE_VER_SYM(aliases, virt, __VA_ARGS__)[]= =3D \ + { \ + MACHINE_VER_TYPE_NAME("virt", __VA_ARGS__), \ NULL, \ }; \ alc->aliases =3D MACHINE_VER_SYM(aliases, virt, __VA_ARGS__) @@ -377,7 +388,9 @@ type_init(virt_machine_register_types) DEFINE_VIRT_MACHINE_ALIASES_LATEST(major, minor); \ }, major, minor) #define DEFINE_VIRT_MACHINE(major, minor) \ - DEFINE_VIRT_MACHINE_IMPL({}, major, minor) + DEFINE_VIRT_MACHINE_IMPL({ \ + DEFINE_VIRT_MACHINE_ALIASES(major, minor); \ + }, major, minor) =20 static void virt_machine_11_2_options(MachineClass *mc) { --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490331; cv=none; d=zohomail.com; s=zohoarc; b=GCK3oqTbS34Q6GXiehrV/ZrG8tpxXCfzPN51E/hd7DrXjW/r0pZ7nQu1BHKmIoIXLnfZVTq0xOXu0x6de3DKZwmnEBuv7VZfl8zy3+4/1nsn8R57maOBO08hzqrB1mVpb5dysl/JekYRV+w3iRfUNpbggwmLA4oNAzN79w4mYeY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490331; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1X5UKViNf109ebwxdMV78qUKbqTcab+6B/ILPHjvM8E=; b=lLQj/n/NdDsdLKW4KvebyEc9iovnjBio9d/LuHfj4LC6arf5I/rKa6Z279q/4lBz9raupblxwQZuRhCxRtIhEfueik8E0IcU30TZzvaJyQLZSPg4siSb3L/ndDjefKFUDb+UcF3/5M1s0kvzw6d+HGEaoOxp5kyjEiMJI9oU+hY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 179449033121772.35870839678182; Thu, 12 Nov 2026 05:32:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUuI-0006As-B4; Thu, 12 Nov 2026 08:32:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUu9-00068h-Rm for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:54 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUu8-0003fk-Am for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:53 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-635--1y-11bNOEyHFd8np-aFDQ-1; Thu, 12 Nov 2026 08:31:48 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 37BAD18002FC; Thu, 12 Nov 2026 13:31:47 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A23D9195608D; Thu, 12 Nov 2026 13:31:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490311; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1X5UKViNf109ebwxdMV78qUKbqTcab+6B/ILPHjvM8E=; b=bdrAKiLDMmTcwP3pGuRSHInUepDA9YxAbUp9kusbqL20k278DMo6/Z3/c7sK7N38tOtomd mJvztzOXt9xlS4dn1LlWNb/v0BoVLTqZQ4OI1M4vD+FPpRakDm+9P2uRaJMV4F3xr/W/t0 ZTBEN3PHpeW5eRbHmjzBzwm5LuP9vqw= X-MC-Unique: -1y-11bNOEyHFd8np-aFDQ-1 X-Mimecast-MFC-AGG-ID: -1y-11bNOEyHFd8np-aFDQ_1794490307 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 27/48] hw/or1k: rename the 'virt' machine to 'or1k-virt' Date: Thu, 12 Nov 2026 13:30:33 +0000 Message-ID: <20261112133054.1977618-28-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490332133158500 This introduces a globally unique QOM typename 'or1k-virt' for the virt machine type. An alias is added to resolve existing convenience name 'virt'. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- hw/or1k/virt.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/or1k/virt.c b/hw/or1k/virt.c index a3ff903839b..579acdedfa6 100644 --- a/hw/or1k/virt.c +++ b/hw/or1k/virt.c @@ -28,13 +28,14 @@ #include "system/system.h" #include "system/qtest.h" #include "system/reset.h" +#include "qom/object_interfaces.h" =20 #include =20 #define VIRT_CPUS_MAX 4 #define VIRT_CLK_MHZ 20000000 =20 -#define TYPE_VIRT_MACHINE MACHINE_TYPE_NAME("virt") +#define TYPE_VIRT_MACHINE MACHINE_TYPE_NAME("or1k-virt") #define VIRT_MACHINE(obj) \ OBJECT_CHECK(OR1KVirtState, (obj), TYPE_VIRT_MACHINE) =20 @@ -546,7 +547,12 @@ static void openrisc_virt_init(MachineState *machine) static void openrisc_virt_machine_init(ObjectClass *oc, const void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); + AliasedClass *alc =3D ALIASED_CLASS(oc); + static const char *const aliases[] =3D { + MACHINE_TYPE_NAME("virt"), NULL, + }; =20 + alc->aliases =3D aliases; mc->desc =3D "or1k virtual machine"; mc->init =3D openrisc_virt_init; mc->max_cpus =3D VIRT_CPUS_MAX; --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490365; cv=none; d=zohomail.com; s=zohoarc; b=SfPadbS/jCeEe0MXrFgwiWdE0MKe5i4zQe4o55/L2t5SUj8jc1ehBbbDEuIafRSCir1uVmqmVhTWh5N5UKdrekK0khDwye5LhygU1ZPsuuOJxtcOmE2Y3qU5Tpdzylo+SJILqq/lferb4XEUNouynuQwJnXaEMCkOTzQ/Y8HJZo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490365; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=xaoGBkrhvfTsKumVWYT4e9iFxyP89wFJuBdm4ls1Mx4=; b=jLuN14FVR04jWQzbKawGyyrHwvry+gScl/62eYefFYDJQjJ//jyOIYb5bpC8gHuLXgmAL9EalTVtptRphPX5Zl9bPF/vSZn4q+zmGVUScadpqLL9jNbZ8T/23R2OLy5G60slTgyNdUcB2yvS1TCPK7HeKUVlK3U04mu0uC+RJiQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490364907470.6656231456516; Thu, 12 Nov 2026 05:32:44 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUua-0006Vj-93; Thu, 12 Nov 2026 08:32:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuB-00069h-Ga for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:56 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuA-0003q2-2d for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:55 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-607-BsvSlgAtOqumB14aY6BoYg-1; Thu, 12 Nov 2026 08:31:50 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E0A3219775AB; Thu, 12 Nov 2026 13:31:48 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6E854195608D; Thu, 12 Nov 2026 13:31:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xaoGBkrhvfTsKumVWYT4e9iFxyP89wFJuBdm4ls1Mx4=; b=VWe2dTAlOvpM20PwLNnP83MewAMrat1O70aF+amFbpe/R7KjDTTT12K6bngFFNE/slCF9I QzdX1N1dJliUzKsaEyXMiuiVYQyZTUAn0L3jU8onRRGbupvmuL8I8jKsa4cLSEsbfn9WQ/ T9my0LlCvQq7/feEtd/16mghj4lOfko= X-MC-Unique: BsvSlgAtOqumB14aY6BoYg-1 X-Mimecast-MFC-AGG-ID: BsvSlgAtOqumB14aY6BoYg_1794490309 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 28/48] hw/xtensa: rename the 'virt' machine to 'xtensa-virt' Date: Thu, 12 Nov 2026 13:30:34 +0000 Message-ID: <20261112133054.1977618-29-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490366312158500 This introduces a globally unique QOM typename 'xtensa-virt' for the virt machine type. An alias is added to resolve existing convenience name 'virt'. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- hw/xtensa/virt.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/xtensa/virt.c b/hw/xtensa/virt.c index 271f06e0953..c1aec5b4c7c 100644 --- a/hw/xtensa/virt.c +++ b/hw/xtensa/virt.c @@ -37,6 +37,7 @@ #include "qemu/error-report.h" #include "xtensa_memory.h" #include "xtensa_sim.h" +#include "qom/object_interfaces.h" =20 static void create_pcie(MachineState *ms, CPUXtensaState *env, int irq_bas= e, hwaddr addr_base) @@ -117,6 +118,12 @@ static void xtensa_virt_init(MachineState *machine) =20 static void xtensa_virt_machine_init(MachineClass *mc) { + AliasedClass *alc =3D ALIASED_CLASS(mc); + static const char *const aliases[] =3D { + MACHINE_TYPE_NAME("virt"), NULL, + }; + + alc->aliases =3D aliases; mc->desc =3D "virt machine (" XTENSA_DEFAULT_CPU_MODEL ")"; mc->init =3D xtensa_virt_init; mc->max_cpus =3D 32; @@ -124,4 +131,4 @@ static void xtensa_virt_machine_init(MachineClass *mc) mc->default_nic =3D "virtio-net-pci"; } =20 -DEFINE_MACHINE("virt", xtensa_virt_machine_init) +DEFINE_MACHINE("xtensa-virt", xtensa_virt_machine_init) --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490700; cv=none; d=zohomail.com; s=zohoarc; b=YAPKXtETgje6XZdlPm5G4FPb2RyddV7fTCE7t20B87Dd/FzYi3IhOH6lBlFoWWBNZXCr6I1heOrRvss2X+6hNjJhHIi4FYlhS2SW4b33PZzKx3D1wu5h3r+sOUGnoQ9MS3oRdJB8qwVoVD+vmNwSYHSaZW5wlUnYNwNF6HV08Qs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490700; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7zxtn0zpu3tKIn4V283i3Ousdpz8gAol3ebvt83Mh9s=; b=jcuKVs3//fDuBR6+J9J8NaT53RYFikAvRr8HRdzDX1A6p8gt9seadzHqcSwjWSB/wnsJ7NxVu7LWCwwG00aBQk5RUCbwAa0LwJQLPc5UcnUP7xYUmPQx+gqyPq0222aD8eGWzmH4jVJgCGSWrJU50CDQPfgMmLWhOq66mKvQLkQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 179449070051152.66971519568392; Thu, 12 Nov 2026 05:38:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUvK-0007KL-Gs; Thu, 12 Nov 2026 08:33:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuB-00069i-PO for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:56 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuA-0003rJ-BU for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:31:55 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-224-k6vVnDrHO3eh6xX1-Mjb6w-1; Thu, 12 Nov 2026 08:31:51 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A70CC1800540; Thu, 12 Nov 2026 13:31:50 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3C4BE1956089; Thu, 12 Nov 2026 13:31:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7zxtn0zpu3tKIn4V283i3Ousdpz8gAol3ebvt83Mh9s=; b=fCu7mxmH4fBjgSdnBDYLuM5pEknbogIb1y6k+KnXnptiWr8SoV+yI39LGaPt5eoKgBjaRk xKWVtXe//tRcI4VPFk6voKpymXSVrghJ4cikWjFQMKAGb/djD5JMKrWW4brPJhApPqNpg6 PLUqDL8HADDVVTeRc2YMGJz89CAwhRQ= X-MC-Unique: k6vVnDrHO3eh6xX1-Mjb6w-1 X-Mimecast-MFC-AGG-ID: k6vVnDrHO3eh6xX1-Mjb6w_1794490310 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 29/48] system: stop sorting machine names based on 'family' Date: Thu, 12 Nov 2026 13:30:35 +0000 Message-ID: <20261112133054.1977618-30-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490701578158500 Only the x86 'nitro-enclave', 'microvm', 'q35' and 'i440fx' machine classes set a non-NULL 'family' field. This results in a fairly strange looking sort order in the '-machine help' output, such that from a user POV is appears largely unsorted. No other targets bother to set 'family', even though they have far larger lists of machines. It is sufficient to sort exclusively based on the machine type name to get a purely alphabetical sorting. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- system/vl.c | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/system/vl.c b/system/vl.c index fb5d55f3d68..a187d10ad9c 100644 --- a/system/vl.c +++ b/system/vl.c @@ -1536,33 +1536,7 @@ static bool debugcon_parse(const char *devname, Erro= r **errp) static gint machine_class_cmp(gconstpointer a, gconstpointer b, gpointer d) { const MachineClass *mc1 =3D a, *mc2 =3D b; - int res; =20 - if (mc1->family =3D=3D NULL) { - if (mc2->family =3D=3D NULL) { - /* Compare standalone machine types against each other; they s= ort - * in increasing order. - */ - return strcmp(object_class_get_name(OBJECT_CLASS(mc1)), - object_class_get_name(OBJECT_CLASS(mc2))); - } - - /* Standalone machine types sort after families. */ - return 1; - } - - if (mc2->family =3D=3D NULL) { - /* Families sort before standalone machine types. */ - return -1; - } - - /* Families sort between each other alphabetically increasingly. */ - res =3D strcmp(mc1->family, mc2->family); - if (res !=3D 0) { - return res; - } - - /* Within the same family, machine types sort in decreasing order. */ return strcmp(object_class_get_name(OBJECT_CLASS(mc2)), object_class_get_name(OBJECT_CLASS(mc1))); } --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490389; cv=none; d=zohomail.com; s=zohoarc; b=JSV4PSWhAnEtagTgvCzF02ZniCiAlxLD7flvm7hjqTolTOUlAQbSlKMmaLV5wAxrc4InqslbyYi2cssL8nJ8KsN47ih/G7XyjQ3vL2dRKU8Co9Fwk8Ri7JIYmJcpNxrSm2dmsmN4ANVrQI99+sE+J4aKSnwb/KDQ44LshBBfj0M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490389; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fnIbsW+cV/9j7idU3AU7N80mYw8wzWasbeGrandoO6M=; b=Ki/xzSSrVjLgzy2W5Rzn0MgU1ql6VXsZAHXDbb/WxDgM/BQMjL+jqmAryhd/ktQu8wHi6YDLrbAJIgPinVPdVtRK0X61rsf7vv1WWPVxczBqwrMSD+pMdBUSoz4bqHaOV0zZOCDAiTCJmGrlfK64o/C8apxHGsTFNAY4TZbnv5U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490389428603.4916898403872; Thu, 12 Nov 2026 05:33:09 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUvE-0007Be-Ck; Thu, 12 Nov 2026 08:33:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuG-0006Ar-M5 for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:02 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuF-0004Fd-4s for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:00 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-204-OKIfYtpuOdK3h8RTHUp2bQ-1; Thu, 12 Nov 2026 08:31:53 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7163A1899FC9; Thu, 12 Nov 2026 13:31:52 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 033051956087; Thu, 12 Nov 2026 13:31:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490318; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fnIbsW+cV/9j7idU3AU7N80mYw8wzWasbeGrandoO6M=; b=h5nNKNBHerbGZ9PsYkLxqBBR91/e4Ln5OY3r/ThCn+gW+C66yquC+YXWr1f7L8aAobfHQM F8RoBDwPoZgV2W7FruxqDMpIGDsQLqcDN/y1o3QifK9bsKooYlSDjWCyM+9LpsmwX/Whj7 go2bP/xkFA7Fhy0x9zFKyPzBeJUnX+Y= X-MC-Unique: OKIfYtpuOdK3h8RTHUp2bQ-1 X-Mimecast-MFC-AGG-ID: OKIfYtpuOdK3h8RTHUp2bQ_1794490312 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 30/48] system: put machine aliases in alphbetical order Date: Thu, 12 Nov 2026 13:30:36 +0000 Message-ID: <20261112133054.1977618-31-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490390822158500 When outputting machines for '-machine help', the machine classes are sorted by name, but aliases, are always printed immediately before the machine name. Mostly the aliases share the same name prefix as the main machine so this does not look odd, other than 'q35' appearing in the middle of a list of machines with 'pc-q35' prefix. With the forthcoming patches to rename the 'virt' machine classes to have unique names across all targets, the positioning of aliases in the output list looks much odder. Change to fully alphabetically sort the '-machine help' output so aliases are subject to the sorting alongside machines. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- system/vl.c | 41 ++++++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/system/vl.c b/system/vl.c index a187d10ad9c..e822a30c8df 100644 --- a/system/vl.c +++ b/system/vl.c @@ -1533,12 +1533,9 @@ static bool debugcon_parse(const char *devname, Erro= r **errp) return true; } =20 -static gint machine_class_cmp(gconstpointer a, gconstpointer b, gpointer d) +static int sort_lines(const void *p1, const void *p2) { - const MachineClass *mc1 =3D a, *mc2 =3D b; - - return strcmp(object_class_get_name(OBJECT_CLASS(mc2)), - object_class_get_name(OBJECT_CLASS(mc1))); + return strcmp(*(const char **) p1, *(const char **) p2); } =20 static void machine_help_func(const QDict *qdict) @@ -1546,6 +1543,9 @@ static void machine_help_func(const QDict *qdict) g_autoptr(GSList) machines =3D NULL; GSList *el; const char *type =3D qdict_get_try_str(qdict, "type"); + g_auto(GStrv) lines =3D NULL; + size_t nlines =3D 0; + size_t i; =20 machines =3D object_class_get_list(TYPE_MACHINE, false); if (type) { @@ -1560,23 +1560,34 @@ static void machine_help_func(const QDict *qdict) } =20 printf("Supported machines are:\n"); - machines =3D g_slist_sort_with_data(machines, machine_class_cmp, NULL); for (el =3D machines; el; el =3D el->next) { MachineClass *mc =3D el->data; AliasedClass *alc =3D ALIASED_CLASS(mc); if (alc->aliases) { - size_t i; for (i =3D 0; alc->aliases[i] !=3D NULL; i++) { - printf("%-*.25s %s (alias of %s)\n", - (int)(strlen(alc->aliases[i]) - - strlen(TYPE_MACHINE_SUFFIX)), - alc->aliases[i], mc->desc, mc->name); + g_autofree char *name =3D g_strndup( + alc->aliases[i], + strlen(alc->aliases[i]) - strlen(TYPE_MACHINE_SUFFIX)); + lines =3D g_renew(char *, lines, nlines + 2); + lines[nlines] =3D g_strdup_printf("%-25s %s (alias of %s)\= n", + name, mc->desc, mc->name); + lines[nlines + 1] =3D NULL; + nlines++; } } - printf("%-25s %s%s%s%s\n", mc->name, mc->desc, - mc->is_default ? " (default)" : "", - mc->deprecation_reason ? " (deprecated)" : "", - object_class_is_secure(OBJECT_CLASS(mc)) ? " (secure)" : ""= ); + lines =3D g_renew(char *, lines, nlines + 2); + lines[nlines] =3D g_strdup_printf( + "%-25s %s%s%s%s\n", mc->name, mc->desc, + mc->is_default ? " (default)" : "", + mc->deprecation_reason ? " (deprecated)" : "", + object_class_is_secure(OBJECT_CLASS(mc)) ? " (secure)" : ""); + lines[nlines + 1] =3D NULL; + nlines++; + } + qsort(lines, nlines, sizeof(lines[0]), sort_lines); + + for (i =3D 0; i < nlines; i++) { + fputs(lines[i], stdout); } } =20 --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490553; cv=none; d=zohomail.com; s=zohoarc; b=KPb3VZrZ/SOGzOAp1yDm5siYhTHRZVIrbmsjuHgJydYKrC+wtjdEzcs3b7NoXGJt19X8bHYTuEqxuLjkBVZLKYsf+4WDSxkG75cHdE/bdRx/48+RA6ZjhK3XfEkD8cw+Aac4/NeOG8be7lcR7KhWeLOAFSjw/7yNx6E46cFyaGY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490553; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=LeG2q5nZDF6gOwJDdrcL3noJlJ1KLDJsg96sBYxTtHk=; b=mFRUIg5CzfF0j7Z/Ktby6AOYd6SvI4N8ZzfaDdnguDzrdN6Dn9qqNCIR20gPWekCJg+zzum7r//nB4/gxvy4gKU5lA2FGUtMCnCRp6oQzpBFUYtSDSNF5KN6bBSLID/zmwbMoTghwQGstH8prhKE9KIRUVqTu+gF41GLond7xww= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490553884292.690105331512; Thu, 12 Nov 2026 05:35:53 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUwz-0001Vk-QE; Thu, 12 Nov 2026 08:34:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuL-0006Hy-VV for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:12 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuK-0004el-EN for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:05 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-516-PE4dW_8DPI2jksbeO-aWHw-1; Thu, 12 Nov 2026 08:31:55 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 364F0195609F; Thu, 12 Nov 2026 13:31:54 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BE3A21956087; Thu, 12 Nov 2026 13:31:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490323; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LeG2q5nZDF6gOwJDdrcL3noJlJ1KLDJsg96sBYxTtHk=; b=OBOAihH9bYyZsO4qQCJXDtuEGychCznc7M+vYAB3fmyMPZPXfxgwZhA/cTzvl9I8lFrYy4 jNpuUlYZX93SKzitSGuRldPx6FxxcrUSXr4V0HslvZ11uNWQsQhqf0oe+yuI8j4t99UK89 HuN+YVM2GPK0db3FBHFy7j/jTE9ElWI= X-MC-Unique: PE4dW_8DPI2jksbeO-aWHw-1 X-Mimecast-MFC-AGG-ID: PE4dW_8DPI2jksbeO-aWHw_1794490314 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 31/48] system: filter machine type list if a target is selected Date: Thu, 12 Nov 2026 13:30:37 +0000 Message-ID: <20261112133054.1977618-32-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490555349158500 If a specific target is selected then filter the machine type list, otherwise report all registered types and aliases. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- system/vl.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/system/vl.c b/system/vl.c index e822a30c8df..0afcc18866d 100644 --- a/system/vl.c +++ b/system/vl.c @@ -144,6 +144,7 @@ #include "qemu/guest-random.h" #include "qemu/keyval.h" #include "memory-internal.h" +#include "qemu/target-info-def.h" =20 #define MAX_VIRTIO_CONSOLES 1 =20 @@ -1561,8 +1562,18 @@ static void machine_help_func(const QDict *qdict) =20 printf("Supported machines are:\n"); for (el =3D machines; el; el =3D el->next) { - MachineClass *mc =3D el->data; - AliasedClass *alc =3D ALIASED_CLASS(mc); + ObjectClass *oc =3D el->data; + MachineClass *mc =3D MACHINE_CLASS(oc); + AliasedClass *alc =3D ALIASED_CLASS(oc); + /* + * If we've selected a specific target, then filter + * based on what is creatable, otherwise report + * everything that is registered + */ + if (target_info() && !target_specific_class_creatable(oc)) { + continue; + } + if (alc->aliases) { for (i =3D 0; alc->aliases[i] !=3D NULL; i++) { g_autofree char *name =3D g_strndup( @@ -1580,7 +1591,7 @@ static void machine_help_func(const QDict *qdict) "%-25s %s%s%s%s\n", mc->name, mc->desc, mc->is_default ? " (default)" : "", mc->deprecation_reason ? " (deprecated)" : "", - object_class_is_secure(OBJECT_CLASS(mc)) ? " (secure)" : ""); + object_class_is_secure(oc) ? " (secure)" : ""); lines[nlines + 1] =3D NULL; nlines++; } --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490580; cv=none; d=zohomail.com; s=zohoarc; b=h8tPHvCTy4iwTtUSUAbEuO3GSVAoGV8s+LAljlIhsDzyf8PHdaIpFkqJ+oRcbpSPpgSxvudqjg66VG8uIdYA5h0wtlkS3ec6XjB++CcwnFQ5TCVKm/L3Scyx4ePtkE0PRPaxNBaqvDC64KNj7NhDsHlOCliY1Z8aB6zNVKR2mF0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490580; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ABZEI2OPXvsdmccRaGVp+MgFNQQHEDoEMnd3oLGMebw=; b=RIEnPaJV6KruwZOOwUnNkBS7Jr2YqYKQKwRWWSbL//a2483NfZhzez1tWk1OUroF7PAKiY4NnY14rG0Fcjwz5qHEctBoKgrTCsaKSRGcUNyG9eekj3zuDbrYk0IKJxYh0DNqDMqASWDlzdDscu2BJL9XtxDs25fVvtlxpu3i0Gc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490580326581.4666361156146; Thu, 12 Nov 2026 05:36:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUvV-0007da-5q; Thu, 12 Nov 2026 08:33:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuS-0006W2-6J for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:14 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuP-0004Uh-BS for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:11 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-568-aAiPdByFOninhHlkic3GFA-1; Thu, 12 Nov 2026 08:31:57 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F157C1977687; Thu, 12 Nov 2026 13:31:55 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 86A151955DB9; Thu, 12 Nov 2026 13:31:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490321; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ABZEI2OPXvsdmccRaGVp+MgFNQQHEDoEMnd3oLGMebw=; b=SiWEEFUEj8JTa9KyVF4vGxmhagU8wT278ZGWoWLqCBr13hNxaYki/7cPltN4pog3bQLg6c +ApyURcn7zSpn3y5B4yqFT/HAnP519x48n27tiXQHuWV8DiIRYeqaUFHhvsC53uYOtHXEU GheIkH/PYp6Bi8SoMwF/mCOLZicxkU4= X-MC-Unique: aAiPdByFOninhHlkic3GFA-1 X-Mimecast-MFC-AGG-ID: aAiPdByFOninhHlkic3GFA_1794490316 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 32/48] hw/core: filter machine type list if a target is selected Date: Thu, 12 Nov 2026 13:30:38 +0000 Message-ID: <20261112133054.1977618-33-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490581785158500 If a specific target is selected then filter the machine type list, otherwise report all registered types and aliases. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- hw/core/machine-qmp-cmds.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index ade5a31c239..3f06ce8c75f 100644 --- a/hw/core/machine-qmp-cmds.c +++ b/hw/core/machine-qmp-cmds.c @@ -34,6 +34,7 @@ #include "system/system.h" #include "hw/s390x/storage-keys.h" #include "qom/object_interfaces.h" +#include "qemu/target-info-def.h" =20 /* * QMP query for enabled and present accelerators @@ -161,10 +162,20 @@ MachineInfoList *qmp_query_machines(bool has_compat_p= rops, bool compat_props, =20 machines =3D object_class_get_list(TYPE_MACHINE, false); for (el =3D machines; el; el =3D el->next) { - MachineClass *mc =3D el->data; + ObjectClass *oc =3D el->data; + MachineClass *mc =3D MACHINE_CLASS(oc); const char *default_cpu_type =3D machine_class_default_cpu_type(mc= ); MachineInfo *info; - AliasedClass *alc =3D ALIASED_CLASS(mc); + AliasedClass *alc =3D ALIASED_CLASS(oc); + + /* + * If we've selected a specific target, then filter + * based on what is creatable, otherwise report + * everything that is registered + */ + if (target_info() && !target_specific_class_creatable(oc)) { + continue; + } =20 info =3D g_malloc0(sizeof(*info)); if (mc->is_default) { --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490400; cv=none; d=zohomail.com; s=zohoarc; b=WGyJ9fDEf3F0dp68MNmj25CFS+gxpGFo9bV1Isj2RbcMNSGllZ6g2P3sHIB47XuryAZbePs3KrVoLcYRXogVTeSlIVSs20i6xLj8OUQMlJDdcNZnCZMN0bhLUNc/ghFf+yZN8QLdM5/lf4oYhyy360d8mjr4bilV8bOhLi/GpcE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490400; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=TcsPAP6A9rO42+7PFbjtLt/31ignVRJz/1PtJ6upYDE=; b=F6Il7ViWh7M9YvoDNUskezS0Itgb9vwdUDr0XOqCrbEWhq/VGQZ92YwAuse6wbn53yl6wIfDdPB+N5b8WdPgSwN7xzzz/JvKJqC0Y50kMUUvLTv94JNBGuyS7txh5e+7JJFCe1kJLZyvO73u+8pIOKe3BtzeHmA8hWNjABPAX0E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490400518283.0315937741434; Thu, 12 Nov 2026 05:33:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUv0-0006me-5S; Thu, 12 Nov 2026 08:32:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuR-0006Vo-1r for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:16 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuN-0004u3-O5 for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:09 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-558-lRhHEQErM-yndS6aWiNGhg-1; Thu, 12 Nov 2026 08:31:58 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B654D1956088; Thu, 12 Nov 2026 13:31:57 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4C6131956089; Thu, 12 Nov 2026 13:31:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490327; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TcsPAP6A9rO42+7PFbjtLt/31ignVRJz/1PtJ6upYDE=; b=RCa+ii7FiRoCpZdSML05czfX9fq9TZf6StX2Xs7lYqxF0/8igNX8rvqZPQZXFxpOF8SuO9 8fU81z66BRZ7Dc3wO+mE0aj9ZY9xmwnSH8BYr5ww0GQ3OhWKCGXdJSmFXQ0PqsjwP+AM09 BoUcMGDhGrjYB3iRYCpOT2gHzBnpKsQ= X-MC-Unique: lRhHEQErM-yndS6aWiNGhg-1 X-Mimecast-MFC-AGG-ID: lRhHEQErM-yndS6aWiNGhg_1794490317 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 33/48] system: filter machines based on target during creation Date: Thu, 12 Nov 2026 13:30:39 +0000 Message-ID: <20261112133054.1977618-34-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490402979158500 When creating a machine instance, validate that it is creatable on the current selected target. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- system/vl.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/system/vl.c b/system/vl.c index 0afcc18866d..ca10e193f2b 100644 --- a/system/vl.c +++ b/system/vl.c @@ -845,16 +845,21 @@ static bool usb_parse(const char *cmdline, Error **er= rp) /* machine registration */ =20 static ObjectClass *find_machine(const char *name, GSList *machines, - Error **errp) + bool creatable, Error **errp) { GSList *el; g_autofree char *typename =3D NULL; =20 for (el =3D machines; el; el =3D el->next) { - MachineClass *mc =3D el->data; + ObjectClass *oc =3D el->data; + MachineClass *mc =3D MACHINE_CLASS(oc); =20 if (!strcmp(mc->name, name)) { - return OBJECT_CLASS(mc); + if (creatable) { + return target_specific_class_check(oc, errp); + } else { + return oc; + } } } =20 @@ -1551,7 +1556,8 @@ static void machine_help_func(const QDict *qdict) machines =3D object_class_get_list(TYPE_MACHINE, false); if (type) { Error *local_err =3D NULL; - ObjectClass *machine_class =3D find_machine(type, machines, &local= _err); + ObjectClass *machine_class =3D + find_machine(type, machines, false, &local_err); if (local_err) { error_report_err(local_err); return; @@ -1697,7 +1703,7 @@ static MachineClass *select_machine(QDict *qdict, Err= or **errp) =20 if (machine_type) { machine_class =3D MACHINE_CLASS( - find_machine(machine_type, machines, errp)); + find_machine(machine_type, machines, true, errp)); qdict_del(qdict, "type"); } else { machine_class =3D find_default_machine(machines); --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490749; cv=none; d=zohomail.com; s=zohoarc; b=NwtbVGMqYBhFXUM1Tw1fFGYSwhwTFU/J+11Q29QLpbcpftsVPr0tNa9n71dFOXyA7QBZjnYHy2AX1h3YSVKWs+feItGlyky3M5DUsCpohhEQwRzlMWUp8yd1xbIgmGoQ31pMx8OWJ6TJboE/f32P5LZdvsKere6fu+w4KCrfQBM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490749; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=OUkhrELjno0jvN18+8TXoP/WwzEEOsXInQfffIKOUos=; b=FfmAecZRzwJd+v60dOjDlN8RxB9t6lluootdp3p5TR7XTN/wpMJj9TjTyOlthfXFVdripc4BB7jFtwJwJCSNqYEzfJzu4ALp6STeiL66DXOe9ytiCWEUoG7fvh1VsDvN6gd9bLogNW6oYqmjA/ibuDf5SOe9OCPYf9alGHOV0Mw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 179449074971656.21222161772516; Thu, 12 Nov 2026 05:39:09 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUy4-0004YK-9g; Thu, 12 Nov 2026 08:35:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuM-0006I1-Du for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:12 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuK-0004gU-V7 for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:06 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-253-KvBU6qcIO1OgL9-70UMGTw-1; Thu, 12 Nov 2026 08:32:00 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 85A3618005A9; Thu, 12 Nov 2026 13:31:59 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 11FC01956089; Thu, 12 Nov 2026 13:31:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490324; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OUkhrELjno0jvN18+8TXoP/WwzEEOsXInQfffIKOUos=; b=NdVPmnaSttEq6tWXgxE31ugoDgPvcQ3c0Qo+qsDkrpWzAnF/QlwA7Ck0HThn7mBCupDDm9 R1nbAXjMEnpdSH6mHKKvEOAT3F4k9qmSqGzDcYG1sVa6nU9e5GT5a59HcLRGeBdxgubrfb +8rGJzMsr5UwJI7cralcHEKhX4wh6pk= X-MC-Unique: KvBU6qcIO1OgL9-70UMGTw-1 X-Mimecast-MFC-AGG-ID: KvBU6qcIO1OgL9-70UMGTw_1794490319 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 34/48] hw/core: implement TYPE_TARGET_SPECIFIC for machine Date: Thu, 12 Nov 2026 13:30:40 +0000 Message-ID: <20261112133054.1977618-35-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490750402158500 The Machine base class implements TYPE_TARGET_SPECIFIC since its children will almost all be target specific. When the 'targets' field is set to a non-zero value on a machine type, it will block creation of an instance of the machine unless the current selected target matches. This allows the current 'is_available' callback to be removed. Eventually only the 'none' machine is likely to leave the 'targets' field set to 0, since it is universally creatable. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- hw/core/machine.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/core/machine.c b/hw/core/machine.c index f7406537aa7..8692365ce89 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -1804,6 +1804,7 @@ static const TypeInfo machine_info =3D { .instance_finalize =3D machine_finalize, .interfaces =3D (const InterfaceInfo[]) { { TYPE_ALIASED }, + { TYPE_TARGET_SPECIFIC }, { } } }; --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490588; cv=none; d=zohomail.com; s=zohoarc; b=HxtsFMEoiDnhyHexuQLmnU1srlIGb6kYxX71OzakG3WOFb1IBS2yp6eh7EbmaS0TlieHYQt09CndBnGE02guW6nEVdyGhtZhy+Gxaq4vY3LDdyviA4mTzisQn1ycldxFFHF39BD9boK371eIo5KfVYrnvmvXF5FpWwPOzGzCU/I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490588; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=t+jvx/g9Fv4ivlDi/r8tlnWzF5Ht/Ad9ZDkBPfoHn90=; b=eUvjJMufPT0gIFZ8JkfaDE1fPkN/GeKqELuCL6KYlIwXwP6lO/h6P1utTf8uC9wUQLsMM2Cngy4bYtwH/d/6K0bkV3ZRnqfg32oJxAjluxkowUA0cn9TscUlQA+cNuMLc+gZ/Vc+BDiHFXHLIm8gF6CUAHz2JDxkijtwD9u5F1o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490588656879.8940604282533; Thu, 12 Nov 2026 05:36:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUvU-0007RG-5k; Thu, 12 Nov 2026 08:33:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuO-0006OK-EM for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:12 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuM-0004pW-JS for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:08 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-658-FDXSZJvOO8mdlGcQFRaBrA-1; Thu, 12 Nov 2026 08:32:02 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4CC3C1800634; Thu, 12 Nov 2026 13:32:01 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D62F21956089; Thu, 12 Nov 2026 13:31:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t+jvx/g9Fv4ivlDi/r8tlnWzF5Ht/Ad9ZDkBPfoHn90=; b=VXu1xvs0/MmjuJt/K6GEPnFgZ6aELnototyPYnBMLf2ycr+qu0906lwWDqODllyhpC6IMW X/KOp9tEQyDG3WlnzQLgbT6rHM2Y/uTpXcYaxJO7sp1c1nxE74N2k9TwWVVaSXhy0gIUBq D/6H33RoDyRgEH44yvqcnFRhNqmT0q4= X-MC-Unique: FDXSZJvOO8mdlGcQFRaBrA-1 X-Mimecast-MFC-AGG-ID: FDXSZJvOO8mdlGcQFRaBrA_1794490321 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 35/48] qapi: report target compatibility for machine types Date: Thu, 12 Nov 2026 13:30:41 +0000 Message-ID: <20261112133054.1977618-36-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490589864158500 Add a 'targets' field to MachineInfo which is populated with the list of targets a machine is declard to be compatible with. To avoid reporting redundant information for the traditional per-target emulator binaries, this new field is only emitted if no target is currently selected, or the 'all-targets' flag is explicitly set. Signed-off-by: Daniel P. Berrang=C3=A9 --- hw/core/machine-qmp-cmds.c | 18 ++++++++++++++++++ qapi/machine.json | 12 +++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index 3f06ce8c75f..39624e91139 100644 --- a/hw/core/machine-qmp-cmds.c +++ b/hw/core/machine-qmp-cmds.c @@ -35,6 +35,7 @@ #include "hw/s390x/storage-keys.h" #include "qom/object_interfaces.h" #include "qemu/target-info-def.h" +#include "qemu/base-arch-defs.h" =20 /* * QMP query for enabled and present accelerators @@ -155,11 +156,16 @@ qmp_query_cpu_model_expansion(CpuModelExpansionType t= ype, } =20 MachineInfoList *qmp_query_machines(bool has_compat_props, bool compat_pro= ps, + bool has_all_targets, bool all_targets, Error **errp) { GSList *el, *machines; MachineInfoList *mach_list =3D NULL; =20 + if (target_mask_selected() =3D=3D QEMU_ARCH_ALL) { + all_targets =3D true; + } + machines =3D object_class_get_list(TYPE_MACHINE, false); for (el =3D machines; el; el =3D el->next) { ObjectClass *oc =3D el->data; @@ -167,6 +173,7 @@ MachineInfoList *qmp_query_machines(bool has_compat_pro= ps, bool compat_props, const char *default_cpu_type =3D machine_class_default_cpu_type(mc= ); MachineInfo *info; AliasedClass *alc =3D ALIASED_CLASS(oc); + TargetSpecificClass *tsc =3D TARGET_SPECIFIC_CLASS(oc); =20 /* * If we've selected a specific target, then filter @@ -202,6 +209,17 @@ MachineInfoList *qmp_query_machines(bool has_compat_pr= ops, bool compat_props, info->alias =3D g_strndup(alc->aliases[0], len); } =20 + if (tsc->targets && all_targets) { + SysEmuTargetList **targets =3D &info->targets; + size_t i; + info->has_targets =3D true; + for (i =3D 0; i < SYS_EMU_TARGET__MAX; i++) { + if (tsc->targets & QEMU_ARCH_BIT(i)) { + QAPI_LIST_APPEND(targets, i); + } + } + } + info->name =3D g_strdup(mc->name); info->cpu_max =3D !mc->max_cpus ? 1 : mc->max_cpus; info->hotpluggable_cpus =3D mc->has_hotpluggable_cpus; diff --git a/qapi/machine.json b/qapi/machine.json index 40fda705462..c3b3cce7e48 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -165,6 +165,11 @@ # # @aliases: a list of aliases for the machine type name (since 12.0) # +# @targets: a list of compatible targets for the machine (since 12.0) +# This is only reported if no target is currently selected +# for the binary, or if the `query-machines` argument +# @all-targets is true. +# # @is-default: whether the machine is default # # @cpu-max: maximum number of CPUs supported by the machine type @@ -207,6 +212,7 @@ 'data': { 'name': 'str', '*alias': { 'type': 'str', 'features': ['deprecated'] }, '*aliases': ['str'], + '*targets': ['SysEmuTarget'], '*is-default': 'bool', 'cpu-max': 'int', 'hotpluggable-cpus': 'bool', 'numa-mem-supported': 'bool', 'deprecated': 'bool', '*default-cpu-type': 'str', @@ -222,6 +228,9 @@ # @compat-props: if true, also return compatibility properties. # (default: false) (since 9.1) # +# @all-targets: if true, report all available targets even +# when a target is selected (default: false) (since 12.0) +# # Features: # # @unstable: Argument @compat-props is experimental. @@ -253,7 +262,8 @@ ## { 'command': 'query-machines', 'data': { '*compat-props': { 'type': 'bool', - 'features': [ 'unstable' ] } }, + 'features': [ 'unstable' ] }, + '*all-targets': 'bool' }, 'returns': ['MachineInfo'] } =20 ## --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490585; cv=none; d=zohomail.com; s=zohoarc; b=Zgn953o9P2g93LnMm6CZa3Bx8xlKrtLrlIFq43zaKX2MUd62UOgi5arOOMmgRhRSUiLqTmevWMKd0BypWcb9KCmj6NBWNCSv8pgEDd6jhSuQnzhr0PhF+wDvWe60bRcDdM3LDBcKfT4PBaciHzmZVMwdfOMbovtGJJciUNoB9ys= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490585; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qReHvqPGmVsZymreTUo3l6q3Hxvodm/KyscqrOLrz2s=; b=MdQ8CgWddHVOn+pqwV/avNZK+AgTr8JHYjVD0yCfE+QBeHb7CD4ni9etgwJmgvFUgWBBrICqNNFjaeCAm4/KJbAFy9dVZiH1WcwsUDOsCcQSUnfSFjerLXvMbmsjZjjgiX/mIqoIzP4ZiDW2ptA2QRCb/fx+bCfWEbIX8HjK2Ts= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490585703631.8873660243593; Thu, 12 Nov 2026 05:36:25 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUvY-0007rJ-Ed; Thu, 12 Nov 2026 08:33:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUua-0006ck-Iz for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:22 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuW-0005Xs-QP for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:18 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-662-kErDBi6GOV-RXoUr_QMZfA-1; Thu, 12 Nov 2026 08:32:04 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2AADA18F4744; Thu, 12 Nov 2026 13:32:03 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9C71C1956087; Thu, 12 Nov 2026 13:32:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490336; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qReHvqPGmVsZymreTUo3l6q3Hxvodm/KyscqrOLrz2s=; b=OCR8SjI8R0xtDrYcpYFNeL9YFjto1z7xxSy/E2oG9GSPk8gg5Gl8KlFEWeGudoQMOd3H1t uADbZ+1d8lzi/A/rXNiFuvVvxZouHu3qIwThAsGGTs6su6iiL9pYW9A6Mk4DvljnwSDJrC lXUMa79gIwUha3H1zZNVIw7C9fZ8HTw= X-MC-Unique: kErDBi6GOV-RXoUr_QMZfA-1 X-Mimecast-MFC-AGG-ID: kErDBi6GOV-RXoUr_QMZfA_1794490323 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 36/48] hw/arm: declare arm machine targets Date: Thu, 12 Nov 2026 13:30:42 +0000 Message-ID: <20261112133054.1977618-37-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490587867158500 This prevents creation of arm machines unless the current selected target is arm and enables removal of the 'is_available' callback. Signed-off-by: Daniel P. Berrang=C3=A9 --- hw/arm/aspeed_ast27x0-fc.c | 5 ++++- hw/arm/aspeed_ast27x0_evb.c | 7 +++++-- hw/arm/raspi.c | 9 ++++++--- hw/arm/raspi4b.c | 6 ++++-- hw/arm/virt.c | 6 ++++-- 5 files changed, 23 insertions(+), 10 deletions(-) diff --git a/hw/arm/aspeed_ast27x0-fc.c b/hw/arm/aspeed_ast27x0-fc.c index 73362b60d2a..b0d2fc091d0 100644 --- a/hw/arm/aspeed_ast27x0-fc.c +++ b/hw/arm/aspeed_ast27x0-fc.c @@ -22,6 +22,8 @@ #include "hw/arm/boot.h" #include "hw/block/flash.h" #include "hw/arm/aspeed_coprocessor.h" +#include "qom/object_interfaces.h" +#include "qemu/base-arch-defs.h" =20 #define TYPE_AST2700FC MACHINE_TYPE_NAME("ast2700fc") OBJECT_DECLARE_SIMPLE_TYPE(Ast2700FCState, AST2700FC); @@ -220,12 +222,14 @@ static void ast2700fc_init(MachineState *machine) static void ast2700fc_class_init(ObjectClass *oc, const void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); + TargetSpecificClass *tsc =3D TARGET_SPECIFIC_CLASS(oc); =20 mc->desc =3D "ast2700 full core support"; mc->init =3D ast2700fc_init; mc->no_floppy =3D 1; mc->no_cdrom =3D 1; mc->min_cpus =3D mc->max_cpus =3D mc->default_cpus =3D 6; + tsc->targets =3D QEMU_ARCH_BIT(SYS_EMU_TARGET_AARCH64); } =20 static const TypeInfo ast2700fc_types[] =3D { @@ -234,7 +238,6 @@ static const TypeInfo ast2700fc_types[] =3D { .parent =3D TYPE_MACHINE, .class_init =3D ast2700fc_class_init, .instance_size =3D sizeof(Ast2700FCState), - .is_available =3D target_aarch64, }, }; =20 diff --git a/hw/arm/aspeed_ast27x0_evb.c b/hw/arm/aspeed_ast27x0_evb.c index 9f7d4395114..d698bb25833 100644 --- a/hw/arm/aspeed_ast27x0_evb.c +++ b/hw/arm/aspeed_ast27x0_evb.c @@ -12,6 +12,7 @@ #include "hw/arm/aspeed_soc.h" #include "hw/sensor/tmp105.h" #include "qom/object_interfaces.h" +#include "qemu/base-arch-defs.h" =20 /* AST2700 evb hardware value */ /* SCU HW Strap1 */ @@ -33,7 +34,9 @@ static void aspeed_machine_ast2700a1_evb_class_init(Objec= tClass *oc, { MachineClass *mc =3D MACHINE_CLASS(oc); AspeedMachineClass *amc =3D ASPEED_MACHINE_CLASS(oc); + TargetSpecificClass *tsc =3D TARGET_SPECIFIC_CLASS(oc); =20 + tsc->targets =3D QEMU_ARCH_BIT(SYS_EMU_TARGET_AARCH64); mc->desc =3D "Aspeed AST2700 A1 EVB (Cortex-A35)"; amc->soc_name =3D "ast2700-a1"; amc->hw_strap1 =3D AST2700_EVB_HW_STRAP1; @@ -55,11 +58,13 @@ static void aspeed_machine_ast2700a2_evb_class_init(Obj= ectClass *oc, MachineClass *mc =3D MACHINE_CLASS(oc); AspeedMachineClass *amc =3D ASPEED_MACHINE_CLASS(oc); AliasedClass *alc =3D ALIASED_CLASS(oc); + TargetSpecificClass *tsc =3D TARGET_SPECIFIC_CLASS(oc); static const char *const aliases[] =3D { MACHINE_TYPE_NAME("ast2700-evb"), NULL, }; =20 alc->aliases =3D aliases; + tsc->targets =3D QEMU_ARCH_BIT(SYS_EMU_TARGET_AARCH64); mc->desc =3D "Aspeed AST2700 A2 EVB (Cortex-A35)"; amc->soc_name =3D "ast2700-a2"; amc->hw_strap1 =3D AST2700_EVB_HW_STRAP1; @@ -80,13 +85,11 @@ static const TypeInfo aspeed_ast27x0_evb_types[] =3D { .name =3D MACHINE_TYPE_NAME("ast2700a1-evb"), .parent =3D TYPE_ASPEED_MACHINE, .class_init =3D aspeed_machine_ast2700a1_evb_class_init, - .is_available =3D target_aarch64, }, { .name =3D MACHINE_TYPE_NAME("ast2700a2-evb"), .parent =3D TYPE_ASPEED_MACHINE, .class_init =3D aspeed_machine_ast2700a2_evb_class_init, - .is_available =3D target_aarch64, } }; =20 diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c index fadbacb2534..b9b79942d29 100644 --- a/hw/arm/raspi.c +++ b/hw/arm/raspi.c @@ -24,7 +24,8 @@ #include "qemu/error-report.h" #include "hw/core/boards.h" #include "hw/core/loader.h" -#include "qom/object.h" +#include "qom/object_interfaces.h" +#include "qemu/base-arch-defs.h" =20 #define TYPE_RASPI_MACHINE MACHINE_TYPE_NAME("raspi-common") OBJECT_DECLARE_SIMPLE_TYPE(RaspiMachineState, RASPI_MACHINE) @@ -370,9 +371,11 @@ static void raspi3ap_machine_class_init(ObjectClass *o= c, const void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); RaspiBaseMachineClass *rmc =3D RASPI_BASE_MACHINE_CLASS(oc); + TargetSpecificClass *tsc =3D TARGET_SPECIFIC_CLASS(oc); =20 mc->auto_create_sdcard =3D true; rmc->board_rev =3D 0x9020e0; /* Revision 1.0 */ + tsc->targets =3D QEMU_ARCH_BIT(SYS_EMU_TARGET_AARCH64); raspi_machine_class_init(mc, rmc->board_rev); }; =20 @@ -380,9 +383,11 @@ static void raspi3b_machine_class_init(ObjectClass *oc= , const void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); RaspiBaseMachineClass *rmc =3D RASPI_BASE_MACHINE_CLASS(oc); + TargetSpecificClass *tsc =3D TARGET_SPECIFIC_CLASS(oc); =20 mc->auto_create_sdcard =3D true; rmc->board_rev =3D 0xa02082; + tsc->targets =3D QEMU_ARCH_BIT(SYS_EMU_TARGET_AARCH64); raspi_machine_class_init(mc, rmc->board_rev); }; =20 @@ -403,12 +408,10 @@ static const TypeInfo raspi_machine_types[] =3D { .name =3D MACHINE_TYPE_NAME("raspi3ap"), .parent =3D TYPE_RASPI_MACHINE, .class_init =3D raspi3ap_machine_class_init, - .is_available =3D target_aarch64, }, { .name =3D MACHINE_TYPE_NAME("raspi3b"), .parent =3D TYPE_RASPI_MACHINE, .class_init =3D raspi3b_machine_class_init, - .is_available =3D target_aarch64, }, { .name =3D TYPE_RASPI_MACHINE, .parent =3D TYPE_RASPI_BASE_MACHINE, diff --git a/hw/arm/raspi4b.c b/hw/arm/raspi4b.c index 600dfe686f2..69048f8b4a3 100644 --- a/hw/arm/raspi4b.c +++ b/hw/arm/raspi4b.c @@ -19,8 +19,9 @@ #include "hw/core/boards.h" #include "hw/core/loader.h" #include "hw/arm/boot.h" -#include "qom/object.h" +#include "qom/object_interfaces.h" #include "hw/arm/bcm2838.h" +#include "qemu/base-arch-defs.h" #include =20 #define TYPE_RASPI4B_MACHINE MACHINE_TYPE_NAME("raspi4b") @@ -88,11 +89,13 @@ static void raspi4b_machine_class_init(ObjectClass *oc,= const void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); RaspiBaseMachineClass *rmc =3D RASPI_BASE_MACHINE_CLASS(oc); + TargetSpecificClass *tsc =3D TARGET_SPECIFIC_CLASS(oc); =20 rmc->board_rev =3D 0xb03115; /* Revision 1.5, 2 Gb RAM */ raspi_machine_class_common_init(mc, rmc->board_rev); mc->auto_create_sdcard =3D true; mc->init =3D raspi4b_machine_init; + tsc->targets =3D QEMU_ARCH_BIT(SYS_EMU_TARGET_AARCH64); } =20 static const TypeInfo raspi4b_machine_type =3D { @@ -100,7 +103,6 @@ static const TypeInfo raspi4b_machine_type =3D { .parent =3D TYPE_RASPI_BASE_MACHINE, .instance_size =3D sizeof(Raspi4bMachineState), .class_init =3D raspi4b_machine_class_init, - .is_available =3D target_aarch64, }; =20 static void raspi4b_machine_register_type(void) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 6217771032e..ca5cd3c16b8 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -95,6 +95,7 @@ #include "qemu/guest-random.h" #include "hw/watchdog/sbsa_gwdt.h" #include "qom/object_interfaces.h" +#include "qemu/base-arch-defs.h" =20 static GlobalProperty arm_virt_compat_defaults[] =3D { { TYPE_VIRTIO_IOMMU_PCI, "aw-bits", "48" }, @@ -119,10 +120,13 @@ static void arm_virt_compat_default_set(MachineClass = *mc) const void *data) \ { \ MachineClass *mc =3D MACHINE_CLASS(oc); \ + TargetSpecificClass *tsc =3D TARGET_SPECIFIC_CLASS(oc); \ arm_virt_compat_default_set(mc); \ MACHINE_VER_SYM(options, virt, __VA_ARGS__)(mc); \ mc->desc =3D "QEMU " MACHINE_VER_STR(__VA_ARGS__) " ARM Virtual Ma= chine"; \ MACHINE_VER_DEPRECATION(__VA_ARGS__); \ + tsc->targets =3D QEMU_ARCH_BIT(SYS_EMU_TARGET_ARM) | \ + QEMU_ARCH_BIT(SYS_EMU_TARGET_AARCH64); \ classinitextra \ } \ static const TypeInfo MACHINE_VER_SYM(info, virt, __VA_ARGS__) =3D \ @@ -130,7 +134,6 @@ static void arm_virt_compat_default_set(MachineClass *m= c) .name =3D MACHINE_VER_TYPE_NAME("arm-virt", __VA_ARGS__), \ .parent =3D TYPE_VIRT_MACHINE, \ .class_init =3D MACHINE_VER_SYM(class_init, virt, __VA_ARGS__), \ - .is_available =3D target_base_arm, \ .secure =3D true, \ }; \ static void MACHINE_VER_SYM(register, virt, __VA_ARGS__)(void) \ @@ -4467,7 +4470,6 @@ static const TypeInfo virt_machine_info =3D { { TYPE_HOTPLUG_HANDLER }, { } }, - .is_available =3D target_base_arm, }; =20 static void machvirt_machine_init(void) --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490716; cv=none; d=zohomail.com; s=zohoarc; b=GSIpOskenA72N1H1O0RFQ8/19cnPC0UNHcB4XRVSdQ53FsvDo7wxbFDt7of7HyMSRnBrA04otXZ8KWeCsxH18M530yINNMdJYgLcdsleGLApKJ0GVBgb2uGjIF20uXSb9Y22ZtOavPEr4mTMh8Mgp6X8he7sLbFFNcaJUwp0510= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490716; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=dJ37mOm3w63NLIJTgGwQZMTK8fRNMHeZYly/W1BuQJ0=; b=W0b8ajDmbS5ecj7ismgc98Hjn10ytUpZ9MazTNhRJfsc3PVgTx5uUhpmTId1TAAd33a8j8ilvv3We/K5Qk/KTg1iteC0vbNKd8Rrm7le8eWMYyiU6xleXOsuGLHdhI4Q3hhNjSyUIM529cpddSxyASf1QOQJcTx2sOIxAzo8A3I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490716250591.0733395234421; Thu, 12 Nov 2026 05:38:36 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUvK-0007I1-D4; Thu, 12 Nov 2026 08:33:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuR-0006Vp-2H for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:16 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuP-0004zI-4Y for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:10 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-680-DU01dR82OkCS-HNo6Zo1MA-1; Thu, 12 Nov 2026 08:32:05 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D19A31956045; Thu, 12 Nov 2026 13:32:04 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 64F541956089; Thu, 12 Nov 2026 13:32:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490328; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dJ37mOm3w63NLIJTgGwQZMTK8fRNMHeZYly/W1BuQJ0=; b=ExdP78adiomHmvuzAjfXjAOTo1ifDO0zLtqkljgZDA+mMhB2DNer92uN4NDW0kSojMphU7 lzrZW+uDidHfQTZ0encbTpoTW6Wt/BX0zrzWfnh36gkrd/VjYvAHL0kFM9aukPk/9zDZGU pWjXtPQkMq0E6r2rriGKsFo3BqE8/Io= X-MC-Unique: DU01dR82OkCS-HNo6Zo1MA-1 X-Mimecast-MFC-AGG-ID: DU01dR82OkCS-HNo6Zo1MA_1794490324 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 37/48] hw/hexagon: declare hexagon machine target Date: Thu, 12 Nov 2026 13:30:43 +0000 Message-ID: <20261112133054.1977618-38-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490717872158500 This prevents creation of hexagon machines unless the current selected target is hexagon and enables removal of the 'is_available' callback. Signed-off-by: Daniel P. Berrang=C3=A9 --- hw/hexagon/virt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/hexagon/virt.c b/hw/hexagon/virt.c index 645a3146810..f376f360a89 100644 --- a/hw/hexagon/virt.c +++ b/hw/hexagon/virt.c @@ -20,6 +20,7 @@ #include "machine_cfg_v68n_1024.h.inc" #include "system/device_tree.h" #include "qom/object_interfaces.h" +#include "qemu/base-arch-defs.h" =20 enum { VIRT_UART0, @@ -141,11 +142,14 @@ static void virt_class_init(ObjectClass *oc, const vo= id *data) { MachineClass *mc =3D MACHINE_CLASS(oc); AliasedClass *alc =3D ALIASED_CLASS(mc); + TargetSpecificClass *tsc =3D TARGET_SPECIFIC_CLASS(oc); static const char *const aliases[] =3D { MACHINE_TYPE_NAME("virt"), NULL, }; =20 alc->aliases =3D aliases; + tsc->targets =3D QEMU_ARCH_BIT(SYS_EMU_TARGET_HEXAGON); + mc->desc =3D "Hexagon Virtual Machine"; mc->init =3D virt_init; mc->default_cpu_type =3D HEXAGON_CPU_TYPE_NAME("v68"); @@ -167,7 +171,6 @@ static const TypeInfo virt_machine_types[] =3D { { .parent =3D TYPE_HEXAGON_COMMON_MACHINE, .instance_size =3D sizeof(HexagonVirtMachineState), .class_init =3D virt_class_init, - .is_available =3D target_hexagon, } }; =20 DEFINE_TYPES(virt_machine_types) --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490593; cv=none; d=zohomail.com; s=zohoarc; b=X4HhJ3bbo1hOBHWTpz7G7GUSZ7xU4l44AFVkypbAsVSvMmoj81Ckzobhn22RSpchlEOucayf3O1LqTf6oHlJCjx29nZQH8lzXZ4frxqM23Sj8eiS2XelBJxDvghG2IL780/HnAmNJowgVQ18wudKhLwW8jQt01KXkUraZAH+3E8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490593; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=WpX9gUTs9zKinxRBubIpggvO6RcjccBXAJw3aHpEbEU=; b=d6TtBjln2W5q+KMEM5ERj1yk735Ki0dOaupgXN+c5pUUejbWCeB25BcbcY/l3jVjfLxXmy+VdE1E8oiUw5SjZn8rbJmWhRcdbF/yCOx9lq5j+H4lSZ8WY6Q2WubSyZ8//cs3RKpUZL3bmd/KgSoIZZrKnwDeLILHVOxsW4WXDiw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490593503107.44540496736101; Thu, 12 Nov 2026 05:36:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUxw-0003kK-Ck; Thu, 12 Nov 2026 08:35:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuT-0006WF-5n for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:18 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuR-0005A2-Lj for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:12 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-1-5NYCtfJjOQ6nrRDwRh2VLA-1; Thu, 12 Nov 2026 08:32:08 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7951818974F7; Thu, 12 Nov 2026 13:32:07 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2D2D91956087; Thu, 12 Nov 2026 13:32:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490331; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WpX9gUTs9zKinxRBubIpggvO6RcjccBXAJw3aHpEbEU=; b=fdpND/3hLB1ejR/RwqM5xUE0uh5t8v9oHhhFZGRdYMaxmvxtQn/z8Vj/y82NOXWmx43ykw oOPfcsE8AyiX7rg67inr0aJalaJvXxIutenxKFugF2rjRG6gu1QGFEz57vx2U4ZZJFXDvv 5VHJNQ7dfWMdoIvuZ4ATC9upfEhbLnk= X-MC-Unique: 5NYCtfJjOQ6nrRDwRh2VLA-1 X-Mimecast-MFC-AGG-ID: 5NYCtfJjOQ6nrRDwRh2VLA_1794490327 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 38/48] hw/m68k: declare m68k machine target Date: Thu, 12 Nov 2026 13:30:44 +0000 Message-ID: <20261112133054.1977618-39-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490593939158500 This prevents creation of m68k machines unless the current selected target is m68k and enables removal of the 'is_available' callback. Signed-off-by: Daniel P. Berrang=C3=A9 --- hw/m68k/virt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/m68k/virt.c b/hw/m68k/virt.c index 398293144c8..b490d01efc9 100644 --- a/hw/m68k/virt.c +++ b/hw/m68k/virt.c @@ -37,6 +37,7 @@ #include "hw/virtio/virtio-mmio.h" #include "hw/virtio/virtio-blk.h" #include "qom/object_interfaces.h" +#include "qemu/base-arch-defs.h" =20 /* * 6 goldfish-pic for CPU IRQ #1 to IRQ #6 @@ -328,7 +329,6 @@ static const TypeInfo virt_machine_info =3D { .parent =3D TYPE_MACHINE, .abstract =3D true, .class_init =3D virt_machine_class_init, - .is_available =3D target_m68k, }; =20 static void virt_machine_register_types(void) @@ -344,8 +344,10 @@ type_init(virt_machine_register_types) const void *data) \ { \ MachineClass *mc =3D MACHINE_CLASS(oc); \ + TargetSpecificClass *tsc =3D TARGET_SPECIFIC_CLASS(oc); \ MACHINE_VER_SYM(options, virt, __VA_ARGS__)(mc); \ mc->desc =3D "QEMU " MACHINE_VER_STR(__VA_ARGS__) " M68K Virtual M= achine"; \ + tsc->targets =3D QEMU_ARCH_BIT(SYS_EMU_TARGET_M68K); \ MACHINE_VER_DEPRECATION(__VA_ARGS__); \ classinitextra \ } \ @@ -354,7 +356,6 @@ type_init(virt_machine_register_types) .name =3D MACHINE_VER_TYPE_NAME("m68k-virt", __VA_ARGS__), \ .parent =3D MACHINE_TYPE_NAME("m68k-virt"), \ .class_init =3D MACHINE_VER_SYM(class_init, virt, __VA_ARGS__), \ - .is_available =3D target_m68k, \ }; \ static void MACHINE_VER_SYM(register, virt, __VA_ARGS__)(void) \ { \ --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490659; cv=none; d=zohomail.com; s=zohoarc; b=fyMRLj+acf9wd0Ym5N6ZN8MUAR8qJQR1LxUS+yT0mQaoBHs76maAbGlmj1piAnzioN/5u4xaG5TLTV/Zn3h3Pzzw10bGAdB+7ZoLiWS6oaABBGGADhBzYffmu3ojnVvI2BORc9iaUjahiSuPTNDUDY7EECGCv68XcEPusl/LEnk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490659; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=jl0LIOMKo2ndQGouaLSD8XhNi8L5lc6oOVUh9ggZaeQ=; b=C1MURBlQ/5NrNt1UAaB6xNIm0ayadXY0K4R8gD/DBgar3WOtTlNUnf1Uvw9yjWBVRvh7nVExm7LkHybH6XukeWY//517X5amrX3qT9xz5TPdce8Z7UNOLH+WPqqMUDqa9Tn8BYK6iaEqtW9ICH1Cp7+AVe5GzZhai0YwxhFAl1k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490659680950.6189257707429; Thu, 12 Nov 2026 05:37:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUy2-0004Nw-Ui; Thu, 12 Nov 2026 08:35:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuc-0006d2-4D for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:23 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuX-0005bI-LD for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:18 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-133-aeNXaVPrMBiBlBUC3GHb7g-1; Thu, 12 Nov 2026 08:32:10 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 42325180054E; Thu, 12 Nov 2026 13:32:09 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C879A1956087; Thu, 12 Nov 2026 13:32:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490336; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jl0LIOMKo2ndQGouaLSD8XhNi8L5lc6oOVUh9ggZaeQ=; b=cK0Mdw17VmORKFcGn/ckykOsPiPugcaoruCTKWlNJ0g/8OY/XtLU7i/vyqOCmLjUXX9KeB 10lNS0U+SlDi4MFKswh0JjqIN3DkiAn9vw6t9Hy8j4drjN1snCMHeNYTA8KxnxlmhDZ3r5 0nX0FAaAVC7s+snr3WclrHDSi/1bNfI= X-MC-Unique: aeNXaVPrMBiBlBUC3GHb7g-1 X-Mimecast-MFC-AGG-ID: aeNXaVPrMBiBlBUC3GHb7g_1794490329 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 39/48] hw/or1k: declare or1k machine target Date: Thu, 12 Nov 2026 13:30:45 +0000 Message-ID: <20261112133054.1977618-40-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490660875158500 This prevents creation of or1k machines unless the current selected target is or1k and enables removal of the 'is_available' callback. Signed-off-by: Daniel P. Berrang=C3=A9 --- hw/or1k/virt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/or1k/virt.c b/hw/or1k/virt.c index 579acdedfa6..6720467dfe2 100644 --- a/hw/or1k/virt.c +++ b/hw/or1k/virt.c @@ -29,6 +29,7 @@ #include "system/qtest.h" #include "system/reset.h" #include "qom/object_interfaces.h" +#include "qemu/base-arch-defs.h" =20 #include =20 @@ -548,11 +549,13 @@ static void openrisc_virt_machine_init(ObjectClass *o= c, const void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); AliasedClass *alc =3D ALIASED_CLASS(oc); + TargetSpecificClass *tsc =3D TARGET_SPECIFIC_CLASS(oc); static const char *const aliases[] =3D { MACHINE_TYPE_NAME("virt"), NULL, }; =20 alc->aliases =3D aliases; + tsc->targets =3D QEMU_ARCH_BIT(SYS_EMU_TARGET_OR1K); mc->desc =3D "or1k virtual machine"; mc->init =3D openrisc_virt_init; mc->max_cpus =3D VIRT_CPUS_MAX; @@ -565,7 +568,6 @@ static const TypeInfo or1ksim_machine_typeinfo =3D { .parent =3D TYPE_MACHINE, .class_init =3D openrisc_virt_machine_init, .instance_size =3D sizeof(OR1KVirtState), - .is_available =3D target_or1k, }; =20 static void or1ksim_machine_init_register_types(void) --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490612; cv=none; d=zohomail.com; s=zohoarc; b=hGhQKEPPAftBJDa3EKOtyeUPsgN0ySINBEjR32YHjB7gQE4tbMcCo/SIEN3W0paLkHRgGQquW41hqcLaJEr9fdEsCZ1Lqg7M8MX5adJT2N7vKPN9LsfqZ57Okyr4DZCKyLU+8tRIDjm+P88RRloFD1R2GkkNKNOt7dK+t5xC66s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490612; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=RY033q8XnBgYbH8ljmHV2d2lfppy6oZ/3Tecl6HdVmY=; b=DCZdtRS/IefEw7AbpNTaRHEyQjtpBM+QLlbGJVftyZ5GE17pzbYCAPP01yHASkCmVFpUhbgvAOQeSiV0DGLyAfvwThq35vrPdK0sI+8+w/hEb1Sf0D6qHwYPNt/fjk5cs/qxXJmyhR1ATY8s/l4rV8e8SWRxSKB9nfaga1h9Vyg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490612204387.0890889330816; Thu, 12 Nov 2026 05:36:52 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUxs-0003Lr-32; Thu, 12 Nov 2026 08:35:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuX-0006Yn-MD for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:20 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuW-0005UQ-51 for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:17 -0500 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-176-v89rSf11MrynwaSfFkzfcw-1; Thu, 12 Nov 2026 08:32:12 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1E102180060C; Thu, 12 Nov 2026 13:32:11 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 910651956087; Thu, 12 Nov 2026 13:32:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490335; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RY033q8XnBgYbH8ljmHV2d2lfppy6oZ/3Tecl6HdVmY=; b=D82cNKgCnJM6wJkewbvddAVzHDG+9mRKWQb4V4x6UkgB1n8PAzOLG8W9jnbc42Bt6l3aha qrGv9fy0A6rqqsbIWRLcEMRBoOIsJI6IeCF45ASLC+HO0kSUbRbXsoflmaCgJ8Nhw4xNVi oONtrH5pYUU9Za9wDhM1GoygfAT3kBU= X-MC-Unique: v89rSf11MrynwaSfFkzfcw-1 X-Mimecast-MFC-AGG-ID: v89rSf11MrynwaSfFkzfcw_1794490331 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 40/48] hw/riscv: declare riscv machine target Date: Thu, 12 Nov 2026 13:30:46 +0000 Message-ID: <20261112133054.1977618-41-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490614335158500 This prevents creation of riscv machines unless the current selected target is riscv and enables removal of the 'is_available' callback. Signed-off-by: Daniel P. Berrang=C3=A9 --- hw/riscv/virt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 2901f67d796..178b47f4c15 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -62,6 +62,7 @@ #include "hw/virtio/virtio-iommu.h" #include "hw/uefi/var-service-api.h" #include "qom/object_interfaces.h" +#include "qemu/base-arch-defs.h" =20 #include "aia.h" =20 @@ -1125,6 +1126,7 @@ static void virt_machine_class_init(ObjectClass *oc, = const void *data) MachineClass *mc =3D MACHINE_CLASS(oc); HotplugHandlerClass *hc =3D HOTPLUG_HANDLER_CLASS(oc); AliasedClass *alc =3D ALIASED_CLASS(oc); + TargetSpecificClass *tsc =3D TARGET_SPECIFIC_CLASS(oc); static const char *const aliases[] =3D { MACHINE_TYPE_NAME("virt"), NULL, }; @@ -1147,6 +1149,8 @@ static void virt_machine_class_init(ObjectClass *oc, = const void *data) mc->get_hotplug_handler =3D virt_machine_get_hotplug_handler; =20 alc->aliases =3D aliases; + tsc->targets =3D QEMU_ARCH_BIT(SYS_EMU_TARGET_RISCV32) | + QEMU_ARCH_BIT(SYS_EMU_TARGET_RISCV64); =20 hc->plug =3D virt_machine_device_plug_cb; =20 @@ -1202,7 +1206,6 @@ static const TypeInfo virt_machine_typeinfo =3D { .instance_init =3D virt_machine_instance_init, .instance_finalize =3D virt_machine_instance_finalize, .instance_size =3D sizeof(RISCVVirtState), - .is_available =3D target_base_riscv, .interfaces =3D (const InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { } --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490754; cv=none; d=zohomail.com; s=zohoarc; b=D5WpJQtOYr/LN5/ucFC1NTYdPu6tsrBuZIGjGJhk/IJ4mft8EuW8YkaYF/PMK2kUOaMkwcQE6DTx1LzRMq4ry5JAlT6XFaDSZb8jKp2fmcAH4oPOvEBsThBNqls5PlC3H0XREZgDr0EyG3Qt3y07XY16ne+++fr0hPkUpUM6370= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490754; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=4Ip4eAmdj7Y2kMjGzT6/KXoFEkOpGrKno1Cfyl1j+v8=; b=G4077be++INW/72CWJQE4JWD5PZ3MchIK3vdd614H1blbsd4La6dYgMMTX+k5RVvseRABQO9LM9EvmOgD+hcUcpTzt3wLmLEoQjqW91g6s2D3s2aER/M09dt9RelIA9RG7+nlmR9gLdAop53XqD6sDjTslB0MT1Zr0ZCujDNZj4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490754568327.99660053245555; Thu, 12 Nov 2026 05:39:14 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUy1-0004Cm-IU; Thu, 12 Nov 2026 08:35:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUue-0006fm-56 for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:25 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuY-0005eD-A2 for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:22 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-347-d6yODwcKM2ae9wdO6KKSFg-1; Thu, 12 Nov 2026 08:32:13 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C28E118F4744; Thu, 12 Nov 2026 13:32:12 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 582311956087; Thu, 12 Nov 2026 13:32:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490337; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4Ip4eAmdj7Y2kMjGzT6/KXoFEkOpGrKno1Cfyl1j+v8=; b=feqS7LZ1uWVU5foElQjalfYxNx4fBKHg1hoPSAoLg2THKDeejw+Md+IB2mY/LFmwqjp/9l RbAaR8whTAEqyRrufBYDAczQRx9MG33YPWeb/84K23kR5lJUzFeniK3RF4V50AZsQ8ik71 30Ah9jXPeEBsfRrDWsajMIUXNvXYzzk= X-MC-Unique: d6yODwcKM2ae9wdO6KKSFg-1 X-Mimecast-MFC-AGG-ID: d6yODwcKM2ae9wdO6KKSFg_1794490332 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 41/48] accel: make TYPE_ACCEL_CPU name target independent Date: Thu, 12 Nov 2026 13:30:47 +0000 Message-ID: <20261112133054.1977618-42-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490756544158500 The TYPE_ACCEL_CPU QOM type name currently expands to a dynamic string based on the target CPU resolving type name. So we have a hierarchy that looks like: object +- accel-{x86_64,ppc64,riscv64,...}-cpu +- kvm-accel-x86_64-cpu +- tcg-accel-x86_64-cpu +- mshv-accel-x86_64-cpu +- tcg-accel-riscv-cpu where the middle class changes its name at runtime, so if leaf CPU classes from different targets are linked together, their immediate parent will be missing unless the selected target matches. The TYPE_ACCEL_CPU class is an abstract base class that does not inherantly have target specific logic. It is expected to be subclassed with children from different targets, and only those childrenneed to have names derived from the CPU resolving type name to ensure unique QOM naming. IOW, TYPE_ACCEL_CPU can be given a fixed name while keeping the same hierarchy structure: object +- accel-cpu +- kvm-accel-x86_64-cpu +- tcg-accel-x86_64-cpu +- mshv-accel-x86_64-cpu +- tcg-accel-riscv-cpu Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- accel/accel-common.c | 3 +-- include/accel/accel-cpu-target.h | 3 +-- include/accel/accel-cpu.h | 2 ++ 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/accel/accel-common.c b/accel/accel-common.c index 00a400243f0..05b1c44e1ed 100644 --- a/accel/accel-common.c +++ b/accel/accel-common.c @@ -132,9 +132,8 @@ DEFINE_TYPES(accel_types) =20 static void register_accel_target_type(void) { - g_autofree char *name =3D g_strconcat("accel-", target_cpu_type(), NUL= L); const TypeInfo accel_cpu_type =3D { - .name =3D name, + .name =3D TYPE_ACCEL_CPU, .parent =3D TYPE_OBJECT, .abstract =3D true, .class_size =3D sizeof(AccelCPUClass), diff --git a/include/accel/accel-cpu-target.h b/include/accel/accel-cpu-tar= get.h index 6feb344e29b..cf33ebd79fc 100644 --- a/include/accel/accel-cpu-target.h +++ b/include/accel/accel-cpu-target.h @@ -24,8 +24,7 @@ #include "accel/accel-cpu.h" #include "cpu.h" =20 -#define TYPE_ACCEL_CPU "accel-" CPU_RESOLVING_TYPE -#define ACCEL_CPU_NAME(name) (name "-" TYPE_ACCEL_CPU) +#define ACCEL_CPU_NAME(name) (name "-accel-" CPU_RESOLVING_TYPE) DECLARE_CLASS_CHECKERS(AccelCPUClass, ACCEL_CPU, TYPE_ACCEL_CPU) =20 #endif /* ACCEL_CPU_H */ diff --git a/include/accel/accel-cpu.h b/include/accel/accel-cpu.h index 9e7eede7c3c..809b7d21fd3 100644 --- a/include/accel/accel-cpu.h +++ b/include/accel/accel-cpu.h @@ -20,4 +20,6 @@ typedef struct AccelCPUClass { bool (*cpu_target_realize)(CPUState *cpu, Error **errp); } AccelCPUClass; =20 +#define TYPE_ACCEL_CPU "accel-cpu" + #endif /* ACCEL_CPU_H */ --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490536; cv=none; d=zohomail.com; s=zohoarc; b=btvqBnZEw53cCU0raZ2vyUQ6UUvCw9jJO7PGWYX9r6rcQ18Prh1lteSZeqqCmqQkIQAijGuSyu/ng6vqGcnRoHRO9cZ92j3oBdm7WT+9Q6z0mVnvUEWQJ9Dj/nRZhFk17tE8tR0nIQPeu9NONa47Ar8e/T3L44DM9hgTl2xmXrs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490536; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=xpsoC5cSBSSNI0TiVzfvGo9ynHkUwvaybK6Dmv5cCeE=; b=AMC9/4OLvrNKcTE9uJdhgDgSOgEG+xm/qS7DzzOntGz4alTje1Kq4L8UIOZKzud2heGqDql72OQ1B4BDwla63gIX1MbXsECjN1CcAuW59fpy4CVWV4xmF/7E6P6Y7bp/DALqW1dWtoLaXAXq+vg7TwhCGaAd5LEeZ2iWsjJI5EM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490536090390.38983422690626; Thu, 12 Nov 2026 05:35:36 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUvz-0000GF-24; Thu, 12 Nov 2026 08:33:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuh-0006kA-2z for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:29 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuf-0005r7-By for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:26 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-330-x_ku6x8bMwKT-MlmV9S37w-1; Thu, 12 Nov 2026 08:32:15 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9EB9218005B8; Thu, 12 Nov 2026 13:32:14 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1D9F51956087; Thu, 12 Nov 2026 13:32:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xpsoC5cSBSSNI0TiVzfvGo9ynHkUwvaybK6Dmv5cCeE=; b=XPr37mugTdywc5KDk8aT1akaplV0Vccb7qj2WeSpSBIwL4SWbnPk5ZL61I3SV0qZY1KCdh 4BLVnOlrg8FxL8qnI6OvrYNMa7H/YczZPmZoc0fc4ALE7W0+XPucutwY91GPNsfAE9Q8AT O2UnZUjdqXcxqcNt5fPEnzphECWkMbs= X-MC-Unique: x_ku6x8bMwKT-MlmV9S37w-1 X-Mimecast-MFC-AGG-ID: x_ku6x8bMwKT-MlmV9S37w_1794490334 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 42/48] Revert "multi-target: restrict whpx-accel-*-cpu to matching target" Date: Thu, 12 Nov 2026 13:30:48 +0000 Message-ID: <20261112133054.1977618-43-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490537042158500 This reverts commit 1b879fe489f8894c5b07438f0b10706db916ca4f. The conditional registration is no longer required since the base class is now using a target independent name. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- accel/whpx/whpx-common.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/accel/whpx/whpx-common.c b/accel/whpx/whpx-common.c index 20c684638b0..78d2827809b 100644 --- a/accel/whpx/whpx-common.c +++ b/accel/whpx/whpx-common.c @@ -20,7 +20,6 @@ #include "hw/core/boards.h" #include "hw/intc/ioapic.h" #include "qemu/error-report.h" -#include "qemu/target-info.h" #include "qapi/error.h" #include "qapi/qapi-types-common.h" #include "qapi/qapi-type-infos-common.h" @@ -493,18 +492,11 @@ static void whpx_cpu_accel_class_init(ObjectClass *oc= , const void *data) acc->cpu_instance_init =3D whpx_cpu_instance_init; } =20 -/* TYPE_ACCEL_CPU is only registered for current target cpu type */ -static bool whpx_cpu_accel_is_available(void) -{ - return !strcmp(target_cpu_type(), CPU_RESOLVING_TYPE); -} - static const TypeInfo whpx_cpu_accel_type =3D { .name =3D ACCEL_CPU_NAME("whpx"), =20 .parent =3D TYPE_ACCEL_CPU, .class_init =3D whpx_cpu_accel_class_init, - .is_available =3D whpx_cpu_accel_is_available, .abstract =3D true, }; =20 --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490769; cv=none; d=zohomail.com; s=zohoarc; b=J5QjG9k9g5zEv2W/FkCCxfmy8FhON6marHrirvj93DZ/C1cCXjzaGUBOw0IkqDpgjP9lMvRtdIRZfi8DqdYsWe1snpkR8tdR89iTg3B/QYEsLOInHk4zYTEtQtyyUlUs5qRgqGV/DHcstsPQ5qRsKyohB+khnqE8zPWjLx6q4bs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490769; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ybauHCJTGIsAe9j/rWTjqvDLrg71O+3iYUD9IavuNCM=; b=jOB+FecMXh62/9nUxqXo+dMON1xzIUvwUkIkc4dpB01sDSJTMktfHXndc6Uf5Egw4cZjbUAv+8XQ99p0ivlCoUNSAqXFJoKKzg+ovys5jAkiwjCbpaiig9/ynWc0byC6nm0ZwAjBD3FkDIWKOVQGyPUx5OJLF5N6d7BqOyeXp0w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490769009554.6282228442873; Thu, 12 Nov 2026 05:39:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUxv-0003ew-79; Thu, 12 Nov 2026 08:35:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuf-0006jD-MC for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:29 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUud-0005kR-T2 for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:25 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-442-q3RIRb24Pg2IKkoAhZahmQ-1; Thu, 12 Nov 2026 08:32:17 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5AC36196C436; Thu, 12 Nov 2026 13:32:16 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D9B651956087; Thu, 12 Nov 2026 13:32:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490340; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ybauHCJTGIsAe9j/rWTjqvDLrg71O+3iYUD9IavuNCM=; b=hYwlivNIJ1v0nwsKeQrGJRWK+gb5AK9JjvROEjMavDSALIkIDtZ/TfYT6DEENIWzSQt3eN zRV+vnwOQ3ECKF2MNF1Pu+YOWUewFlzOMvtjvI0fLLXiKcBEMqo70vequow6fGd1WJ23c+ Ih6ZvLfGuaRdJPfysAxIhol5VZOQa+c= X-MC-Unique: q3RIRb24Pg2IKkoAhZahmQ-1 X-Mimecast-MFC-AGG-ID: q3RIRb24Pg2IKkoAhZahmQ_1794490336 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 43/48] Revert "target/riscv/kvm: restrict kvm-accel-riscv-cpu to riscv targets" Date: Thu, 12 Nov 2026 13:30:49 +0000 Message-ID: <20261112133054.1977618-44-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490770672158500 This reverts commit 2d3e6b4003d5380c245ce8ffac4b8866f6d10a33. The conditional registration is no longer required since the base class is now using a target independent name. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- target/riscv/kvm/kvm-cpu.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c index 5beb6023380..aa28098e10e 100644 --- a/target/riscv/kvm/kvm-cpu.c +++ b/target/riscv/kvm/kvm-cpu.c @@ -27,7 +27,6 @@ #include "qapi/qapi-builtin-type-infos.h" #include "qemu/error-report.h" #include "qemu/main-loop.h" -#include "qemu/target-info.h" #include "qapi/visitor.h" #include "system/system.h" #include "system/kvm.h" @@ -2241,7 +2240,6 @@ static const TypeInfo kvm_cpu_accel_type_info =3D { =20 .parent =3D TYPE_ACCEL_CPU, .class_init =3D kvm_cpu_accel_class_init, - .is_available =3D target_base_riscv, .abstract =3D true, }; static void kvm_cpu_accel_register_types(void) --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490614; cv=none; d=zohomail.com; s=zohoarc; b=CP2oQFEAVC+FeMPf/dAaX9whwL4qBbpnDpYSVO4rg4TKxL0Xu+3HyEZEB8OpffcCvgxyhUuXAMppzChrY6L4NKQBZgVfifMuABh4k52EUouZFS71OChQDk1vsYxyr9O3YZOaKgkIGLffhu7IAaRnLtWbKFas9r98npe6MWKNws4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490614; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=jE0Tp6EP2Blk8TPp2u0e/WAjTTicRZNwIuIQI2NWLG0=; b=OYgpYKDxD27856he/398g5KvwmtHkIqvcZeHnsloYTkdSomthBhY/CCyyNUXx88gUTMWNdD0htedIzkFkocT6iNzI3qyEE54NfkzbvcCkWMg/GurcS2UWb3Svx4rNybvjlccniWaw5JZTZ86P3V50r9auT8Y+hlQHYgoz8MZOJo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490614895487.5674843193417; Thu, 12 Nov 2026 05:36:54 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUwr-0000cv-CE; Thu, 12 Nov 2026 08:34:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuf-0006j6-MT for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:29 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUud-0005kZ-Rm for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:25 -0500 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-64-DeNip7AxPf6eA1VDAZESPg-1; Thu, 12 Nov 2026 08:32:19 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7D389196C431; Thu, 12 Nov 2026 13:32:18 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A99A11956087; Thu, 12 Nov 2026 13:32:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jE0Tp6EP2Blk8TPp2u0e/WAjTTicRZNwIuIQI2NWLG0=; b=G2uldxelywKviE3aU6pVkBi8zjKHKqxDVfpOeqzLhi6m2xVHm/9w6sNyIUWsyV4V2wLmIK DOKHEwGFDSuzi7IwwIGf+RLOcYMdOTtOj5QMiIrwdhwy9cLFkBwNQdTJi+3H8WKQKfsH1Z rgp7s4KpYYEikitZt0e2+i3d1oh08V8= X-MC-Unique: DeNip7AxPf6eA1VDAZESPg-1 X-Mimecast-MFC-AGG-ID: DeNip7AxPf6eA1VDAZESPg_1794490338 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 44/48] Revert "target/riscv/tcg: restrict tcg-accel-riscv-cpu to riscv targets" Date: Thu, 12 Nov 2026 13:30:50 +0000 Message-ID: <20261112133054.1977618-45-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490616250158500 From: Pierrick Bouvier This reverts commit ec65e16fd2ba012d57b1bbfcfcd04c31c4111924. The conditional registration is no longer required since the base class is now using a target independent name. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- target/riscv/tcg/tcg-cpu.c | 1 - 1 file changed, 1 deletion(-) diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c index 5834ec1524f..3d9c9973292 100644 --- a/target/riscv/tcg/tcg-cpu.c +++ b/target/riscv/tcg/tcg-cpu.c @@ -1755,7 +1755,6 @@ static const TypeInfo riscv_tcg_cpu_accel_type_info = =3D { =20 .parent =3D TYPE_ACCEL_CPU, .class_init =3D riscv_tcg_cpu_accel_class_init, - .is_available =3D target_base_riscv, .abstract =3D true, }; =20 --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490602; cv=none; d=zohomail.com; s=zohoarc; b=Mc5X1PvJ5Vt5ynTXC2HizhaVHte9cP7ucth5fc6gU8K65seUQ9T46ycqG7zJdPqFvHVYQb1Sp00y0uIZhbRNkteOcAuxLuQcKXizgDLVoacI6ZNTJpO2tE+T6NqXL6pb1VC6vY/7j9yNpAHugJhldcAR+db7wFocIa15DF+NO7I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490602; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=k4xXw+QeLGZ+lg6xHyzdz8XOMc2rgolQeOIZ6v36+X8=; b=JtdXDEtcwwsyXYJCCHYKtGWaUAyVwZz19V0rJsZqKBc6wPl6omPwXITgDXC0noTU4fR9mLvbd8KEklP3hQirEwTOXC8X5BouTSQv4Vsh3AINsBv4jxiOprzLMFnXnY8sNZkiBohY8xVSk3R6bWukydZSyYzi+2Ob91RHoZFHTZc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490602901797.5921169606703; Thu, 12 Nov 2026 05:36:42 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUvU-0007at-Rm; Thu, 12 Nov 2026 08:33:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUui-0006kS-FQ for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:31 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuf-0005sr-MO for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:28 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-609-aw7yzkXNNcmwJXtJXzHcoQ-1; Thu, 12 Nov 2026 08:32:21 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 429F61956063; Thu, 12 Nov 2026 13:32:20 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id CDB221956087; Thu, 12 Nov 2026 13:32:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=k4xXw+QeLGZ+lg6xHyzdz8XOMc2rgolQeOIZ6v36+X8=; b=JbPPqk02nWngNDRKgZ+i1AQGXRfiyZ6jh3jymZ4zy7o7e7KjjGbEk413bzrRZIMvq0nHQr GpacQC668joi8cds9Mw6a9I8d/l1H5fqxDq1ItaY8I9+xNPvvLgFR+2rvZFY9aNJ72d6gP KdoyaMQmg5uEGyatXLu60wQCYcuL73U= X-MC-Unique: aw7yzkXNNcmwJXtJXzHcoQ-1 X-Mimecast-MFC-AGG-ID: aw7yzkXNNcmwJXtJXzHcoQ_1794490340 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 45/48] qom: drop the 'is_available' callback from TypeInfo Date: Thu, 12 Nov 2026 13:30:51 +0000 Message-ID: <20261112133054.1977618-46-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490604139158500 For the purposes of introspection, a binary must always register all compiled in types (classes). Any filtering of what is permitted with a given selected target should happen at time of use/query. As such the 'is_available' callback on TypeInfo is an undesirable design pattern and with Machine classes converted it can be removed. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pierrick Bouvier --- include/qom/object.h | 3 --- qom/object.c | 4 ---- rust/qom/src/qom.rs | 1 - 3 files changed, 8 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index 70d8ea3e299..06a55b410ba 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -475,8 +475,6 @@ struct Object * @class_data: Data to pass to the @class_init, * @class_base_init. This can be useful when building dynamic * classes. - * @is_available: callback invoked at registration time, to dynamically ch= eck if - * this type should be available or not. * @interfaces: The list of interfaces associated with this type. This * should point to a static array that's terminated with a zero filled * element. @@ -500,7 +498,6 @@ struct TypeInfo void (*class_base_init)(ObjectClass *klass, const void *data); const void *class_data; =20 - bool (*is_available)(void); const InterfaceInfo *interfaces; }; =20 diff --git a/qom/object.c b/qom/object.c index 9276b7a4351..e18622d4146 100644 --- a/qom/object.c +++ b/qom/object.c @@ -167,10 +167,6 @@ static TypeImpl *type_register_internal(const TypeInfo= *info) abort(); } =20 - if (info->is_available && !info->is_available()) { - return NULL; - } - ti =3D type_new(info); =20 type_table_add(ti); diff --git a/rust/qom/src/qom.rs b/rust/qom/src/qom.rs index 81449eeefad..372be188622 100644 --- a/rust/qom/src/qom.rs +++ b/rust/qom/src/qom.rs @@ -695,7 +695,6 @@ pub trait ObjectImpl: ObjectType + IsA { class_init: Some(rust_class_init::), class_base_init: Self::CLASS_BASE_INIT, class_data: core::ptr::null(), - is_available: None, interfaces: core::ptr::null(), }; =20 --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490565; cv=none; d=zohomail.com; s=zohoarc; b=hYWKSWKhjHEY1VvaAHjcsUtYjc+zuixMy9bYgO1KCDVRRZL1dNwoh0Pv63T9UkNyI6c5tvVUJxCWRqYOZDpyo1mZFAoLvNHKlaId2zRpCQk0E+0uHev2yctUIUGsePv8hiGG1Ktn5tq05qD5GP0M2lnxjObUrOBwitW8YOXVef8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490565; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Df+BJIJhozy7EFC9oMfpvTlsXu8tt15IEGAKhlCa0l4=; b=N797Z6tBymsaEcUH4dOlGjXDoqMHQkjtO6GoK2tfA0keb/dJxbH2o4RuSvQCfluUz1zlIWrvy31ldyXhqFYwnR/59om5HJMGdyq7YNDk2f3VrMgTamZpJi1cKEsvJfXN1EM3Y2J/MMLnUIytDJeSiLBMUVaE8wUx7lEZH0ExPBk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490565753135.25624505423207; Thu, 12 Nov 2026 05:36:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUxG-0001wN-VX; Thu, 12 Nov 2026 08:35:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuh-0006kB-7H for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:31 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUuf-0005sQ-Lg for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:26 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-230-LgzGWhwBOfeuinWoC1SIaw-1; Thu, 12 Nov 2026 08:32:23 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 07C19197732C; Thu, 12 Nov 2026 13:32:22 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 937CF1956087; Thu, 12 Nov 2026 13:32:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Df+BJIJhozy7EFC9oMfpvTlsXu8tt15IEGAKhlCa0l4=; b=dob6++8nXOeU7UxVsAXlsZxvOgwvynPplZXArbDV6IPWXjiBnmSP7b+gllu+1N86od1DFy yg3WSpZYC2Nc6ydMK+6Y8p09aEBr6cLLz9b1V1zROS2YMTOpjdM3ucZn3MnkkbBCOY7E/H 8l1JZDSd6v04KkMxDf5z1Dmlhnw2dFc= X-MC-Unique: LgzGWhwBOfeuinWoC1SIaw-1 X-Mimecast-MFC-AGG-ID: LgzGWhwBOfeuinWoC1SIaw_1794490342 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 46/48] hw/pci: unconditionally expose the 'loadparm' property Date: Thu, 12 Nov 2026 13:30:52 +0000 Message-ID: <20261112133054.1977618-47-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490567587158500 From: Yonggang Luo With the multi-target work, the goal is to move to a single unified QOM tree that applies universally across all targets. This complements the migration away from instance level properties to class level properties, which again aims to ensure a statically defined stable QOM object model for each class. This requires that properties are either unconditionally registered in the class, with invalid options rejected at runtime (for example, during realize()), or that distinct subclasses are used for specialized use cases that need a distinct impl for some targets. It is harmless to have the 'loadparm' property registered unconditionally so take the simple option. Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Yonggang Luo --- hw/pci/pci.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index d8b117799f3..32049394691 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2889,6 +2889,11 @@ static void pci_qdev_property_set_loadparm(Object *o= bj, const char *value, { void *lp_str; =20 + if (!target_s390x()) { + error_setg(errp, "'loadparm' is only supported on s390x"); + return; + } + if (object_property_get_int(obj, "bootindex", NULL) < 0) { error_setg(errp, "'loadparm' is only valid for boot devices"); return; @@ -2906,14 +2911,11 @@ void pci_qdev_property_add_specifics(DeviceClass *d= c) { ObjectClass *oc =3D OBJECT_CLASS(dc); =20 - /* The loadparm property is only supported on s390x */ - if (target_s390x()) { - object_class_property_add_str(oc, "loadparm", - pci_qdev_property_get_loadparm, - pci_qdev_property_set_loadparm); - object_class_property_set_description(oc, "loadparm", - "load parameter (s390x only)= "); - } + object_class_property_add_str(oc, "loadparm", + pci_qdev_property_get_loadparm, + pci_qdev_property_set_loadparm); + object_class_property_set_description(oc, "loadparm", + "load parameter (s390x only)"); } =20 MemoryRegion *pci_address_space(PCIDevice *dev) --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490557; cv=none; d=zohomail.com; s=zohoarc; b=iBRgfYTyzKc5loUDcGKTIEtV4MdYGDmynEn6BwQGEjNIgPkAdGZHM7iAj6zyqNbiSxxaC0bkIy7W9mphJ4lHVEtnske6ZiHgQ69RjyiaCFsrrBPNl8Q01LmjPz/ocEkICLO45j5HNEyIYzxJS9PBEpguMUDUrWpfaYJ4zdOyRtk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490557; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=4PoNebKsPvcGB5/MaY016iIynZV/My4bbZi4U1txlGk=; b=F0g2OIPXQftWx5QvfMbUrjOvL3JQbbnEL8dCzc8mA8eqL3oRdyAm84iSODrV0lLFZ4NrQGoLhuvghfqKJjF7uyPFdviJ8cYQuKtaHrUzuhr2E8NNKxc6CRfUiK+OjHVZpz8crhexky1C9RSlOgbwHI4XVC4Uv/dyAmjQim4ljgQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 179449055789360.898207428005094; Thu, 12 Nov 2026 05:35:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUxF-0001rb-PZ; Thu, 12 Nov 2026 08:35:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUun-0006nP-En for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:41 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUul-0006OP-TE for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:33 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-693-dxIUDyUBM9evo6MBcakDig-1; Thu, 12 Nov 2026 08:32:24 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C2677195606C; Thu, 12 Nov 2026 13:32:23 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 580FE1956087; Thu, 12 Nov 2026 13:32:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4PoNebKsPvcGB5/MaY016iIynZV/My4bbZi4U1txlGk=; b=EvtFnos6/GFoIz0X1zZoAf3FVhgxSw9czMLXZhbe2tsMYGouSErKjHtNs5nfUocDZWRd3g uQ7x7GpjBpFwJ/MmJMMmp4kzPo7OcqPvIAzJ3m24tbZLMTxJpzWB7z1JKt24yn7a2JBuke aYkeIuHgkITnzjHTZqLYlcuQ19eYjK8= X-MC-Unique: dxIUDyUBM9evo6MBcakDig-1 X-Mimecast-MFC-AGG-ID: dxIUDyUBM9evo6MBcakDig_1794490343 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 47/48] hw/scsi: unconditionally expose the 'loadparm' property Date: Thu, 12 Nov 2026 13:30:53 +0000 Message-ID: <20261112133054.1977618-48-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490559445158500 From: Yonggang Luo With the multi-target work, the goal is to move to a single unified QOM tree that applies universally across all targets. This complements the migration away from instance level properties to class level properties, which again aims to ensure a statically defined stable QOM object model for each class. This requires that properties are either unconditionally registered in the class, with invalid options rejected at runtime (for example, during realize()), or that distinct subclasses are used for specialized use cases that need a distinct impl for some targets. It is harmless to have the 'loadparm' property registered unconditionally so take the simple option. Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Yonggang Luo --- hw/scsi/scsi-disk.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index de2b6d85da8..7fec5a74d14 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -3212,6 +3212,11 @@ static void scsi_property_set_loadparm(Object *obj, = const char *value, { void *lp_str; =20 + if (!target_s390x()) { + error_setg(errp, "'loadparm' is only supported on s390x"); + return; + } + if (object_property_get_int(obj, "bootindex", NULL) < 0) { error_setg(errp, "'loadparm' is only valid for boot devices"); return; @@ -3229,14 +3234,11 @@ static void scsi_property_add_specifics(DeviceClass= *dc) { ObjectClass *oc =3D OBJECT_CLASS(dc); =20 - /* The loadparm property is only supported on s390x */ - if (target_s390x()) { - object_class_property_add_str(oc, "loadparm", - scsi_property_get_loadparm, - scsi_property_set_loadparm); - object_class_property_set_description(oc, "loadparm", - "load parameter (s390x only)= "); - } + object_class_property_add_str(oc, "loadparm", + scsi_property_get_loadparm, + scsi_property_set_loadparm); + object_class_property_set_description(oc, "loadparm", + "load parameter (s390x only)"); } =20 static void scsi_disk_base_class_initfn(ObjectClass *klass, const void *da= ta) --=20 2.56.1 From nobody Mon Nov 23 04:34:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1794490638; cv=none; d=zohomail.com; s=zohoarc; b=CVzeTQYEWF8gWfpwDkt4950CWNKUOIIwYNnfP3RIXnA2x+yktEYTAMade0Uj4/L0FwKQlcShkKrY3QRZEiUONuv2hq7FF5XrC7N8TN2H0Xg9b3/8gAQ79zrG3Ru1AtLwwA8iP3aI1oZvCCBPKaOhdW0X9Jl9ficfqZumKBvPRzo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794490638; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ufcCI4vQPg8BwrzfrNGnyAet9CxziKfMsXW2WeaWd28=; b=YPqGvUutbrTrvI/71JTnKjVZ8qOkPNAoISVBdNZDBl5dCW/XIeHA1pL4Zb4Pa2mnlUKJ0tDyrdO7HE709oN/8/eTPCh46nXe/YIkMnIsgvriMHFT2tbam6syMEa/K9xgisHeYD0E8EJG6KoUKMibo4yy08qnE0B64Qaa04ZhLYw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794490638667542.9641095138916; Thu, 12 Nov 2026 05:37:18 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xRUxr-0003Hh-Pl; Thu, 12 Nov 2026 08:35:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUul-0006n4-Et for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xRUui-000688-O8 for qemu-devel@nongnu.org; Thu, 12 Nov 2026 08:32:30 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-372-J8yQleg4Me2UQFiui9HB7g-1; Thu, 12 Nov 2026 08:32:26 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8A57D195606C; Thu, 12 Nov 2026 13:32:25 +0000 (UTC) Received: from berrange.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1EA34195608D; Thu, 12 Nov 2026 13:32:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794490348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ufcCI4vQPg8BwrzfrNGnyAet9CxziKfMsXW2WeaWd28=; b=Z9TFzzdBwQABOC+Y0euk5DjcUXTlY+2U7dAQcWZwXfQidSmQakKqVjodlk5K3MDSX3hx11 SNMjGYOR8atffy5pruAceSdLSKVM7hXmzHnPgm9mC4WZ1P09zzTjMJSR3M2FvqpLfUAWdl IzeZ134hzkTQIYg47ZEiuwL03f7VJuY= X-MC-Unique: J8yQleg4Me2UQFiui9HB7g-1 X-Mimecast-MFC-AGG-ID: J8yQleg4Me2UQFiui9HB7g_1794490345 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Markus Armbruster , Yonggang Luo , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 48/48] hw/virtio/virtio-mem: unconditionally expose 'unplugged-inaccessible' Date: Thu, 12 Nov 2026 13:30:54 +0000 Message-ID: <20261112133054.1977618-49-berrange@redhat.com> In-Reply-To: <20261112133054.1977618-1-berrange@redhat.com> References: <20261112133054.1977618-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1794490640708158500 From: Yonggang Luo With the multi-target work, the goal is to move to a single unified QOM tree that applies universally across all targets. This complements the migration away from instance level properties to class level properties, which again aims to ensure a statically defined stable QOM object model for each class. This requires that properties are either unconditionally registered in the class, with invalid options rejected at runtime (for example, during realize()), or that distinct subclasses are used for specialized use cases that need a distinct impl for some targets. It is harmless to have the 'unplugged-inaccessible' property registered unconditionally so take the simple option. Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Yonggang Luo --- hw/virtio/virtio-mem.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c index 546ea18b7c4..fb029581024 100644 --- a/hw/virtio/virtio-mem.c +++ b/hw/virtio/virtio-mem.c @@ -880,7 +880,11 @@ static void virtio_mem_device_realize(DeviceState *dev= , Error **errp) break; } } else { - vmem->unplugged_inaccessible =3D ON_OFF_AUTO_ON; + if (vmem->unplugged_inaccessible !=3D ON_OFF_AUTO_ON) { + error_setg(errp, "'%s' must be 'on' on non-x86 targets", + VIRTIO_MEM_UNPLUGGED_INACCESSIBLE_PROP); + return; + } } =20 if (vmem->dynamic_memslots && @@ -1573,9 +1577,6 @@ static const Property virtio_mem_properties[] =3D { early_migration, true), DEFINE_PROP_BOOL(VIRTIO_MEM_DYNAMIC_MEMSLOTS_PROP, VirtIOMEM, dynamic_memslots, false), -}; - -static const Property virtio_mem_legacy_guests_properties[] =3D { DEFINE_PROP_ON_OFF_AUTO(VIRTIO_MEM_UNPLUGGED_INACCESSIBLE_PROP, VirtIO= MEM, unplugged_inaccessible, ON_OFF_AUTO_ON), }; @@ -1640,9 +1641,6 @@ static void virtio_mem_class_init(ObjectClass *klass,= const void *data) RamDiscardSourceClass *rdsc =3D RAM_DISCARD_SOURCE_CLASS(klass); =20 device_class_set_props(dc, virtio_mem_properties); - if (virtio_mem_has_legacy_guests()) { - device_class_set_props(dc, virtio_mem_legacy_guests_properties); - } dc->vmsd =3D &vmstate_virtio_mem; =20 set_bit(DEVICE_CATEGORY_MISC, dc->categories); --=20 2.56.1