All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/41] Fix various QOM object life-cycle issues
@ 2026-04-27 19:41 Marc-André Lureau
  2026-04-27 19:42 ` [PATCH 01/41] hw/pci: handle missing bus in prop_pci_busnr_get Marc-André Lureau
                   ` (40 more replies)
  0 siblings, 41 replies; 90+ messages in thread
From: Marc-André Lureau @ 2026-04-27 19:41 UTC (permalink / raw)
  To: qemu-devel
  Cc: armbru, Marc-André Lureau, jag.raman, Elena Ufimtseva,
	peterx, Daniel P. Berrangé, Zhang Chen, Li Zhijian,
	Jason Wang, Paolo Bonzini, Philippe Mathieu-Daudé,
	Michael S. Tsirkin, Gonglei (Arei), zhenwei pi, Richard Henderson,
	Zhao Liu, Peter Maydell, Marcelo Tosatti, kvm, Alexander Graf,
	Dorjoy Chowdhury, Pavel Pisa, Francisco Iglesias, Vikram Garhwal,
	Gerd Hoffmann, Stefano Garzarella, Ani Sinha, Fam Zheng,
	qemu-block, Fabiano Rosas, Laurent Vivier, Ninad Palsule,
	Cédric Le Goater, Steven Lee, Troy Lee, Jamin Lin, Kane Chen,
	Andrew Jeffery, Joel Stanley, qemu-arm, Glenn Miles, qemu-ppc,
	Stefan Berger, Leif Lindholm, Song Gao, Bibo Mao, Jiaxun Yang,
	Nicholas Piggin, Harsh Prateek Bora, Aditya Gupta, Palmer Dabbelt,
	Alistair Francis, Weiwei Li, Daniel Henrique Barboza, Liu Zhiwei,
	Chao Liu, qemu-riscv, Titus Rwantare

Hi,

After Markus's "Several QOM objects crash on introspection" report, I
started writing some unit test.

This series adds a new "qom-tests" qtest command that exercises basic QOM
object life-cycle: it instantiates all non-abstract object types, gets/sets
their properties, and unrefs them. This quickly surfaces leaks and crashes
that could otherwise be triggered at runtime via QMP qom commands.

The bulk of the series fixes the issues found by this test and ASan
help. Some of the patches are redundant with patches sent earlier on the
ML and marked as RFC, they should naturally be dropped during rebases,
but are added for completeness and to make sure CI pass after this
series in the meantime.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
Marc-André Lureau (41):
      hw/pci: handle missing bus in prop_pci_busnr_get
      chardev/char-socket: handle NULL addr in char_socket_get_addr
      hw/pci-bridge: handle missing parent in prop_pxb_uid_get
      hw/pci-host/i440fx: handle NULL bus in pci-hole64 getters
      hw/pci-host/q35: handle NULL bus in pci-hole64 getters
      hw/remote: check visit return in vfu_object_set_socket
      qom: skip link property check callback when clearing link
      hw/intc/apic: guard against NULL cpu in set_id
      RFC hw/remote: guard listener unregister in finalize
      backends/cryptodev-lkcf: skip cleanup when not initialized
      RFC io/net-listener: move mutex init to instance_init
      RFC net/colo-compare: guard finalize against uninitialized state
      RFC system/ioport: move embedded memory region cleanup to portio_list_destroy
      ui/console: remove console from global list on finalization
      hw/i386/x86: free oem_id and oem_table_id on finalization
      hw/core/machine: free shim_filename on finalization
      hw/core/resetcontainer: free children array on finalization
      net/filter: free old values in property setters
      ui/console-vc: destroy fifo on text console finalization
      target/i386/sev: add finalize functions and fix leaking setters
      target/i386/kvm/tdx: free strings in tdx_guest_finalize
      hw/i386/nitro_enclave: add instance finalize
      net/can: free ifname on socketcan finalization
      backends/igvm-cfg: free filename on finalization
      scsi/pr-manager-helper: free path on finalization
      accel/kvm: free device path on finalization
      system/qtest: free log path on finalization
      hw/i386/pc: free pcspk on finalization
      hw/fsi: move OPBus address space init to realize
      hw/gpio/pca9552: fix state_str leak in pca955x_set_led
      hw/arm/aspeed: free fmc_model and spi_model on finalization
      hw/tpm: free PPI buffer on finalization
      hw/arm/sbsa-ref: free unrealized flash devices on finalization
      hw/arm/virt: free flash devices and OEM strings on finalization
      hw/loongarch/virt: free flash devices and OEM strings on finalization
      hw/ppc/spapr: free host_model and host_serial on finalization
      hw/ppc/pnv: drop extra ref on PHB after adding as child
      target/riscv: fix general_user_opts hash table leak
      hw/riscv/virt: free flash devices and OEM strings on finalization
      hw/i2c/pmbus: fix undefined behavior in pmbus_direct_mode2data
      qtest: add "qom-tests" command

 tests/qtest/libqtest.h              |  8 ++++++
 accel/kvm/kvm-all.c                 |  8 ++++++
 backends/cryptodev-lkcf.c           |  4 +++
 backends/igvm-cfg.c                 |  1 +
 chardev/char-socket.c               |  4 +++
 hw/arm/aspeed.c                     |  9 +++++++
 hw/arm/sbsa-ref.c                   | 12 +++++++++
 hw/arm/virt.c                       | 14 ++++++++++
 hw/core/machine.c                   |  1 +
 hw/core/resetcontainer.c            |  3 +++
 hw/fsi/aspeed_apb2opb.c             | 31 +++++++++++++++------
 hw/gpio/pca9552.c                   |  2 +-
 hw/i2c/pmbus_device.c               |  4 +--
 hw/i386/nitro_enclave.c             | 11 ++++++++
 hw/i386/pc.c                        | 10 +++++++
 hw/i386/x86.c                       |  9 +++++++
 hw/intc/apic_common.c               |  2 +-
 hw/loongarch/virt.c                 | 14 ++++++++++
 hw/pci-bridge/pci_expander_bridge.c |  8 +++++-
 hw/pci-host/i440fx.c                | 15 +++++++++--
 hw/pci-host/q35.c                   | 15 +++++++++--
 hw/pci/pci.c                        | 11 ++++++--
 hw/ppc/pnv.c                        |  1 +
 hw/ppc/spapr.c                      |  2 ++
 hw/remote/remote-obj.c              |  4 ++-
 hw/remote/vfio-user-obj.c           |  4 ++-
 hw/riscv/virt.c                     | 14 ++++++++++
 hw/tpm/tpm_tis_sysbus.c             |  9 +++++++
 io/net-listener.c                   |  9 ++++++-
 net/can/can_socketcan.c             |  8 ++++++
 net/colo-compare.c                  | 31 +++++++++++----------
 net/filter.c                        |  2 ++
 qom/object.c                        | 10 ++++---
 scsi/pr-manager-helper.c            |  1 +
 system/ioport.c                     |  4 ++-
 system/qtest.c                      | 54 +++++++++++++++++++++++++++++++++++++
 target/i386/kvm/tdx.c               |  5 ++++
 target/i386/sev.c                   | 37 +++++++++++++++++++++++++
 target/riscv/cpu.c                  |  7 +++++
 tests/qtest/libqtest.c              |  6 +++++
 tests/qtest/qom-test.c              | 12 +++++++++
 ui/console-vc.c                     |  1 +
 ui/console.c                        |  6 ++++-
 43 files changed, 379 insertions(+), 44 deletions(-)
---
base-commit: aa15257174da180c6a8a9d58f87319cfe61c5520
change-id: 20260427-qom-tests-9dcf3b969411

Best regards,
--  
Marc-André Lureau <marcandre.lureau@redhat.com>


^ permalink raw reply	[flat|nested] 90+ messages in thread

end of thread, other threads:[~2026-05-11 14:34 UTC | newest]

Thread overview: 90+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-27 19:41 [PATCH 00/41] Fix various QOM object life-cycle issues Marc-André Lureau
2026-04-27 19:42 ` [PATCH 01/41] hw/pci: handle missing bus in prop_pci_busnr_get Marc-André Lureau
2026-04-27 19:42 ` [PATCH 02/41] chardev/char-socket: handle NULL addr in char_socket_get_addr Marc-André Lureau
2026-04-27 19:42 ` [PATCH 03/41] hw/pci-bridge: handle missing parent in prop_pxb_uid_get Marc-André Lureau
2026-04-27 19:42 ` [PATCH 04/41] hw/pci-host/i440fx: handle NULL bus in pci-hole64 getters Marc-André Lureau
2026-04-27 21:00   ` Philippe Mathieu-Daudé
2026-04-28  6:10     ` Marc-André Lureau
2026-04-28  6:14       ` Philippe Mathieu-Daudé
2026-04-27 19:42 ` [PATCH 05/41] hw/pci-host/q35: " Marc-André Lureau
2026-04-27 19:42 ` [PATCH 06/41] hw/remote: check visit return in vfu_object_set_socket Marc-André Lureau
2026-04-27 20:38   ` Jagannathan Raman
2026-04-27 19:42 ` [PATCH 07/41] qom: skip link property check callback when clearing link Marc-André Lureau
2026-04-30 15:48   ` Peter Maydell
2026-04-27 19:42 ` [PATCH 08/41] hw/intc/apic: guard against NULL cpu in set_id Marc-André Lureau
2026-04-27 20:40   ` Philippe Mathieu-Daudé
2026-05-03  8:19     ` marcandre.lureau
2026-04-27 19:42 ` [PATCH 09/41] RFC hw/remote: guard listener unregister in finalize Marc-André Lureau
2026-04-27 19:58   ` Jagannathan Raman
2026-04-28 10:17     ` Marc-André Lureau
2026-04-27 19:42 ` [PATCH 10/41] backends/cryptodev-lkcf: skip cleanup when not initialized Marc-André Lureau
2026-04-28  0:05   ` zhenwei pi
2026-04-27 19:42 ` [PATCH 11/41] RFC io/net-listener: move mutex init to instance_init Marc-André Lureau
2026-04-28  7:05   ` Daniel P. Berrangé
2026-04-29 21:08   ` Peter Xu
2026-04-27 19:42 ` [PATCH 12/41] RFC net/colo-compare: guard finalize against uninitialized state Marc-André Lureau
2026-04-29 20:58   ` Peter Xu
2026-04-29 21:09     ` Marc-André Lureau
2026-04-29 22:24       ` Peter Xu
2026-04-27 19:42 ` [PATCH 13/41] RFC system/ioport: move embedded memory region cleanup to portio_list_destroy Marc-André Lureau
2026-04-29 21:07   ` Peter Xu
2026-05-04  7:11     ` marcandre.lureau
2026-04-27 19:42 ` [PATCH 14/41] ui/console: remove console from global list on finalization Marc-André Lureau
2026-04-27 19:42 ` [PATCH 15/41] hw/i386/x86: free oem_id and oem_table_id " Marc-André Lureau
2026-04-27 20:41   ` Philippe Mathieu-Daudé
2026-04-27 19:42 ` [PATCH 16/41] hw/core/machine: free shim_filename " Marc-André Lureau
2026-04-27 19:42 ` [PATCH 17/41] hw/core/resetcontainer: free children array " Marc-André Lureau
2026-04-30 15:50   ` Peter Maydell
2026-04-27 19:42 ` [PATCH 18/41] net/filter: free old values in property setters Marc-André Lureau
2026-04-27 19:42 ` [PATCH 19/41] ui/console-vc: destroy fifo on text console finalization Marc-André Lureau
2026-04-27 19:42 ` [PATCH 20/41] target/i386/sev: add finalize functions and fix leaking setters Marc-André Lureau
2026-04-27 19:42 ` [PATCH 21/41] target/i386/kvm/tdx: free strings in tdx_guest_finalize Marc-André Lureau
2026-04-27 19:42 ` [PATCH 22/41] hw/i386/nitro_enclave: add instance finalize Marc-André Lureau
2026-04-27 19:42 ` [PATCH 23/41] net/can: free ifname on socketcan finalization Marc-André Lureau
2026-04-28  8:25   ` Pavel Pisa
2026-04-27 19:42 ` [PATCH 24/41] backends/igvm-cfg: free filename on finalization Marc-André Lureau
2026-04-28  6:55   ` Gerd Hoffmann
2026-04-27 19:42 ` [PATCH 25/41] scsi/pr-manager-helper: free path " Marc-André Lureau
2026-04-30 15:51   ` Peter Maydell
2026-04-27 19:42 ` [PATCH 26/41] accel/kvm: free device " Marc-André Lureau
2026-04-30 15:56   ` Peter Maydell
2026-04-27 19:42 ` [PATCH 27/41] system/qtest: free log " Marc-André Lureau
2026-04-30 16:01   ` Peter Maydell
2026-05-04  7:23     ` marcandre.lureau
2026-04-27 19:42 ` [PATCH 28/41] hw/i386/pc: free pcspk " Marc-André Lureau
2026-04-27 19:42 ` [PATCH 29/41] hw/fsi: move OPBus address space init to realize Marc-André Lureau
2026-04-30 16:09   ` Peter Maydell
2026-04-30 17:47     ` Cédric Le Goater
2026-04-27 19:42 ` [PATCH 30/41] hw/gpio/pca9552: fix state_str leak in pca955x_set_led Marc-André Lureau
2026-04-27 20:19   ` Miles Glenn
2026-04-27 20:46   ` Philippe Mathieu-Daudé
2026-04-27 19:42 ` [PATCH 31/41] hw/arm/aspeed: free fmc_model and spi_model on finalization Marc-André Lureau
2026-04-30 17:32   ` Cédric Le Goater
2026-04-27 19:42 ` [PATCH 32/41] hw/tpm: free PPI buffer " Marc-André Lureau
2026-04-27 20:29   ` Stefan Berger
2026-04-27 19:42 ` [PATCH 33/41] hw/arm/sbsa-ref: free unrealized flash devices " Marc-André Lureau
2026-04-27 20:49   ` Philippe Mathieu-Daudé
2026-04-27 19:42 ` [PATCH 34/41] hw/arm/virt: free flash devices and OEM strings " Marc-André Lureau
2026-04-27 20:50   ` Philippe Mathieu-Daudé
2026-04-30 15:12   ` Peter Maydell
2026-04-30 15:18     ` Philippe Mathieu-Daudé
2026-04-30 15:30       ` Peter Maydell
2026-05-11 13:01         ` Marc-André Lureau
2026-05-11 14:33           ` Peter Maydell
2026-04-27 19:42 ` [PATCH 35/41] hw/loongarch/virt: " Marc-André Lureau
2026-04-27 19:42 ` [PATCH 36/41] hw/ppc/spapr: free host_model and host_serial " Marc-André Lureau
2026-04-27 19:42 ` [PATCH 37/41] hw/ppc/pnv: drop extra ref on PHB after adding as child Marc-André Lureau
2026-04-27 20:20   ` Miles Glenn
2026-05-10  9:02   ` Aditya Gupta
2026-04-27 19:42 ` [PATCH 38/41] target/riscv: fix general_user_opts hash table leak Marc-André Lureau
2026-05-01  1:53   ` Alistair Francis
2026-05-04 10:29     ` marcandre.lureau
2026-05-05 15:43     ` Daniel Henrique Barboza
2026-04-27 19:42 ` [PATCH 39/41] hw/riscv/virt: free flash devices and OEM strings on finalization Marc-André Lureau
2026-04-27 20:51   ` Philippe Mathieu-Daudé
2026-04-28  2:19   ` Alistair Francis
2026-04-27 19:42 ` [PATCH 40/41] hw/i2c/pmbus: fix undefined behavior in pmbus_direct_mode2data Marc-André Lureau
2026-04-27 19:42 ` [PATCH 41/41] qtest: add "qom-tests" command Marc-André Lureau
2026-04-27 20:06   ` Peter Maydell
2026-04-28  6:37     ` Marc-André Lureau
2026-04-28  7:48       ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.