qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH for-2.8 5/5] 9pfs: clear migration blocker when rese


From: Greg Kurz
Subject: [Qemu-devel] [PATCH for-2.8 5/5] 9pfs: clear migration blocker when resetting the device
Date: Fri, 25 Nov 2016 12:54:50 +0100
User-agent: StGit/0.17.1-dirty

The migration blocker survives a machine reset: if the guest mounts a
9p share and then gets rebooted with system_reset, it will be unmigratable
until it remounts and umounts the 9p share again.

This happens because the blocker gets freed in put_fid(), whereas
virtfs_reset() calls free_fid() directly.

The easiest fix is to have virtfs_reset() call put_fid() instead. We need
to mark the fid as clunked to be sure put_fid() actually calls free_fid().

Signed-off-by: Greg Kurz <address@hidden>
---
 hw/9pfs/9p.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index 6fea68866a5c..756d04f0a36a 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -570,7 +570,9 @@ static void coroutine_fn virtfs_reset(V9fsPDU *pdu)
         s->fid_list = fidp->next;
 
         g_assert(!fidp->ref);
-        free_fid(pdu, fidp);
+        fidp->clunked = 1;
+        fidp->ref++;
+        put_fid(pdu, fidp);
     }
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]