* [PATCH] qapi: Add 'acpi' field to 'query-machines' output
@ 2023-02-27 15:31 Peter Krempa
2023-02-27 15:42 ` Markus Armbruster
0 siblings, 1 reply; 2+ messages in thread
From: Peter Krempa @ 2023-02-27 15:31 UTC (permalink / raw)
To: qemu-devel
Cc: Eduardo Habkost, Marcel Apfelbaum, Philippe Mathieu-Daudé,
Yanan Wang, Eric Blake, Markus Armbruster
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=' in 'query-command-line-options' is insufficient.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
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=' 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 = mc->has_hotpluggable_cpus;
info->numa_mem_supported = mc->numa_mem_supported;
info->deprecated = !!mc->deprecation_reason;
+ info->acpi = !!object_class_property_find(OBJECT_CLASS(mc), "acpi");
if (mc->default_cpu_type) {
info->default_cpu_type = 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:
--
2.39.2
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] qapi: Add 'acpi' field to 'query-machines' output
2023-02-27 15:31 [PATCH] qapi: Add 'acpi' field to 'query-machines' output Peter Krempa
@ 2023-02-27 15:42 ` Markus Armbruster
0 siblings, 0 replies; 2+ messages in thread
From: Markus Armbruster @ 2023-02-27 15:42 UTC (permalink / raw)
To: Peter Krempa
Cc: qemu-devel, Eduardo Habkost, Marcel Apfelbaum,
Philippe Mathieu-Daudé, Yanan Wang, Eric Blake
Peter Krempa <pkrempa@redhat.com> writes:
> 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=' in 'query-command-line-options' is insufficient.
>
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
[...]
> 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)
supports ACPI
> +#
> # 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:
With that
Acked-by: Markus Armbruster <armbru@redhat.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-02-27 15:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-27 15:31 [PATCH] qapi: Add 'acpi' field to 'query-machines' output Peter Krempa
2023-02-27 15:42 ` Markus Armbruster
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).