From: David Woodhouse Disconnect only unbound the port, then dropped the pointer, leaking the handle and its file descriptor on every disconnect/reconnect cycle. Close the handle; closing also unbinds. Fixes: b37eeb020123 ("xen/9pfs: introduce Xen 9pfs backend") Reported-by: Hui Peng Closes: https://gitlab.com/qemu-project/qemu/-/work_items/4523 Signed-off-by: David Woodhouse --- hw/9pfs/xen-9p-backend.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c index 6e26a445a09..612f19c45c8 100644 --- a/hw/9pfs/xen-9p-backend.c +++ b/hw/9pfs/xen-9p-backend.c @@ -392,8 +392,7 @@ static void xen_9pfs_disconnect(struct XenLegacyDevice *xendev) if (xen_9pdev->rings[i].evtchndev != NULL) { qemu_set_fd_handler(qemu_xen_evtchn_fd(xen_9pdev->rings[i].evtchndev), NULL, NULL, NULL); - qemu_xen_evtchn_unbind(xen_9pdev->rings[i].evtchndev, - xen_9pdev->rings[i].local_port); + qemu_xen_evtchn_close(xen_9pdev->rings[i].evtchndev); xen_9pdev->rings[i].evtchndev = NULL; } if (xen_9pdev->rings[i].data != NULL) { -- 2.43.0