From: Peter Xu <peterx@redhat.com>
To: Fabiano Rosas <farosas@suse.de>
Cc: Stefan Hajnoczi <stefanha@gmail.com>,
Thomas Huth <thuth@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
qemu-devel@nongnu.org
Subject: Re: [PULL 00/17] Migration patches for 2024-12-17
Date: Mon, 6 Jan 2025 15:22:49 -0500 [thread overview]
Message-ID: <Z3w7mSc1XEH8N0IG@x1n> (raw)
In-Reply-To: <87ldvn7nju.fsf@suse.de>
On Mon, Jan 06, 2025 at 04:24:53PM -0300, Fabiano Rosas wrote:
> Here's the fix for the pre-existing issue in the script:
For this patch:
>
> -- 8< --
> From 5bcad03aad85556a7b72f79d3574e246a99432c3 Mon Sep 17 00:00:00 2001
> From: Fabiano Rosas <farosas@suse.de>
> Date: Mon, 6 Jan 2025 15:05:31 -0300
> Subject: [PATCH 1/2] migration: Fix parsing of s390 stream
>
> The parsing for the S390StorageAttributes section is currently leaving
> an unconsumed token that is later interpreted by the generic code as
> QEMU_VM_EOF, cutting the parsing short.
Better mention why it can be intepreted as QEMU_VM_EOF, especially s390's
tag is 8 bytes while QEMU's EOF is 1 byte.. that confused me. :)
>
> The migration will issue a STATTR_FLAG_DONE between iterations, but
> there's a final STATTR_FLAG_EOS at .save_complete.
>
> Fixes: 81c2c9dd5d ("tests/qtest/migration-test: Fix analyze-migration.py for s390x")
> Signed-off-by: Fabiano Rosas <farosas@suse.de>
> ---
> scripts/analyze-migration.py | 18 +++++++++++++++++-
> 1 file changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/analyze-migration.py b/scripts/analyze-migration.py
> index f2457b1dde..2a2160cbf7 100755
> --- a/scripts/analyze-migration.py
> +++ b/scripts/analyze-migration.py
> @@ -65,6 +65,9 @@ def readvar(self, size = None):
> def tell(self):
> return self.file.tell()
>
> + def seek(self, a, b):
> + return self.file.seek(a, b)
> +
> # The VMSD description is at the end of the file, after EOF. Look for
> # the last NULL byte, then for the beginning brace of JSON.
> def read_migration_debug_json(self):
> @@ -272,11 +275,24 @@ def __init__(self, file, version_id, device, section_key):
> self.section_key = section_key
>
> def read(self):
> + pos = 0
> while True:
> addr_flags = self.file.read64()
> flags = addr_flags & 0xfff
> - if (flags & (self.STATTR_FLAG_DONE | self.STATTR_FLAG_EOS)):
> +
> + if flags & self.STATTR_FLAG_DONE:
> + pos = self.file.tell()
> + continue
> + elif flags & self.STATTR_FLAG_EOS:
> return
> + else:
> + # No EOS came after DONE, that's OK, but rewind the
> + # stream because this is not our data.
> + if pos:
> + self.file.seek(pos, 0)
Nit: use io.SEEK_SET.
> + return
> + raise Exception("Unknown flags %x", flags)
> +
> if (flags & self.STATTR_FLAG_ERROR):
> raise Exception("Error in migration stream")
> count = self.file.read64()
With above:
Reviewed-by: Peter Xu <peterx@redhat.com>
--
Peter Xu
prev parent reply other threads:[~2025-01-06 20:23 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-17 17:48 [PULL 00/17] Migration patches for 2024-12-17 Fabiano Rosas
2024-12-17 17:48 ` [PULL 01/17] migration/multifd: Fix compile error caused by page_size usage Fabiano Rosas
2024-12-17 17:48 ` [PULL 02/17] migration/multifd: Further remove the SYNC on complete Fabiano Rosas
2024-12-17 17:48 ` [PULL 03/17] migration/multifd: Allow to sync with sender threads only Fabiano Rosas
2024-12-17 17:48 ` [PULL 04/17] migration/ram: Move RAM_SAVE_FLAG* into ram.h Fabiano Rosas
2024-12-17 17:48 ` [PULL 05/17] migration/multifd: Unify RAM_SAVE_FLAG_MULTIFD_FLUSH messages Fabiano Rosas
2024-12-17 17:48 ` [PULL 06/17] migration/multifd: Remove sync processing on postcopy Fabiano Rosas
2024-12-17 17:48 ` [PULL 07/17] migration/multifd: Cleanup src flushes on condition check Fabiano Rosas
2024-12-17 17:48 ` [PULL 08/17] migration/multifd: Document the reason to sync for save_setup() Fabiano Rosas
2024-12-17 17:48 ` [PULL 09/17] migration/multifd: Fix compat with QEMU < 9.0 Fabiano Rosas
2024-12-17 17:48 ` [PULL 10/17] s390x: Fix CSS migration Fabiano Rosas
2024-12-17 17:48 ` [PULL 11/17] migration: Add helper to get target runstate Fabiano Rosas
2024-12-17 17:48 ` [PULL 12/17] qmp/cont: Only activate disks if migration completed Fabiano Rosas
2024-12-17 17:48 ` [PULL 13/17] migration/block: Make late-block-active the default Fabiano Rosas
2024-12-17 17:48 ` [PULL 14/17] migration/block: Apply late-block-active behavior to postcopy Fabiano Rosas
2024-12-17 17:48 ` [PULL 15/17] migration/block: Fix possible race with block_inactive Fabiano Rosas
2024-12-17 17:48 ` [PULL 16/17] migration/block: Rewrite disk activation Fabiano Rosas
2024-12-17 17:48 ` [PULL 17/17] tests/qtest/migration: Fix compile errors when CONFIG_UADK is set Fabiano Rosas
2024-12-19 12:32 ` [PULL 00/17] Migration patches for 2024-12-17 Stefan Hajnoczi
2024-12-19 18:53 ` Fabiano Rosas
2024-12-20 16:28 ` Peter Xu
2025-01-02 9:32 ` Thomas Huth
2025-01-03 18:30 ` Fabiano Rosas
2025-01-03 20:31 ` Stefan Hajnoczi
2025-01-03 21:00 ` Fabiano Rosas
2025-01-03 22:34 ` Fabiano Rosas
2025-01-06 18:45 ` Peter Xu
2025-01-06 19:24 ` Fabiano Rosas
2025-01-06 20:22 ` Peter Xu [this message]
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=Z3w7mSc1XEH8N0IG@x1n \
--to=peterx@redhat.com \
--cc=farosas@suse.de \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
--cc=stefanha@redhat.com \
--cc=thuth@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.