OSDN Git Service

migration: Unify and trace vmstate field_exists() checks
authorPeter Xu <peterx@redhat.com>
Wed, 6 Sep 2023 20:47:22 +0000 (16:47 -0400)
committerJuan Quintela <quintela@redhat.com>
Wed, 4 Oct 2023 11:19:47 +0000 (13:19 +0200)
commit579cedf430582b37f804f6b6ed131554cebb11b5
treecb7b75f3c7a566e96060108046be15fe9213b499
parent385f510df5f6a7f3998b3ff01deca33b0027ff29
migration: Unify and trace vmstate field_exists() checks

For both save/load we actually share the logic on deciding whether a field
should exist.  Merge the checks into a helper and use it for both save and
load.  When doing so, add documentations and reformat the code to make it
much easier to read.

The real benefit here (besides code cleanups) is we add a trace-point for
this; this is a known spot where we can easily break migration
compatibilities between binaries, and this trace point will be critical for
us to identify such issues.

For example, this will be handy when debugging things like:

https://gitlab.com/qemu-project/qemu/-/issues/932

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20230906204722.514474-1-peterx@redhat.com>
migration/trace-events
migration/vmstate.c