All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: qemu-devel@nongnu.org, Juan Quintela <quintela@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] migration: Make analyze-migration script target-page-size aware
Date: Fri, 7 Jul 2017 17:03:21 +0200	[thread overview]
Message-ID: <1b6bf5d1-8477-1697-16e9-091c1b762bd4@suse.de> (raw)
In-Reply-To: <20170707150011.GH2451@work-vm>



On 07.07.17 17:00, Dr. David Alan Gilbert wrote:
> * Alexander Graf (agraf@suse.de) 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 <agraf@suse.de>
>> ---
>>   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.

> You might want to make the conditional subsection check into a function
> somewhere, but that's OK for now.

I really hope we don't need it again. All subsections should be 
described via the in-stream json description. We just missed out the 
configuration one because it's not part of the object model.


Alex

  reply	other threads:[~2017-07-07 15:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-07 12:14 [Qemu-devel] [PATCH] migration: Make analyze-migration script target-page-size aware Alexander Graf
2017-07-07 15:00 ` Dr. David Alan Gilbert
2017-07-07 15:03   ` Alexander Graf [this message]
2017-07-07 15:06     ` Dr. David Alan Gilbert
2017-07-07 15:13       ` Alexander Graf
2017-07-10 11:53     ` Dr. David Alan Gilbert
2017-07-18 12:02 ` Peter Xu

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=1b6bf5d1-8477-1697-16e9-091c1b762bd4@suse.de \
    --to=agraf@suse.de \
    --cc=dgilbert@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.