]> Git Repo - qemu.git/blobdiff - scripts/analyze-migration.py
hw/display/bcm2835_fb: Silence Coverity warning about multiply overflow
[qemu.git] / scripts / analyze-migration.py
index 14553876a281b2194da11e381c361bfc268b453f..5c2010c91706ad8726ff0a889af175f0bcce26da 100755 (executable)
@@ -17,6 +17,7 @@
 # You should have received a copy of the GNU Lesser General Public
 # License along with this library; if not, see <http://www.gnu.org/licenses/>.
 
+from __future__ import print_function
 import numpy as np
 import json
 import os
@@ -162,7 +163,7 @@ class RamSection(object):
                     len = self.file.read64()
                     self.sizeinfo[self.name] = '0x%016x' % len
                     if self.write_memory:
-                        print self.name
+                        print(self.name)
                         mkdir_p('./' + os.path.dirname(self.name))
                         f = open('./' + self.name, "wb")
                         f.truncate(0)
@@ -234,6 +235,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
@@ -584,7 +589,7 @@ if args.extract:
     dump = MigrationDump(args.file)
 
     dump.read(desc_only = True)
-    print "desc.json"
+    print("desc.json")
     f = open("desc.json", "wb")
     f.truncate()
     f.write(jsonenc.encode(dump.vmsd_desc))
@@ -592,7 +597,7 @@ if args.extract:
 
     dump.read(write_memory = True)
     dict = dump.getDict()
-    print "state.json"
+    print("state.json")
     f = open("state.json", "wb")
     f.truncate()
     f.write(jsonenc.encode(dict))
@@ -601,10 +606,10 @@ elif args.dump == "state":
     dump = MigrationDump(args.file)
     dump.read(dump_memory = args.memory)
     dict = dump.getDict()
-    print jsonenc.encode(dict)
+    print(jsonenc.encode(dict))
 elif args.dump == "desc":
     dump = MigrationDump(args.file)
     dump.read(desc_only = True)
-    print jsonenc.encode(dump.vmsd_desc)
+    print(jsonenc.encode(dump.vmsd_desc))
 else:
     raise Exception("Please specify either -x, -d state or -d dump")
This page took 0.025095 seconds and 4 git commands to generate.