From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37860) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WooUT-0008Eb-VR for qemu-devel@nongnu.org; Mon, 26 May 2014 02:34:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WooUN-00021t-47 for qemu-devel@nongnu.org; Mon, 26 May 2014 02:34:33 -0400 Received: from mail-pb0-x233.google.com ([2607:f8b0:400e:c01::233]:33588) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WooUM-00021p-TC for qemu-devel@nongnu.org; Mon, 26 May 2014 02:34:27 -0400 Received: by mail-pb0-f51.google.com with SMTP id ma3so7290822pbc.10 for ; Sun, 25 May 2014 23:34:26 -0700 (PDT) From: Sanidhya Kashyap Date: Mon, 26 May 2014 12:03:25 +0530 Message-Id: <1401086005-8296-9-git-send-email-sanidhya.iiith@gmail.com> In-Reply-To: <1401086005-8296-1-git-send-email-sanidhya.iiith@gmail.com> References: <1401086005-8296-1-git-send-email-sanidhya.iiith@gmail.com> Subject: [Qemu-devel] [PATCH 8/8] python script for extracting bitmap from a binary file List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu list Cc: ChenLiang , Sanidhya Kashyap , Juan Quintela No particular functional change. This file does not need to be included in the Makefile as it will be only useful once the user has generated the bitmap file via bitmap dump process. Signed-off-by: Sanidhya Kashyap --- scripts/extract-bitmap.py | 64 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100755 scripts/extract-bitmap.py diff --git a/scripts/extract-bitmap.py b/scripts/extract-bitmap.py new file mode 100755 index 0000000..f5ca341 --- /dev/null +++ b/scripts/extract-bitmap.py @@ -0,0 +1,64 @@ +#!/usr/bin/python +# This python script helps in extracting the dirty bitmap present +# in the file after executing the log-dirty-bitmap command either +# from the qmp or hmp interface. This file only processes binary +# file obtained via command. +# +# Copyright (C) 2014 Sanidhya Kashyap +# +# Authors: +# Sanidhya Kashyap +# +# +# This work is licensed under the terms of the GNU GPL, version 2 or later. + +import struct +import argparse +from functools import partial + +long_bytes = 8 +complete_bitmap_list = [] + +def get_unsigned_long_integer(value): + return struct.unpack('