qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH-for-7.0] softmmu: List CPU types again


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH-for-7.0] softmmu: List CPU types again
Date: Thu, 10 Mar 2022 14:56:49 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1

On 10/3/22 13:23, Thomas Huth wrote:
On 10/03/2022 12.55, Philippe Mathieu-Daudé wrote:
From: Philippe Mathieu-Daudé <f4bug@amsat.org>

Commit e0220bb5b2 made cpus.c target-agnostic but didn't notice
the cpu_list() function is only defined in target-specific code
in "cpu.h". Extract list_cpus() from the generic cpus.c into a
new target-specific unit.

Fixes: e0220bb5b2 ("softmmu: Build target-agnostic objects once")
Reported-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
  softmmu/cpus.c      |  8 --------
  softmmu/cpus_list.c | 36 ++++++++++++++++++++++++++++++++++++
  softmmu/meson.build |  1 +
  3 files changed, 37 insertions(+), 8 deletions(-)
  create mode 100644 softmmu/cpus_list.c

diff --git a/softmmu/cpus.c b/softmmu/cpus.c
index e1d84c8ccb..7b75bb66d5 100644
--- a/softmmu/cpus.c
+++ b/softmmu/cpus.c
@@ -728,14 +728,6 @@ int vm_stop_force_state(RunState state)
      }
  }
-void list_cpus(const char *optarg)
-{
-    /* XXX: implement xxx_cpu_list for targets that still miss it */
-#if defined(cpu_list)
-    cpu_list();
-#endif
-}
-
  void qmp_memsave(int64_t addr, int64_t size, const char *filename,
                   bool has_cpu, int64_t cpu_index, Error **errp)
  {
diff --git a/softmmu/cpus_list.c b/softmmu/cpus_list.c
new file mode 100644
index 0000000000..59ef604423
--- /dev/null
+++ b/softmmu/cpus_list.c

The other cpu*.c files in softmmu use a "-" instead of "_", so I'd also use a "-" for cpu-list.c.

I guess I used '_' copy/pasting from arch_init.c:

 specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: [files(
   'arch_init.c',
+  'cpus_list.c',
   'ioport.c',

I don't mind changing, but it would be better to standardize that on
a project scope / level.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]