Received: from eggs.gnu.org ([2001:4830:134:3::10]:40925) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJDTj-0007ep-91 for qemu-devel@nongnu.org; Sun, 17 Aug 2014 23:19:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XJDTZ-00075f-QS for qemu-devel@nongnu.org; Sun, 17 Aug 2014 23:19:27 -0400 Received: from e23smtp06.au.ibm.com ([202.81.31.148]:38317) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJDTY-00074z-2L for qemu-devel@nongnu.org; Sun, 17 Aug 2014 23:19:17 -0400 Received: from /spool/local by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 18 Aug 2014 13:19:02 +1000 From: Samuel Mendoza-Jonas Date: Mon, 18 Aug 2014 13:18:53 +1000 Message-Id: <1408331933-11845-1-git-send-email-sam.mj@au1.ibm.com> Subject: [Qemu-devel] [PATCH] spapr: Fix stale HTAB during live migration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Cc: aik@ozlabs.ru, Samuel Mendoza-Jonas If a guest reboots during a running migration, changes to the hash page table are not necessarily updated on the destination. Opening a new file descriptor to the HTAB forces the migration handler to resend the entire table. Signed-off-by: Samuel Mendoza-Jonas --- hw/ppc/spapr.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 3a6d26d..7733b37 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -997,6 +997,12 @@ static void spapr_reset_htab(sPAPREnvironment *spapr) /* Kernel handles htab, we don't need to allocate one */ spapr->htab_shift = shift; kvmppc_kern_htab = true; + + /* Make sure readers are aware of the reset */ + if (spapr->htab_fd > 0) { + close(spapr->htab_fd); + spapr->htab_fd = kvmppc_get_htab_fd(false); + } } else { if (!spapr->htab) { /* Allocate an htab if we don't yet have one */ -- 1.9.3