qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] migration: Make analyze-migration script target


From: Alexander Graf
Subject: Re: [Qemu-devel] [PATCH] migration: Make analyze-migration script target-page-size aware
Date: Fri, 7 Jul 2017 17:13:18 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.2.1



On 07.07.17 17:06, Dr. David Alan Gilbert wrote:
* Alexander Graf (address@hidden) wrote:


On 07.07.17 17:00, Dr. David Alan Gilbert wrote:
* Alexander Graf (address@hidden) wrote:
The configuration section has a new subsection to transmit the target page
size along with the migration stream. The analyze migration script needs
to learn about that to read configuration streams that were triggering
this subsection to get transmitted.

With this patch applied, I can successfully analyze migration streams
on AArch64 again.

Signed-off-by: Alexander Graf <address@hidden>
---
   scripts/analyze-migration.py | 13 +++++++++++++
   1 file changed, 13 insertions(+)

diff --git a/scripts/analyze-migration.py b/scripts/analyze-migration.py
index 1455387..02784f2 100755
--- a/scripts/analyze-migration.py
+++ b/scripts/analyze-migration.py
@@ -254,12 +254,25 @@ class HTABSection(object):

(Note I'm not a particularly python person, so take lightly)

   class ConfigurationSection(object):
+    QEMU_VM_SUBSECTION    = 0x05
+

It's odd, you already have this constant defined twice in this script.

Yes, it lives once per class. I am not sure how to easily make it a global.


       def __init__(self, file):
           self.file = file
       def read(self):
           name_len = self.file.read32()
           name = self.file.readstr(len = name_len)
+        oldpos = self.file.tell()
+        if self.file.read8() == self.QEMU_VM_SUBSECTION:
+            name = self.file.readstr()
+            version_id = self.file.read32()
+            if name == "configuration/target-page-bits":
+                target_page_size = self.file.read32()

All of your other references to target_page_size in the script
are self.TARGET_PAGE_SIZE.

Well, all other ones are actual page sizes :). This variable is never used
anywhere - we just want to stash it somewhere.

oh, so you're not actually using the value read here to influence the
parsing later?

Exactly. As far as I can tell it doesn't have any impact on the migration format, so there's no need to use it.


Alex



reply via email to

[Prev in Thread] Current Thread [Next in Thread]