qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH] vmstate: fix vmstate_subsection_load


From: Juan Quintela
Subject: [Qemu-devel] Re: [PATCH] vmstate: fix vmstate_subsection_load
Date: Wed, 28 Jul 2010 12:43:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

TeLeMan <address@hidden> 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 <address@hidden>
> ---
>  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

[Prev in Thread] Current Thread [Next in Thread]