All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 00/24] Fix various QOM object life-cycle issues
@ 2026-05-16  7:58 Marc-André Lureau
  2026-05-16  7:59 ` [PATCH v3 01/24] ui/vt100: add vt100_fini() check Marc-André Lureau
                   ` (24 more replies)
  0 siblings, 25 replies; 54+ messages in thread
From: Marc-André Lureau @ 2026-05-16  7:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: armbru, Marc-André Lureau

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>
---
Changes in v3:
- update "hw/ipmi: reject NULL 'bmc'" & "hw/xlnx_dp: reject NULL
  'dpdma'"
- fixed user-only build in target/riscv patch
- add "ui/vt100: add vt100_fini() check" patch
- rebased after PR with first half of series patches landed
- Link to v2: https://lore.kernel.org/qemu-devel/20260504-qom-tests-v2-0-ef7e3dc94f7a@redhat.com

Changes in v2:
- tweak error messages
- drop "qom: skip link property check callback", instead
  added two patches to avoid crash on NULL link check, and doc update
- drop "RFC system/ioport" in favour of Peter Xu fix
- added "hw/fsi: move OPBus qbus_init() to instance_init" to address TODO comment
- added "target/riscv: use hash table as set for user_options"
- gather a-b/r-b trailers
- Link to v1: https://lore.kernel.org/qemu-devel/20260427-qom-tests-v1-0-c413f3605311@redhat.com

---
Marc-André Lureau (24):
      ui/vt100: add vt100_fini() check
      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/ipmi: reject NULL 'bmc' property rather than crash
      hw/xlnx_dp: reject NULL 'dpdma' property rather than crash
      hw/intc/apic: move checks to realize()
      backends/cryptodev-lkcf: skip cleanup when not initialized
      system/ioport: minor code simplification
      hw/core/machine: free shim_filename on finalization
      net/filter: free old values in property setters
      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
      hw/i386/pc: free pcspk on finalization
      hw/tpm: free PPI buffer on finalization
      hw/loongarch/virt: free flash devices and OEM strings on finalization
      hw/ppc/spapr: free host_model and host_serial on finalization
      target/riscv: fix general_user_opts hash table leak
      target/riscv: use hash table as set for user_options
      hw/i2c/pmbus: fix undefined behavior in pmbus_direct_mode2data
      qtest: add "qom-tests" command

 target/riscv/cpu.h                  |  3 ++-
 tests/qtest/libqtest.h              |  8 ++++++
 backends/cryptodev-lkcf.c           |  4 +++
 chardev/char-socket.c               |  4 +++
 hw/core/machine.c                   |  1 +
 hw/display/xlnx_dp.c                |  6 +++++
 hw/i2c/pmbus_device.c               |  4 +--
 hw/i386/nitro_enclave.c             | 11 ++++++++
 hw/i386/pc.c                        | 10 +++++++
 hw/intc/apic_common.c               | 23 +++++++++-------
 hw/ipmi/ipmi.c                      |  8 +++++-
 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/spapr.c                      |  2 ++
 hw/tpm/tpm_tis_sysbus.c             |  9 +++++++
 net/filter.c                        |  2 ++
 system/ioport.c                     |  3 +--
 system/qtest.c                      | 46 ++++++++++++++++++++++++++++++++
 target/i386/cpu-apic.c              |  6 +----
 target/i386/kvm/tdx.c               |  5 ++++
 target/i386/sev.c                   | 37 ++++++++++++++++++++++++++
 target/riscv/cpu.c                  | 53 ++++++++++++++++++++++---------------
 target/riscv/kvm/kvm-cpu.c          |  6 ++---
 tests/qtest/libqtest.c              |  6 +++++
 tests/qtest/qom-test.c              | 12 +++++++++
 ui/vt100.c                          |  3 +++
 29 files changed, 282 insertions(+), 53 deletions(-)
---
base-commit: 0bbb0c2b65db64c161f91d10a89269e6d319d2a7
change-id: 20260427-qom-tests-9dcf3b969411

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



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

end of thread, other threads:[~2026-06-04 20:35 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-16  7:58 [PATCH v3 00/24] Fix various QOM object life-cycle issues Marc-André Lureau
2026-05-16  7:59 ` [PATCH v3 01/24] ui/vt100: add vt100_fini() check Marc-André Lureau
2026-06-04 15:56   ` Daniel P. Berrangé
2026-05-16  7:59 ` [PATCH v3 02/24] hw/pci: handle missing bus in prop_pci_busnr_get Marc-André Lureau
2026-06-04 14:50   ` Daniel P. Berrangé
2026-05-16  7:59 ` [PATCH v3 03/24] chardev/char-socket: handle NULL addr in char_socket_get_addr Marc-André Lureau
2026-06-04 14:47   ` Daniel P. Berrangé
2026-05-16  7:59 ` [PATCH v3 04/24] hw/pci-bridge: handle missing parent in prop_pxb_uid_get Marc-André Lureau
2026-06-04 14:47   ` Daniel P. Berrangé
2026-05-16  7:59 ` [PATCH v3 05/24] hw/pci-host/i440fx: handle NULL bus in pci-hole64 getters Marc-André Lureau
2026-06-04 14:48   ` Daniel P. Berrangé
2026-05-16  7:59 ` [PATCH v3 06/24] hw/pci-host/q35: " Marc-André Lureau
2026-06-04 14:49   ` Daniel P. Berrangé
2026-05-16  7:59 ` [PATCH v3 07/24] hw/ipmi: reject NULL 'bmc' property rather than crash Marc-André Lureau
2026-06-04 16:01   ` Daniel P. Berrangé
2026-05-16  7:59 ` [PATCH v3 08/24] hw/xlnx_dp: reject NULL 'dpdma' " Marc-André Lureau
2026-06-04 16:02   ` Daniel P. Berrangé
2026-05-16  7:59 ` [PATCH v3 09/24] hw/intc/apic: move checks to realize() Marc-André Lureau
2026-06-04 16:03   ` Daniel P. Berrangé
2026-05-16  7:59 ` [PATCH v3 10/24] backends/cryptodev-lkcf: skip cleanup when not initialized Marc-André Lureau
2026-06-04 16:04   ` Daniel P. Berrangé
2026-05-16  7:59 ` [PATCH v3 11/24] system/ioport: minor code simplification Marc-André Lureau
2026-06-04 15:06   ` Daniel P. Berrangé
2026-05-16  7:59 ` [PATCH v3 12/24] hw/core/machine: free shim_filename on finalization Marc-André Lureau
2026-06-04 14:50   ` Daniel P. Berrangé
2026-05-16  7:59 ` [PATCH v3 13/24] net/filter: free old values in property setters Marc-André Lureau
2026-06-04 14:52   ` Daniel P. Berrangé
2026-05-16  7:59 ` [PATCH v3 14/24] target/i386/sev: add finalize functions and fix leaking setters Marc-André Lureau
2026-06-04 14:55   ` Daniel P. Berrangé
2026-05-16  7:59 ` [PATCH v3 15/24] target/i386/kvm/tdx: free strings in tdx_guest_finalize Marc-André Lureau
2026-06-04 14:56   ` Daniel P. Berrangé
2026-05-16  7:59 ` [PATCH v3 16/24] hw/i386/nitro_enclave: add instance finalize Marc-André Lureau
2026-06-04 15:01   ` Daniel P. Berrangé
2026-06-04 20:18     ` Marc-André Lureau
2026-05-16  7:59 ` [PATCH v3 17/24] hw/i386/pc: free pcspk on finalization Marc-André Lureau
2026-06-04 15:02   ` Daniel P. Berrangé
2026-05-16  7:59 ` [PATCH v3 18/24] hw/tpm: free PPI buffer " Marc-André Lureau
2026-05-21 20:17   ` Arun Menon
2026-05-21 21:16     ` Marc-André Lureau
2026-05-29  9:17   ` Peter Maydell
2026-05-29 10:55     ` Marc-André Lureau
2026-05-16  7:59 ` [PATCH v3 19/24] hw/loongarch/virt: free flash devices and OEM strings " Marc-André Lureau
2026-05-16  7:59 ` [PATCH v3 20/24] hw/ppc/spapr: free host_model and host_serial " Marc-André Lureau
2026-06-04 16:05   ` Daniel P. Berrangé
2026-05-16  7:59 ` [PATCH v3 21/24] target/riscv: fix general_user_opts hash table leak Marc-André Lureau
2026-06-03  1:01   ` Alistair Francis
2026-05-16  7:59 ` [PATCH v3 22/24] target/riscv: use hash table as set for user_options Marc-André Lureau
2026-06-03  1:02   ` Alistair Francis
2026-05-16  7:59 ` [PATCH v3 23/24] hw/i2c/pmbus: fix undefined behavior in pmbus_direct_mode2data Marc-André Lureau
2026-06-04 16:10   ` Daniel P. Berrangé
2026-06-04 20:34     ` Marc-André Lureau
2026-05-16  7:59 ` [PATCH v3 24/24] qtest: add "qom-tests" command Marc-André Lureau
2026-06-04 16:14   ` Daniel P. Berrangé
2026-05-20 13:34 ` [PATCH v3 00/24] Fix various QOM object life-cycle issues Marc-André Lureau

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.