mbox series

[PATCH-for-9.0,00/25] memory: Propagate Error* when possible

Message ID 20231120213301.24349-1-philmd@linaro.org
Headers show
Series memory: Propagate Error* when possible | expand

Message

Philippe Mathieu-Daudé Nov. 20, 2023, 9:32 p.m. UTC
Hi,

This series is remotely connected with the "dynamic machine"
project. We need QOM objects created either from command line,
QMP or loaded by modules to NOT fail exiting the whole QEMU
process, but cleanly propagate any error before failing cleanly.

In preparation for that big goal, we start reworking a bit the
Memory API to be able to propagate all errors.

This targets the 9.0 release, but posting earlier to discuss with
Markus meanwhile.

Regards,

Phil.

Philippe Mathieu-Daudé (25):
  memory: Have memory_region_init_ram_flags_nomigrate() return a boolean
  memory: Have memory_region_init_ram_nomigrate() handler return a
    boolean
  memory: Have memory_region_init_rom_nomigrate() handler return a
    boolean
  memory: Simplify memory_region_init_rom_nomigrate() calls
  memory: Simplify memory_region_init_ram_from_fd() calls
  memory: Have memory_region_init_ram() handler return a boolean
  memory: Have memory_region_init_rom() handler return a boolean
  memory: Have memory_region_init_rom_device_nomigrate() return a
    boolean
  memory: Simplify memory_region_init_rom_device_nomigrate() calls
  memory: Have memory_region_init_rom_device() handler return a boolean
  memory: Have memory_region_init_resizeable_ram() return a boolean
  memory: Have memory_region_init_ram_from_file() handler return a
    boolean
  memory: Have memory_region_init_ram_from_fd() handler return a boolean
  backends: Use g_autofree in HostMemoryBackendClass::alloc() handlers
  backends: Simplify host_memory_backend_memory_complete()
  backends: Have HostMemoryBackendClass::alloc() handler return a
    boolean
  backends: Reduce variable scope in host_memory_backend_memory_complete
  util/oslib: Have qemu_prealloc_mem() handler return a boolean
  misc: Simplify qemu_prealloc_mem() calls
  hw: Simplify memory_region_init_ram() calls
  hw/arm: Simplify memory_region_init_rom() calls
  hw/sparc: Simplify memory_region_init_ram_nomigrate() calls
  hw/misc: Simplify memory_region_init_ram_from_fd() calls
  hw/nvram: Simplify memory_region_init_rom_device() calls
  hw/pci-host/raven: Propagate error in raven_realize()

 include/exec/memory.h    |  40 ++++++++---
 include/qemu/osdep.h     |   4 +-
 include/sysemu/hostmem.h |  10 ++-
 backends/hostmem-epc.c   |  14 ++--
 backends/hostmem-file.c  |  22 +++---
 backends/hostmem-memfd.c |  13 ++--
 backends/hostmem-ram.c   |  12 ++--
 backends/hostmem.c       | 144 ++++++++++++++++++---------------------
 hw/arm/aspeed_ast2400.c  |   6 +-
 hw/arm/aspeed_ast2600.c  |   6 +-
 hw/arm/fsl-imx25.c       |  19 ++----
 hw/arm/fsl-imx31.c       |  19 ++----
 hw/arm/fsl-imx6.c        |  19 ++----
 hw/arm/integratorcp.c    |   7 +-
 hw/arm/nrf51_soc.c       |   7 +-
 hw/misc/ivshmem.c        |   8 +--
 hw/nvram/nrf51_nvm.c     |   7 +-
 hw/pci-host/raven.c      |   6 +-
 hw/ppc/rs6000_mc.c       |   7 +-
 hw/sparc/sun4m.c         |  20 ++----
 hw/sparc64/sun4u.c       |   7 +-
 hw/virtio/virtio-mem.c   |   6 +-
 system/memory.c          |  68 ++++++++++--------
 util/oslib-posix.c       |   7 +-
 util/oslib-win32.c       |   4 +-
 25 files changed, 234 insertions(+), 248 deletions(-)