Skip to contentSkip to conversation

migration: fix analyze-migration.py script with radix table

PATCH In review Laurent Vivier 4 participants 5 messages Dec 5, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 migration: fix analyze-migration.py script with radix table

Since commit 3a38429748 ("Add a "no HPT" encoding to HTAB migration stream") the HTAB migration stream contains a header set to "-1", meaning there is no HPT. Teach analyze-migration.py to ignore the section in this case.

Without this fix, the script fails with a dump from a POWER9 guest:

Traceback (most recent call last):
File "./qemu/scripts/analyze-migration.py", line 602, in <module>
dump.read(dump_memory = args.memory)
File "./qemu/scripts/analyze-migration.py", line 539, in read
section.read()
File "./qemu/scripts/analyze-migration.py", line 250, in read
self.file.readvar(n_valid * self.HASH_PTE_SIZE_64)
File "./qemu/scripts/analyze-migration.py", line 64, in readvar

    raise Exception("Unexpected end of %s at 0x%x" % (self.filename, self.file.tell()))

Exception: Unexpected end of migrate.dump at 0x1d4763ba

Fixes 3a38429748 ("Add a "no HPT" encoding to HTAB migration stream")
---
 scripts/analyze-migration.py | 4 ++++
 1 file changed, 4 insertions(+)
scripts/analyze-migration.py +4 -0
index 14553876a2..88ff4adb30 100755
@@ -234,6 +234,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
Signature · 1 line
2.14.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 14 lines · * Laurent Vivier ([email protected]) wrote:

Since commit 3a38429748 ("Add a "no HPT" encoding to HTAB migration stream") the HTAB migration stream contains a header set to "-1", meaning there is no HPT. Teach analyze-migration.py to ignore the section in this case.

Without this fix, the script fails with a dump from a POWER9 guest:

Traceback (most recent call last):
File "./qemu/scripts/analyze-migration.py", line 602, in <module>
dump.read(dump_memory = args.memory)
File "./qemu/scripts/analyze-migration.py", line 539, in read
section.read()
File "./qemu/scripts/analyze-migration.py", line 250, in read
self.file.readvar(n_valid * self.HASH_PTE_SIZE_64)
File "./qemu/scripts/analyze-migration.py", line 64, in readvar

Quoted 5 lines
    raise Exception("Unexpected end of %s at 0x%x" % (self.filename, self.file.tell()))

Exception: Unexpected end of migrate.dump at 0x1d4763ba

Fixes 3a38429748 ("Add a "no HPT" encoding to HTAB migration stream")
Quoted 22 lines
---
 scripts/analyze-migration.py | 4 ++++
 1 file changed, 4 insertions(+)
scripts/analyze-migration.py +4 -0
index 14553876a2..88ff4adb30 100755
@@ -234,6 +234,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
Signature · 1 line
2.14.3

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

#2 lore raw
Quoted 18 lines · Dr. David Alan Gilbert
Quoted 17 lines · * Laurent Vivier ([email protected]) wrote:

Since commit 3a38429748 ("Add a "no HPT" encoding to HTAB migration stream") the HTAB migration stream contains a header set to "-1", meaning there is no HPT. Teach analyze-migration.py to ignore the section in this case.

Without this fix, the script fails with a dump from a POWER9 guest:

Traceback (most recent call last):
File "./qemu/scripts/analyze-migration.py", line 602, in <module>
dump.read(dump_memory = args.memory)
File "./qemu/scripts/analyze-migration.py", line 539, in read
section.read()
File "./qemu/scripts/analyze-migration.py", line 250, in read
self.file.readvar(n_valid * self.HASH_PTE_SIZE_64)
File "./qemu/scripts/analyze-migration.py", line 64, in readvar

    raise Exception("Unexpected end of %s at 0x%x" % (self.filename, self.file.tell()))

Exception: Unexpected end of migrate.dump at 0x1d4763ba

Quoted 4 lines
Quoted 2 lines
Fixes 3a38429748 ("Add a "no HPT" encoding to HTAB migration stream")

Should I queue this (for 2.12), or do you want to take it via the migration tree?

Quoted 20 lines
Quoted 20 lines
---
 scripts/analyze-migration.py | 4 ++++
 1 file changed, 4 insertions(+)
scripts/analyze-migration.py +4 -0
index 14553876a2..88ff4adb30 100755
@@ -234,6 +234,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
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
#3 lore raw
Quoted 19 lines · * David Gibson ([email protected]) wrote:
Quoted 18 lines · Dr. David Alan Gilbert
Quoted 17 lines · * Laurent Vivier ([email protected]) wrote:

Since commit 3a38429748 ("Add a "no HPT" encoding to HTAB migration stream") the HTAB migration stream contains a header set to "-1", meaning there is no HPT. Teach analyze-migration.py to ignore the section in this case.

Without this fix, the script fails with a dump from a POWER9 guest:

Traceback (most recent call last):
File "./qemu/scripts/analyze-migration.py", line 602, in <module>
dump.read(dump_memory = args.memory)
File "./qemu/scripts/analyze-migration.py", line 539, in read
section.read()
File "./qemu/scripts/analyze-migration.py", line 250, in read
self.file.readvar(n_valid * self.HASH_PTE_SIZE_64)
File "./qemu/scripts/analyze-migration.py", line 64, in readvar

    raise Exception("Unexpected end of %s at 0x%x" % (self.filename, self.file.tell()))

Exception: Unexpected end of migrate.dump at 0x1d4763ba

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Fixes 3a38429748 ("Add a "no HPT" encoding to HTAB migration stream")

Should I queue this (for 2.12), or do you want to take it via the migration tree?

We can take it via migration.

Dave

Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
---
 scripts/analyze-migration.py | 4 ++++
 1 file changed, 4 insertions(+)
scripts/analyze-migration.py +0 -0
index 14553876a2..88ff4adb30 100755
@@ -234,6 +234,10 @@ class HTABSection(object):
 
         header = self.file.read32()
 
Quoted 13 lines
Quoted 7 lines
Quoted 7 lines
scripts/analyze-migration.py +4 -0
+        if (header == -1):
+            # "no HPT" encoding
+            return
+
         if (header > 0):
             # First section, just the hash shift
             return
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

Reviewed-by on v1 1/1
#4 lore raw
In reply to Laurent Vivier
Quoted 14 lines · On Tue, 5 Dec 2017 13:27:40 +0100 Laurent Vivier <[email protected]> wrote:

Since commit 3a38429748 ("Add a "no HPT" encoding to HTAB migration stream") the HTAB migration stream contains a header set to "-1", meaning there is no HPT. Teach analyze-migration.py to ignore the section in this case.

Without this fix, the script fails with a dump from a POWER9 guest:

Traceback (most recent call last):
File "./qemu/scripts/analyze-migration.py", line 602, in <module>
dump.read(dump_memory = args.memory)
File "./qemu/scripts/analyze-migration.py", line 539, in read
section.read()
File "./qemu/scripts/analyze-migration.py", line 250, in read
self.file.readvar(n_valid * self.HASH_PTE_SIZE_64)
File "./qemu/scripts/analyze-migration.py", line 64, in readvar

Quoted 6 lines
    raise Exception("Unexpected end of %s at 0x%x" % (self.filename, self.file.tell()))

Exception: Unexpected end of migrate.dump at 0x1d4763ba

Fixes 3a38429748 ("Add a "no HPT" encoding to HTAB migration stream")

---

Quoted 18 lines
 scripts/analyze-migration.py | 4 ++++
 1 file changed, 4 insertions(+)
scripts/analyze-migration.py +4 -0
index 14553876a2..88ff4adb30 100755
@@ -234,6 +234,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