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 <gr...@kaod.org> --- 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); } }