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: 9830011 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 52758602CA for ; Fri, 7 Jul 2017 12:15:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4026B28671 for ; Fri, 7 Jul 2017 12:15:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3140428676; Fri, 7 Jul 2017 12:15:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AA29628671 for ; Fri, 7 Jul 2017 12:15:01 +0000 (UTC) Received: from localhost ([::1]:56142 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dTSA0-000575-VY for patchwork-qemu-devel@patchwork.kernel.org; Fri, 07 Jul 2017 08:15:00 -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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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):