Skip to content

qom: pass TargetInfo to is_available

Yonggang Luo qemu-arm qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2target-info: move selection into QOMbsd-user/main.c include/qemu/target-info-impl.h include/qemu/target-info-init.h +4 more+48 -250 replies
2/2qom: pass TargetInfo to is_availablehw/arm/aspeed_ast27x0-fc.c hw/arm/aspeed_ast27x0_evb.c hw/arm/raspi.c +5 more+42 -121 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] qom: pass TargetInfo to is_available

TypeInfo.is_available currently has no TargetInfo argument, so QOM cannot ask a type whether it is available for the selected target without a wrapper around target_aarch64() or similar. This series moves target selection into QOM and passes TargetInfo into is_available.

- Move target_info() from target-info-qom.c into qom/object.c so QOM can read the current TargetInfo without a target-info-qom cycle. Add target_info_select() to install the TargetInfo once. target_info() is NULL until that call. Keep TargetInfo as an incomplete type in object.h. User-mode binaries select the sole TargetInfo from MODULE_INIT_TARGET_INFO, which now runs before MODULE_INIT_QOM.
- Change TypeInfo.is_available to take const TargetInfo *. Add target_is_riscv64() and target_is_aarch64() for TypeInfo callbacks. Keep target_riscv64() and target_aarch64() as wrappers around the current TargetInfo. Point existing ARM machine is_available callbacks at target_is_aarch64().

Yonggang Luo (2):
target-info: move selection into QOM
qom: pass TargetInfo to is_available

 bsd-user/main.c                 |  1 +
 hw/arm/aspeed_ast27x0-fc.c      |  2 +-
 hw/arm/aspeed_ast27x0_evb.c     |  4 ++--
 hw/arm/raspi.c                  |  4 ++--
 hw/arm/raspi4b.c                |  2 +-
 include/qemu/target-info-impl.h | 13 ++++---------
 include/qemu/target-info-init.h | 18 ++++++++++--------
 include/qemu/target-info.h      | 18 ++++++++++++++++++
 include/qom/object.h            | 26 +++++++++++++++++++++++---
 linux-user/main.c               |  1 +
 qom/object.c                    | 15 ++++++++++++++-
 target-info-qom.c               |  9 +--------
 target-info.c                   | 14 ++++++++++++--
 13 files changed, 90 insertions(+), 37 deletions(-)
Signature · 1 line
2.52.0.windows.1