On Thu, Feb 26, 2026 at 12:47:55PM +0500, Alexandr Moshkov wrote:
> Yes, looks like it happens because migration stream for "virtio-blk" looks
> like this:
>
> [virtio-blk header] [virtio-blk fields] [virtio-blk subsections]
>
> "virtio-blk" contains "virtio" field, so migration stream is:
>
> [virtio-blk header] [virtio header] [virtio fields] [virtio subsections]
> [virtio-blk subsections]
>
> And when we load the subsections of the "virtio" device,
> vmstate_subsection_load() uses qemu_peek_byte() to try to figure out if this
> is his subsection. This is where we encounter an error.
>
> Thus, the error occurs due to the fact that vmsd does not know how many
> subsections it has when loading (this does not appear anywhere in the
> migration stream), so it tries to load all the appropriate ones by names.
OK I see, thanks for the details.
I think I missed one important thing, that we don't treat
trace_vmstate_subsection_load_bad("(prefix)") as errors.. instead we
fallback to the upper layer by returning zero.
Could you put most of above reply into the commit message? I think it may
help people understand the commit.
We could also add one comment right above the extra "/" check in code, to
make sure nobody will accidentally remove it.
Thanks,
--
Peter Xu