[PATCH v4 0/5] system: Make qemu_arch_available() common code

Philippe Mathieu-Daudé posted 5 patches 1 month, 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260213175032.32121-1-philmd@linaro.org
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Fam Zheng <fam@euphon.net>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>
meson.build                |  2 --
include/qemu/target-info.h |  7 ++++++
include/system/arch_init.h | 30 -----------------------
system/arch_init.h         | 50 ++++++++++++++++++++++++++++++++++++++
hw/scsi/scsi-disk.c        |  4 +--
system/arch_init.c         |  6 +++--
target-info.c              |  5 ++++
system/meson.build         |  2 +-
8 files changed, 69 insertions(+), 37 deletions(-)
delete mode 100644 include/system/arch_init.h
create mode 100644 system/arch_init.h
[PATCH v4 0/5] system: Make qemu_arch_available() common code
Posted by Philippe Mathieu-Daudé 1 month, 3 weeks ago
- Avoid qemu_arch_available() in hw/
- Document qemu_arch_available(),
- define QEMU_ARCH_* based on SYS_EMU_TARGET_*, allowing
  (via with TargetInfo API) to compile arch_init.c as common,
- restrict qemu_arch_available() scope to system/ sub-directory.

---
v4: New approach
v3: Return directly within switch
v2: Prefer switch over array (pbo)

Philippe Mathieu-Daudé (5):
  qemu: Document qemu_arch_available() method
  qemu/target_info: Add target_s390x() helper
  hw/scsi/disk: Prefer target_s390x() over qemu_arch_available()
  system: Make qemu_arch_available() common code
  system: Reduce 'arch_init.h' scope

 meson.build                |  2 --
 include/qemu/target-info.h |  7 ++++++
 include/system/arch_init.h | 30 -----------------------
 system/arch_init.h         | 50 ++++++++++++++++++++++++++++++++++++++
 hw/scsi/scsi-disk.c        |  4 +--
 system/arch_init.c         |  6 +++--
 target-info.c              |  5 ++++
 system/meson.build         |  2 +-
 8 files changed, 69 insertions(+), 37 deletions(-)
 delete mode 100644 include/system/arch_init.h
 create mode 100644 system/arch_init.h

-- 
2.52.0


Re: [PATCH v4 0/5] system: Make qemu_arch_available() common code
Posted by Thomas Huth 1 month, 3 weeks ago
On 13/02/2026 18.50, Philippe Mathieu-Daudé wrote:
> - Avoid qemu_arch_available() in hw/
> - Document qemu_arch_available(),
> - define QEMU_ARCH_* based on SYS_EMU_TARGET_*, allowing
>    (via with TargetInfo API) to compile arch_init.c as common,
> - restrict qemu_arch_available() scope to system/ sub-directory.
> 
> ---
> v4: New approach
> v3: Return directly within switch
> v2: Prefer switch over array (pbo)
> 
> Philippe Mathieu-Daudé (5):
>    qemu: Document qemu_arch_available() method
>    qemu/target_info: Add target_s390x() helper
>    hw/scsi/disk: Prefer target_s390x() over qemu_arch_available()
>    system: Make qemu_arch_available() common code
>    system: Reduce 'arch_init.h' scope
> 
>   meson.build                |  2 --
>   include/qemu/target-info.h |  7 ++++++
>   include/system/arch_init.h | 30 -----------------------
>   system/arch_init.h         | 50 ++++++++++++++++++++++++++++++++++++++
>   hw/scsi/scsi-disk.c        |  4 +--
>   system/arch_init.c         |  6 +++--
>   target-info.c              |  5 ++++
>   system/meson.build         |  2 +-
>   8 files changed, 69 insertions(+), 37 deletions(-)
>   delete mode 100644 include/system/arch_init.h
>   create mode 100644 system/arch_init.h

Series
Reviewed-by: Thomas Huth <thuth@redhat.com>

... and since arch_init.c only contains one single small function, I think 
you could even go one step further and merge that into another file in 
system/ ... but that could also be done in a later patch.

  Thomas