From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49708) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eb3KX-00079A-SY for qemu-devel@nongnu.org; Mon, 15 Jan 2018 06:53:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eb3KU-0003Ly-QB for qemu-devel@nongnu.org; Mon, 15 Jan 2018 06:53:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49868) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eb3KU-0003Lb-JE for qemu-devel@nongnu.org; Mon, 15 Jan 2018 06:53:30 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9EE6A25774 for ; Mon, 15 Jan 2018 11:53:29 +0000 (UTC) From: Juan Quintela Date: Mon, 15 Jan 2018 12:52:48 +0100 Message-Id: <20180115115309.23982-7-quintela@redhat.com> In-Reply-To: <20180115115309.23982-1-quintela@redhat.com> References: <20180115115309.23982-1-quintela@redhat.com> Subject: [Qemu-devel] [PULL 06/27] migration: fix analyze-migration.py script with radix table List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: dgilbert@redhat.com, lvivier@redhat.com, peterx@redhat.com From: Laurent Vivier Since commit 3a38429748 ("Add a "no HPT" encoding to HTAB migration stream") the HTAB migration stream contains a header set to "-1", meaning there is no HPT. Teach analyze-migration.py to ignore the section in this case. Without this fix, the script fails with a dump from a POWER9 guest: Traceback (most recent call last): File "./qemu/scripts/analyze-migration.py", line 602, in dump.read(dump_memory = args.memory) File "./qemu/scripts/analyze-migration.py", line 539, in read section.read() File "./qemu/scripts/analyze-migration.py", line 250, in read self.file.readvar(n_valid * self.HASH_PTE_SIZE_64) File "./qemu/scripts/analyze-migration.py", line 64, in readvar raise Exception("Unexpected end of %s at 0x%x" % (self.filename, self.file.tell())) Exception: Unexpected end of migrate.dump at 0x1d4763ba Fixes: 3a38429748 ("Add a "no HPT" encoding to HTAB migration stream") Signed-off-by: Laurent Vivier Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Greg Kurz Signed-off-by: Juan Quintela --- scripts/analyze-migration.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/analyze-migration.py b/scripts/analyze-migration.py index 14553876a2..88ff4adb30 100755 --- a/scripts/analyze-migration.py +++ b/scripts/analyze-migration.py @@ -234,6 +234,10 @@ class HTABSection(object): header = self.file.read32() + if (header == -1): + # "no HPT" encoding + return + if (header > 0): # First section, just the hash shift return -- 2.14.3