TeLeMan <gele...@gmail.com> wrote:
>  If the new version adds the new subsection for some vmstate, the old
> version will load the new version's vmstate unsuccessfully. So we have
> to ignore the unrecognized subsections.

No.  That was the whole point of subsections.  If one subsection is
sent, target machine has to understand it.  If it don't understand it,
it fails.

If subsection is not needed, it is the responsability of the source to
not send it.

This was one of the design requirements.  Subsections are optional but
it is the source which decides which ones to send/not to send.  The
target has to understand everything that it gets or fail the migration.

Later, Juan.

> Signed-off-by: TeLeMan <gele...@gmail.com>
> ---
>  savevm.c |   11 +++++------
>  1 files changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/savevm.c b/savevm.c
> index 9a8328d..3e1aa73 100644
> --- a/savevm.c
> +++ b/savevm.c
> @@ -1581,12 +1581,11 @@ static int vmstate_subsection_load(QEMUFile
> *f, const VMStateDescription *vmsd,
>          version_id = qemu_get_be32(f);
>
>          sub_vmsd = vmstate_get_subsection(vmsd->subsections, idstr);
> -        if (sub_vmsd == NULL) {
> -            return -ENOENT;
> -        }
> -        ret = vmstate_load_state(f, sub_vmsd, opaque, version_id);
> -        if (ret) {
> -            return ret;
> +        if (sub_vmsd) {
> +            ret = vmstate_load_state(f, sub_vmsd, opaque, version_id);
> +            if (ret) {
> +                return ret;
> +            }
>          }
>      }
>      return 0;

Reply via email to