From patchwork Fri Jul 7 12:14:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 785460 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3x3tpK0VhSz9s7v for ; Fri, 7 Jul 2017 22:14:49 +1000 (AEST) Received: from localhost ([::1]:56142 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dTS9m-000575-QX for incoming@patchwork.ozlabs.org; Fri, 07 Jul 2017 08:14:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35096) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dTS9T-00055j-2Q for qemu-devel@nongnu.org; Fri, 07 Jul 2017 08:14:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dTS9O-0002ix-4e for qemu-devel@nongnu.org; Fri, 07 Jul 2017 08:14:27 -0400 Received: from mx2.suse.de ([195.135.220.15]:33153 helo=mx1.suse.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dTS9N-0002iR-U8 for qemu-devel@nongnu.org; Fri, 07 Jul 2017 08:14:22 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 8C454AAB9; Fri, 7 Jul 2017 12:14:19 +0000 (UTC) From: Alexander Graf To: qemu-devel@nongnu.org Date: Fri, 7 Jul 2017 14:14:43 +0200 Message-Id: <1499429683-73361-1-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.8.5.6 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 195.135.220.15 Subject: [Qemu-devel] [PATCH] migration: Make analyze-migration script target-page-size aware X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Dr. David Alan Gilbert" , Juan Quintela Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The configuration section has a new subsection to transmit the target page size along with the migration stream. The analyze migration script needs to learn about that to read configuration streams that were triggering this subsection to get transmitted. With this patch applied, I can successfully analyze migration streams on AArch64 again. Signed-off-by: Alexander Graf --- scripts/analyze-migration.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/analyze-migration.py b/scripts/analyze-migration.py index 1455387..02784f2 100755 --- a/scripts/analyze-migration.py +++ b/scripts/analyze-migration.py @@ -254,12 +254,25 @@ class HTABSection(object): class ConfigurationSection(object): + QEMU_VM_SUBSECTION = 0x05 + def __init__(self, file): self.file = file def read(self): name_len = self.file.read32() name = self.file.readstr(len = name_len) + oldpos = self.file.tell() + if self.file.read8() == self.QEMU_VM_SUBSECTION: + name = self.file.readstr() + version_id = self.file.read32() + if name == "configuration/target-page-bits": + target_page_size = self.file.read32() + else: + raise Exception("Unknown config subsection: %s" % name) + else: + # No subsection following, forget that we ever read anything + self.file.seek(oldpos) class VMSDFieldGeneric(object): def __init__(self, desc, file):