From: Pawel Zmarzly <pzmarzly0@gmail.com>
To: qemu-devel@nongnu.org
Cc: jsnow@redhat.com, michel@michel-slm.name
Subject: [PATCH RESEND] scripts/analyze-migration: Make it work in Python 3
Date: Mon, 24 Nov 2025 16:44:39 +0000 [thread overview]
Message-ID: <20251124164439.67948-1-pzmarzly0@gmail.com> (raw)
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
reply other threads:[~2025-11-24 17:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251124164439.67948-1-pzmarzly0@gmail.com \
--to=pzmarzly0@gmail.com \
--cc=jsnow@redhat.com \
--cc=michel@michel-slm.name \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).