[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PULL 17/21] hw/9pfs/xen-9p-backend: Close event channel handle on disconnect



From: David Woodhouse <dwmw@xxxxxxxxxxxx>

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 <benquike@xxxxxxxxx>
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4523
Reviewed-by: Paul Durrant <paul@xxxxxxx>
Signed-off-by: David Woodhouse <dwmw@xxxxxxxxxxxx>
---
 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 6e26a445a0..612f19c45c 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.55.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.