From nobody Sun May 12 00:16:09 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1677511934; cv=none; d=zohomail.com; s=zohoarc; b=dQaaVzgQe0caeaciyczJ3RIKTLG7qTtpUdPcFzw4oqaNn8Z664O1kmpLipTxqWUerIoHADRTydHiFjW1dF/RGqxbD6e1BY+bmnR/0OfsiZr/ghRV5uJa0L8PCAHpGk28I5TZ7l98xpxLtBtvN/u4LpwNJ15dH87xa4knSTl9Hug= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677511934; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=GVLZJlBSmoUM7cwNX3XWxz7mTnN3JZ31QrYsVuata0A=; b=GIVy25quO4qaMBTe7B/Q2eC6pKlJc8p9P0pta4M2l1N3NOyrRKsHIODuqf79o7ATDAtflrcMu2MeYeRZa459cmD2hQiLNFZ/kUNu8T2ft5Tyv6jDQjaZx0HWEdpkwwJnLY7r+XbuT1lITeD3u70c2N4+JVPG/3nxduMJrg0PSoI= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1677511934198890.5421921429057; Mon, 27 Feb 2023 07:32:14 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWfTo-00033v-4x; Mon, 27 Feb 2023 10:31:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pWfTi-00030n-VL for qemu-devel@nongnu.org; Mon, 27 Feb 2023 10:31:50 -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 1pWfTh-00013E-5N for qemu-devel@nongnu.org; Mon, 27 Feb 2023 10:31:50 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-611-noc4Nna_PoasTss9608tVQ-1; Mon, 27 Feb 2023 10:31:44 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 27FFD3823A08; Mon, 27 Feb 2023 15:31:42 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8D98A2166B2B; Mon, 27 Feb 2023 15:31:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677511906; 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; bh=GVLZJlBSmoUM7cwNX3XWxz7mTnN3JZ31QrYsVuata0A=; b=eK2c21nONBYf+PxDj9m+s5Y4BXafNxKvdbqvyyo+soHFvk6if+sJcfUqnv9jdGuqkvs9dn LQTchHfeiBXPWQbqPevCjUugJtI/XIE8vW2dbZW15KI7dYJjQJ4X18hSw8eEU+KJ9IVMZy 6qZ2un7Jm2gaXMISKJXeXT6rZ5MK9As= X-MC-Unique: noc4Nna_PoasTss9608tVQ-1 From: Peter Krempa To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Marcel Apfelbaum , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yanan Wang , Eric Blake , Markus Armbruster Subject: [PATCH] qapi: Add 'acpi' field to 'query-machines' output Date: Mon, 27 Feb 2023 16:31:39 +0100 Message-Id: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pkrempa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, 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_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=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: 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: 1677511934835100002 Content-Type: text/plain; charset="utf-8" Report which machine types support ACPI so that management applications can properly use the 'acpi' property even on platforms such as ARM where support for ACPI depends on the machine type and thus checking presence of '-machine acpi=3D' in 'query-command-line-options' is insufficient. Signed-off-by: Peter Krempa Acked-by: Markus Armbruster --- Libvirt intends to use this information to unbreak configs of ARM machines with machine type which doesn't support ACPI. Historically we'd use '-no-acpi' as the default was to enable ACPI. Conversion to the modern equivalent '-machine acpi=3D' unfortunately didn't really allow to fix the logic for this specific case whithout additional information. Libvirt patches are posted as: https://listman.redhat.com/archives/libvir-list/2023-February/238153.html hw/core/machine-qmp-cmds.c | 1 + include/hw/boards.h | 3 +++ qapi/machine.json | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index 2d904747c0..b98ff15089 100644 --- a/hw/core/machine-qmp-cmds.c +++ b/hw/core/machine-qmp-cmds.c @@ -102,6 +102,7 @@ MachineInfoList *qmp_query_machines(Error **errp) info->hotpluggable_cpus =3D mc->has_hotpluggable_cpus; info->numa_mem_supported =3D mc->numa_mem_supported; info->deprecated =3D !!mc->deprecation_reason; + info->acpi =3D !!object_class_property_find(OBJECT_CLASS(mc), "acp= i"); if (mc->default_cpu_type) { info->default_cpu_type =3D g_strdup(mc->default_cpu_type); } diff --git a/include/hw/boards.h b/include/hw/boards.h index 6fbbfd56c8..c18b444bef 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -174,6 +174,8 @@ typedef struct { * index @idx in @ms->possible_cpus[] * @has_hotpluggable_cpus: * If true, board supports CPUs creation with -device/device_add. + * @has_acpi: + * Machine type has support for ACPI. * @default_cpu_type: * specifies default CPU_TYPE, which will be used for parsing target * specific features and for creating CPUs if CPU name wasn't provided @@ -262,6 +264,7 @@ struct MachineClass { bool rom_file_has_mr; int minimum_page_bits; bool has_hotpluggable_cpus; + bool has_acpi; bool ignore_memory_transaction_failures; int numa_mem_align_shift; const char **valid_cpu_types; diff --git a/qapi/machine.json b/qapi/machine.json index b9228a5e46..f82a00963b 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -155,6 +155,8 @@ # # @default-ram-id: the default ID of initial RAM memory backend (since 5.2) # +# @acpi: machine type supports acpi (since 8.0) +# # Since: 1.2 ## { 'struct': 'MachineInfo', @@ -162,7 +164,7 @@ '*is-default': 'bool', 'cpu-max': 'int', 'hotpluggable-cpus': 'bool', 'numa-mem-supported': 'bool', 'deprecated': 'bool', '*default-cpu-type': 'str', - '*default-ram-id': 'str' } } + '*default-ram-id': 'str', 'acpi': 'bool' } } ## # @query-machines: --=20 2.39.2