diff mbox series

[07/14] machine: remove 'arch' field from 'query-cpus-fast' QMP command

Message ID 20210224131142.1952027-8-berrange@redhat.com
State New
Headers show
Series deprecations: remove many old deprecations | expand

Commit Message

Daniel P. Berrangé Feb. 24, 2021, 1:11 p.m. UTC
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 docs/system/deprecated.rst       |  6 -----
 docs/system/removed-features.rst |  6 +++++
 hw/core/machine-qmp-cmds.c       | 41 --------------------------------
 qapi/machine.json                | 22 -----------------
 4 files changed, 6 insertions(+), 69 deletions(-)

Comments

Daniel P. Berrangé March 15, 2021, 11:51 a.m. UTC | #1
Ping for anyone willing to review this so I can get this in before freeze.

On Wed, Feb 24, 2021 at 01:11:35PM +0000, Daniel P. Berrangé wrote:
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  docs/system/deprecated.rst       |  6 -----
>  docs/system/removed-features.rst |  6 +++++
>  hw/core/machine-qmp-cmds.c       | 41 --------------------------------
>  qapi/machine.json                | 22 -----------------
>  4 files changed, 6 insertions(+), 69 deletions(-)
> 
> diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
> index 484f017119..78474f0845 100644
> --- a/docs/system/deprecated.rst
> +++ b/docs/system/deprecated.rst
> @@ -192,12 +192,6 @@ Since the ``dirty-bitmaps`` field is optionally present in both the old and
>  new locations, clients must use introspection to learn where to anticipate
>  the field if/when it does appear in command output.
>  
> -``query-cpus-fast`` ``arch`` output member (since 3.0.0)
> -''''''''''''''''''''''''''''''''''''''''''''''''''''''''
> -
> -The ``arch`` output member of the ``query-cpus-fast`` command is
> -replaced by the ``target`` output member.
> -
>  chardev client socket with ``wait`` option (since 4.0)
>  ''''''''''''''''''''''''''''''''''''''''''''''''''''''
>  
> diff --git a/docs/system/removed-features.rst b/docs/system/removed-features.rst
> index ad146daf9b..7942c2e513 100644
> --- a/docs/system/removed-features.rst
> +++ b/docs/system/removed-features.rst
> @@ -100,6 +100,12 @@ Use ``migrate_set_parameter`` instead.
>  
>  The ``query-cpus`` command is replaced by the ``query-cpus-fast`` command.
>  
> +``query-cpus-fast`` ``arch`` output member (removed in 6.0)
> +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
> +
> +The ``arch`` output member of the ``query-cpus-fast`` command is
> +replaced by the ``target`` output member.
> +
>  Human Monitor Protocol (HMP) commands
>  -------------------------------------
>  
> diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
> index af60cd969d..68a942595a 100644
> --- a/hw/core/machine-qmp-cmds.c
> +++ b/hw/core/machine-qmp-cmds.c
> @@ -24,46 +24,6 @@
>  #include "sysemu/runstate.h"
>  #include "sysemu/sysemu.h"
>  
> -static CpuInfoArch sysemu_target_to_cpuinfo_arch(SysEmuTarget target)
> -{
> -    /*
> -     * The @SysEmuTarget -> @CpuInfoArch mapping below is based on the
> -     * TARGET_ARCH -> TARGET_BASE_ARCH mapping in the "configure" script.
> -     */
> -    switch (target) {
> -    case SYS_EMU_TARGET_I386:
> -    case SYS_EMU_TARGET_X86_64:
> -        return CPU_INFO_ARCH_X86;
> -
> -    case SYS_EMU_TARGET_PPC:
> -    case SYS_EMU_TARGET_PPC64:
> -        return CPU_INFO_ARCH_PPC;
> -
> -    case SYS_EMU_TARGET_SPARC:
> -    case SYS_EMU_TARGET_SPARC64:
> -        return CPU_INFO_ARCH_SPARC;
> -
> -    case SYS_EMU_TARGET_MIPS:
> -    case SYS_EMU_TARGET_MIPSEL:
> -    case SYS_EMU_TARGET_MIPS64:
> -    case SYS_EMU_TARGET_MIPS64EL:
> -        return CPU_INFO_ARCH_MIPS;
> -
> -    case SYS_EMU_TARGET_TRICORE:
> -        return CPU_INFO_ARCH_TRICORE;
> -
> -    case SYS_EMU_TARGET_S390X:
> -        return CPU_INFO_ARCH_S390;
> -
> -    case SYS_EMU_TARGET_RISCV32:
> -    case SYS_EMU_TARGET_RISCV64:
> -        return CPU_INFO_ARCH_RISCV;
> -
> -    default:
> -        return CPU_INFO_ARCH_OTHER;
> -    }
> -}
> -
>  static void cpustate_to_cpuinfo_s390(CpuInfoS390 *info, const CPUState *cpu)
>  {
>  #ifdef TARGET_S390X
> @@ -104,7 +64,6 @@ CpuInfoFastList *qmp_query_cpus_fast(Error **errp)
>              value->props = props;
>          }
>  
> -        value->arch = sysemu_target_to_cpuinfo_arch(target);
>          value->target = target;
>          if (target == SYS_EMU_TARGET_S390X) {
>              cpustate_to_cpuinfo_s390(&value->u.s390x, cpu);
> diff --git a/qapi/machine.json b/qapi/machine.json
> index 9811927504..c0c52aef10 100644
> --- a/qapi/machine.json
> +++ b/qapi/machine.json
> @@ -34,21 +34,6 @@
>               'sh4eb', 'sparc', 'sparc64', 'tricore', 'unicore32',
>               'x86_64', 'xtensa', 'xtensaeb' ] }
>  
> -##
> -# @CpuInfoArch:
> -#
> -# An enumeration of cpu types that enable additional information during
> -# @query-cpus-fast.
> -#
> -# @s390: since 2.12
> -#
> -# @riscv: since 2.12
> -#
> -# Since: 2.6
> -##
> -{ 'enum': 'CpuInfoArch',
> -  'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 's390', 'riscv', 'other' ] }
> -
>  ##
>  # @CpuS390State:
>  #
> @@ -86,14 +71,9 @@
>  # @props: properties describing to which node/socket/core/thread
>  #         virtual CPU belongs to, provided if supported by board
>  #
> -# @arch: base architecture of the cpu
> -#
>  # @target: the QEMU system emulation target, which determines which
>  #          additional fields will be listed (since 3.0)
>  #
> -# Features:
> -# @deprecated: Member @arch is deprecated.  Use @target instead.
> -#
>  # Since: 2.12
>  #
>  ##
> @@ -102,8 +82,6 @@
>                        'qom-path'     : 'str',
>                        'thread-id'    : 'int',
>                        '*props'       : 'CpuInstanceProperties',
> -                      'arch'         : { 'type': 'CpuInfoArch',
> -                                         'features': [ 'deprecated' ] },
>                        'target'       : 'SysEmuTarget' },
>    'discriminator' : 'target',
>    'data'          : { 's390x'        : 'CpuInfoS390' } }
> -- 
> 2.29.2
> 

Regards,
Daniel
Thomas Huth March 15, 2021, 11:54 a.m. UTC | #2
On 24/02/2021 14.11, Daniel P. Berrangé wrote:
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>   docs/system/deprecated.rst       |  6 -----
>   docs/system/removed-features.rst |  6 +++++
>   hw/core/machine-qmp-cmds.c       | 41 --------------------------------
>   qapi/machine.json                | 22 -----------------
>   4 files changed, 6 insertions(+), 69 deletions(-)

Patch looks reasonable to me.

Reviewed-by: Thomas Huth <thuth@redhat.com>
diff mbox series

Patch

diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index 484f017119..78474f0845 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -192,12 +192,6 @@  Since the ``dirty-bitmaps`` field is optionally present in both the old and
 new locations, clients must use introspection to learn where to anticipate
 the field if/when it does appear in command output.
 
-``query-cpus-fast`` ``arch`` output member (since 3.0.0)
-''''''''''''''''''''''''''''''''''''''''''''''''''''''''
-
-The ``arch`` output member of the ``query-cpus-fast`` command is
-replaced by the ``target`` output member.
-
 chardev client socket with ``wait`` option (since 4.0)
 ''''''''''''''''''''''''''''''''''''''''''''''''''''''
 
diff --git a/docs/system/removed-features.rst b/docs/system/removed-features.rst
index ad146daf9b..7942c2e513 100644
--- a/docs/system/removed-features.rst
+++ b/docs/system/removed-features.rst
@@ -100,6 +100,12 @@  Use ``migrate_set_parameter`` instead.
 
 The ``query-cpus`` command is replaced by the ``query-cpus-fast`` command.
 
+``query-cpus-fast`` ``arch`` output member (removed in 6.0)
+'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+The ``arch`` output member of the ``query-cpus-fast`` command is
+replaced by the ``target`` output member.
+
 Human Monitor Protocol (HMP) commands
 -------------------------------------
 
diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
index af60cd969d..68a942595a 100644
--- a/hw/core/machine-qmp-cmds.c
+++ b/hw/core/machine-qmp-cmds.c
@@ -24,46 +24,6 @@ 
 #include "sysemu/runstate.h"
 #include "sysemu/sysemu.h"
 
-static CpuInfoArch sysemu_target_to_cpuinfo_arch(SysEmuTarget target)
-{
-    /*
-     * The @SysEmuTarget -> @CpuInfoArch mapping below is based on the
-     * TARGET_ARCH -> TARGET_BASE_ARCH mapping in the "configure" script.
-     */
-    switch (target) {
-    case SYS_EMU_TARGET_I386:
-    case SYS_EMU_TARGET_X86_64:
-        return CPU_INFO_ARCH_X86;
-
-    case SYS_EMU_TARGET_PPC:
-    case SYS_EMU_TARGET_PPC64:
-        return CPU_INFO_ARCH_PPC;
-
-    case SYS_EMU_TARGET_SPARC:
-    case SYS_EMU_TARGET_SPARC64:
-        return CPU_INFO_ARCH_SPARC;
-
-    case SYS_EMU_TARGET_MIPS:
-    case SYS_EMU_TARGET_MIPSEL:
-    case SYS_EMU_TARGET_MIPS64:
-    case SYS_EMU_TARGET_MIPS64EL:
-        return CPU_INFO_ARCH_MIPS;
-
-    case SYS_EMU_TARGET_TRICORE:
-        return CPU_INFO_ARCH_TRICORE;
-
-    case SYS_EMU_TARGET_S390X:
-        return CPU_INFO_ARCH_S390;
-
-    case SYS_EMU_TARGET_RISCV32:
-    case SYS_EMU_TARGET_RISCV64:
-        return CPU_INFO_ARCH_RISCV;
-
-    default:
-        return CPU_INFO_ARCH_OTHER;
-    }
-}
-
 static void cpustate_to_cpuinfo_s390(CpuInfoS390 *info, const CPUState *cpu)
 {
 #ifdef TARGET_S390X
@@ -104,7 +64,6 @@  CpuInfoFastList *qmp_query_cpus_fast(Error **errp)
             value->props = props;
         }
 
-        value->arch = sysemu_target_to_cpuinfo_arch(target);
         value->target = target;
         if (target == SYS_EMU_TARGET_S390X) {
             cpustate_to_cpuinfo_s390(&value->u.s390x, cpu);
diff --git a/qapi/machine.json b/qapi/machine.json
index 9811927504..c0c52aef10 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -34,21 +34,6 @@ 
              'sh4eb', 'sparc', 'sparc64', 'tricore', 'unicore32',
              'x86_64', 'xtensa', 'xtensaeb' ] }
 
-##
-# @CpuInfoArch:
-#
-# An enumeration of cpu types that enable additional information during
-# @query-cpus-fast.
-#
-# @s390: since 2.12
-#
-# @riscv: since 2.12
-#
-# Since: 2.6
-##
-{ 'enum': 'CpuInfoArch',
-  'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 's390', 'riscv', 'other' ] }
-
 ##
 # @CpuS390State:
 #
@@ -86,14 +71,9 @@ 
 # @props: properties describing to which node/socket/core/thread
 #         virtual CPU belongs to, provided if supported by board
 #
-# @arch: base architecture of the cpu
-#
 # @target: the QEMU system emulation target, which determines which
 #          additional fields will be listed (since 3.0)
 #
-# Features:
-# @deprecated: Member @arch is deprecated.  Use @target instead.
-#
 # Since: 2.12
 #
 ##
@@ -102,8 +82,6 @@ 
                       'qom-path'     : 'str',
                       'thread-id'    : 'int',
                       '*props'       : 'CpuInstanceProperties',
-                      'arch'         : { 'type': 'CpuInfoArch',
-                                         'features': [ 'deprecated' ] },
                       'target'       : 'SysEmuTarget' },
   'discriminator' : 'target',
   'data'          : { 's390x'        : 'CpuInfoS390' } }