On 06/05/2026 21.45, Matthew Rosato wrote:
On 5/6/26 1:41 PM, Thomas Huth wrote:
From: Thomas Huth <[email protected]>
The elements that get removed with QTAILQ_REMOVE are never referenced
afterwards anymore, so the corresponding memory should get freed.
Signed-off-by: Thomas Huth <[email protected]>
---
hw/s390x/s390-pci-bus.c | 1 +
hw/s390x/s390-pci-vfio.c | 1 +
2 files changed, 2 insertions(+)
Thanks Thomas! Code looks good and I did some regression testing with
this patch applied:
Reviewed-by: Matthew Rosato <[email protected]>
Tested-by: Matthew Rosato <[email protected]>
Should we also consider adding:
Fixes: b354d5d804 ("s390x/pci: clean up s390 PCI groups")
Fixes: 37fa32de70 ("s390x/pci: Honor DMA limits set by vfio")
Yes, that makes sense.
Actually, looking at the commit description of b354d5d804, I think this code
has been added with a wrong assumption: The unrealize method is not called
during system reset.
So to free the memory, this should likely be added to a reset handler
instead? Could you maybe have a look?
Also out of curiosity, did you just stumble on this or was there some
tooling or testing that was being employed here that found this?
I asked Claude Code to find bugs in the QEMU sources, and this was something
that looked reasonable to me. (I only used Claude to find bugs, the patch
has been 100% written by myself of course)
Thomas