diff mbox series

[RFC,v4,01/19] qapi: Rename TargetInfo structure as QemuTargetInfo

Message ID 20250422145502.70770-2-philmd@linaro.org
State New
Headers show
Series single-binary: Make hw/arm/ common | expand

Commit Message

Philippe Mathieu-Daudé April 22, 2025, 2:54 p.m. UTC
The QAPI-generated 'TargetInfo' structure name is only used
in a single file. We want to heavily use another structure
similarly named. Rename the QAPI one, since structure names
are not part of the public API.

Suggested-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
 qapi/machine.json          | 10 +++++-----
 hw/core/machine-qmp-cmds.c |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

Comments

Philippe Mathieu-Daudé April 22, 2025, 2:57 p.m. UTC | #1
Cc'ing Markus

On 22/4/25 16:54, Philippe Mathieu-Daudé wrote:
> The QAPI-generated 'TargetInfo' structure name is only used
> in a single file. We want to heavily use another structure
> similarly named. Rename the QAPI one, since structure names
> are not part of the public API.
> 
> Suggested-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   qapi/machine.json          | 10 +++++-----
>   hw/core/machine-qmp-cmds.c |  4 ++--
>   2 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/qapi/machine.json b/qapi/machine.json
> index a6b8795b09e..6889cba2c75 100644
> --- a/qapi/machine.json
> +++ b/qapi/machine.json
> @@ -275,15 +275,15 @@
>   { 'command': 'query-current-machine', 'returns': 'CurrentMachineParams' }
>   
>   ##
> -# @TargetInfo:
> +# @QemuTargetInfo:
>   #
> -# Information describing the QEMU target.
> +# Information on the target configuration built into the QEMU binary.
>   #
>   # @arch: the target architecture
>   #
>   # Since: 1.2
>   ##
> -{ 'struct': 'TargetInfo',
> +{ 'struct': 'QemuTargetInfo',
>     'data': { 'arch': 'SysEmuTarget' } }
>   
>   ##
> @@ -291,11 +291,11 @@
>   #
>   # Return information about the target for this QEMU
>   #
> -# Returns: TargetInfo
> +# Returns: QemuTargetInfo
>   #
>   # Since: 1.2
>   ##
> -{ 'command': 'query-target', 'returns': 'TargetInfo' }
> +{ 'command': 'query-target', 'returns': 'QemuTargetInfo' }
>   
>   ##
>   # @UuidInfo:
> diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
> index 3130c5cd456..0e9ca1b90e2 100644
> --- a/hw/core/machine-qmp-cmds.c
> +++ b/hw/core/machine-qmp-cmds.c
> @@ -132,9 +132,9 @@ CurrentMachineParams *qmp_query_current_machine(Error **errp)
>       return params;
>   }
>   
> -TargetInfo *qmp_query_target(Error **errp)
> +QemuTargetInfo *qmp_query_target(Error **errp)
>   {
> -    TargetInfo *info = g_malloc0(sizeof(*info));
> +    QemuTargetInfo *info = g_malloc0(sizeof(*info));
>   
>       info->arch = qapi_enum_parse(&SysEmuTarget_lookup, target_name(), -1,
>                                    &error_abort);
Markus Armbruster April 22, 2025, 5:33 p.m. UTC | #2
Philippe Mathieu-Daudé <philmd@linaro.org> writes:

> The QAPI-generated 'TargetInfo' structure name is only used
> in a single file. We want to heavily use another structure
> similarly named. Rename the QAPI one, since structure names
> are not part of the public API.
>
> Suggested-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

Reviewed-by: Markus Armbruster <armbru@redhat.com>
diff mbox series

Patch

diff --git a/qapi/machine.json b/qapi/machine.json
index a6b8795b09e..6889cba2c75 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -275,15 +275,15 @@ 
 { 'command': 'query-current-machine', 'returns': 'CurrentMachineParams' }
 
 ##
-# @TargetInfo:
+# @QemuTargetInfo:
 #
-# Information describing the QEMU target.
+# Information on the target configuration built into the QEMU binary.
 #
 # @arch: the target architecture
 #
 # Since: 1.2
 ##
-{ 'struct': 'TargetInfo',
+{ 'struct': 'QemuTargetInfo',
   'data': { 'arch': 'SysEmuTarget' } }
 
 ##
@@ -291,11 +291,11 @@ 
 #
 # Return information about the target for this QEMU
 #
-# Returns: TargetInfo
+# Returns: QemuTargetInfo
 #
 # Since: 1.2
 ##
-{ 'command': 'query-target', 'returns': 'TargetInfo' }
+{ 'command': 'query-target', 'returns': 'QemuTargetInfo' }
 
 ##
 # @UuidInfo:
diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
index 3130c5cd456..0e9ca1b90e2 100644
--- a/hw/core/machine-qmp-cmds.c
+++ b/hw/core/machine-qmp-cmds.c
@@ -132,9 +132,9 @@  CurrentMachineParams *qmp_query_current_machine(Error **errp)
     return params;
 }
 
-TargetInfo *qmp_query_target(Error **errp)
+QemuTargetInfo *qmp_query_target(Error **errp)
 {
-    TargetInfo *info = g_malloc0(sizeof(*info));
+    QemuTargetInfo *info = g_malloc0(sizeof(*info));
 
     info->arch = qapi_enum_parse(&SysEmuTarget_lookup, target_name(), -1,
                                  &error_abort);