[PATCH 6/7] kvm tools: 9p don't nuke fids on attach

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

 



We're not supposed to kill all fids when a new attach request
arrives. This used to cause issues when the guest would send
multiple attach requests.

Signed-off-by: Sasha Levin <levinsasha928@xxxxxxxxx>
---
 tools/kvm/virtio/9p.c | 22 ----------------------
 1 file changed, 22 deletions(-)

diff --git a/tools/kvm/virtio/9p.c b/tools/kvm/virtio/9p.c
index 27ef57b..d668106 100644
--- a/tools/kvm/virtio/9p.c
+++ b/tools/kvm/virtio/9p.c
@@ -117,26 +117,6 @@ static void close_fid(struct p9_dev *p9dev, u32 fid)
 	free(pfid);
 }
 
-static void clear_all_fids(struct p9_dev *p9dev)
-{
-	struct rb_node *node = rb_first(&p9dev->fids);
-
-	while (node) {
-		struct p9_fid *fid = rb_entry(node, struct p9_fid, node);
-
-		if (fid->fd > 0)
-			close(fid->fd);
-
-		if (fid->dir)
-			closedir(fid->dir);
-
-		rb_erase(&fid->node, &p9dev->fids);
-		free(fid);
-
-		node = rb_first(&p9dev->fids);
-	}
-}
-
 static void virtio_p9_set_reply_header(struct p9_pdu *pdu, u32 size)
 {
 	u8 cmd;
@@ -443,8 +423,6 @@ static void virtio_p9_attach(struct p9_dev *p9dev,
 	free(uname);
 	free(aname);
 
-	clear_all_fids(p9dev);
-
 	if (lstat(p9dev->root_dir, &st) < 0)
 		goto err_out;
 
-- 
1.7.12

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux