* [PATCH RESEND] scripts/analyze-migration: Make it work in Python 3
@ 2025-11-24 16:44 Pawel Zmarzly
0 siblings, 0 replies; only message in thread
From: Pawel Zmarzly @ 2025-11-24 16:44 UTC (permalink / raw)
To: qemu-devel; +Cc: jsnow, michel
Currently crashing on Python 3 with:
$ scripts/analyze-migration.py -m -f vm.state
TypeError: ord() expected string of length 1, but int found
Signed-off-by: Pawel Zmarzly <pzmarzly0@gmail.com>
---
scripts/analyze-migration.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/analyze-migration.py b/scripts/analyze-migration.py
index 67631ac43e..3303c05358 100755
--- a/scripts/analyze-migration.py
+++ b/scripts/analyze-migration.py
@@ -56,7 +56,7 @@ def readvar(self, size = None):
if size is None:
size = self.read8()
if size == 0:
- return ""
+ return b""
value = self.file.read(size)
if len(value) != size:
raise Exception("Unexpected end of %s at 0x%x" % (self.filename, self.file.tell()))
@@ -200,7 +200,7 @@ def read(self):
self.files[self.name].seek(addr, os.SEEK_SET)
self.files[self.name].write(data)
if self.dump_memory:
- hexdata = " ".join("{0:02x}".format(ord(c)) for c in data)
+ hexdata = " ".join("{0:02x}".format(c) for c in data)
self.memory['%s (0x%016x)' % (self.name, addr)] = hexdata
flags &= ~self.RAM_SAVE_FLAG_PAGE
--
2.51.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-11-24 17:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-24 16:44 [PATCH RESEND] scripts/analyze-migration: Make it work in Python 3 Pawel Zmarzly
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).