Message ID | 20250418172908.25147-2-philmd@linaro.org |
---|---|
State | New |
Headers | show |
Series | single-binary: Make hw/arm/ common | expand |
+Daniel/Markus on this single one. On 18/4/25 19:28, 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> > --- > qapi/machine.json | 12 ++++++------ > hw/core/machine-qmp-cmds.c | 4 ++-- > 2 files changed, 8 insertions(+), 8 deletions(-) > > diff --git a/qapi/machine.json b/qapi/machine.json > index a6b8795b09e..3246212f048 100644 > --- a/qapi/machine.json > +++ b/qapi/machine.json > @@ -275,15 +275,15 @@ > { 'command': 'query-current-machine', 'returns': 'CurrentMachineParams' } > > ## > -# @TargetInfo: > +# @BinaryTargetInfo: > # > -# Information describing the QEMU target. > +# Information describing the QEMU binary target. > # > -# @arch: the target architecture > +# @arch: the binary target architecture > # > # Since: 1.2 > ## > -{ 'struct': 'TargetInfo', > +{ 'struct': 'BinaryTargetInfo', > 'data': { 'arch': 'SysEmuTarget' } } > > ## > @@ -291,11 +291,11 @@ > # > # Return information about the target for this QEMU > # > -# Returns: TargetInfo > +# Returns: BinaryTargetInfo > # > # Since: 1.2 > ## > -{ 'command': 'query-target', 'returns': 'TargetInfo' } > +{ 'command': 'query-target', 'returns': 'BinaryTargetInfo' } > > ## > # @UuidInfo: > diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c > index 3130c5cd456..408994b67d7 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) > +BinaryTargetInfo *qmp_query_target(Error **errp) > { > - TargetInfo *info = g_malloc0(sizeof(*info)); > + BinaryTargetInfo *info = g_malloc0(sizeof(*info)); > > info->arch = qapi_enum_parse(&SysEmuTarget_lookup, target_name(), -1, > &error_abort);
On 4/18/25 10:28, 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> > --- > qapi/machine.json | 12 ++++++------ > hw/core/machine-qmp-cmds.c | 4 ++-- > 2 files changed, 8 insertions(+), 8 deletions(-) Reviewed-by: Richard Henderson <richard.henderson@linaro.org> r~
diff --git a/qapi/machine.json b/qapi/machine.json index a6b8795b09e..3246212f048 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -275,15 +275,15 @@ { 'command': 'query-current-machine', 'returns': 'CurrentMachineParams' } ## -# @TargetInfo: +# @BinaryTargetInfo: # -# Information describing the QEMU target. +# Information describing the QEMU binary target. # -# @arch: the target architecture +# @arch: the binary target architecture # # Since: 1.2 ## -{ 'struct': 'TargetInfo', +{ 'struct': 'BinaryTargetInfo', 'data': { 'arch': 'SysEmuTarget' } } ## @@ -291,11 +291,11 @@ # # Return information about the target for this QEMU # -# Returns: TargetInfo +# Returns: BinaryTargetInfo # # Since: 1.2 ## -{ 'command': 'query-target', 'returns': 'TargetInfo' } +{ 'command': 'query-target', 'returns': 'BinaryTargetInfo' } ## # @UuidInfo: diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index 3130c5cd456..408994b67d7 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) +BinaryTargetInfo *qmp_query_target(Error **errp) { - TargetInfo *info = g_malloc0(sizeof(*info)); + BinaryTargetInfo *info = g_malloc0(sizeof(*info)); info->arch = qapi_enum_parse(&SysEmuTarget_lookup, target_name(), -1, &error_abort);