qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Move net backend cleanup to NIC cleanup
@ 2024-09-12 16:54 Eugenio Pérez
  2024-09-12 16:54 ` [PATCH v2 1/2] net: parameterize the removing client from nc list Eugenio Pérez
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Eugenio Pérez @ 2024-09-12 16:54 UTC (permalink / raw)
  To: Jason Wang, qemu-devel
  Cc: dtatulea, mcoqueli, mst, si-wei.liu, qemu-stable, leiyang,
	Ani Sinha

Commit a0d7215e33 ("vhost-vdpa: do not cleanup the vdpa/vhost-net
structures if peer nic is present") effectively delayed the backend
cleanup, allowing the frontend or the guest to access it resources as
long as the frontend NIC is still visible to the guest.

However it does not clean up the resources until the qemu process is
over.  This causes an effective leak if the device is deleted with
device_del, as there is no way to close the vdpa device.  This makes
impossible to re-add that device to this or other QEMU instances until
the first instance of QEMU is finished.

Move the cleanup from qemu_cleanup to the NIC deletion.

v2:
Remove NIC peer also at net_cleanup. vhost-user trust all the
backends are clean before qemu removes char devices.

This is not a requisite introduced by this commit as
system/runstate.c:qemu_cleanup shows.

Eugenio Pérez (2):
  net: parameterize the removing client from nc list
  net: move backend cleanup to NIC cleanup

 net/net.c        | 44 ++++++++++++++++++++++++++++++++++----------
 net/vhost-vdpa.c |  8 --------
 2 files changed, 34 insertions(+), 18 deletions(-)

-- 
2.46.0



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

end of thread, other threads:[~2025-01-06 16:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-12 16:54 [PATCH v2 0/2] Move net backend cleanup to NIC cleanup Eugenio Pérez
2024-09-12 16:54 ` [PATCH v2 1/2] net: parameterize the removing client from nc list Eugenio Pérez
2024-09-12 16:54 ` [PATCH v2 2/2] net: move backend cleanup to NIC cleanup Eugenio Pérez
2024-09-18  3:57   ` Si-Wei Liu
2024-10-09  8:34     ` Jason Wang
2024-10-23  4:04   ` Jason Wang
2024-12-20 21:01 ` [PATCH v2 0/2] Move net " Michael Tokarev
2024-12-23 16:33   ` Eugenio Perez Martin
2025-01-06 16:03     ` Jonah Palmer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).