qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Juan Quintela <quintela@redhat.com>
Cc: qemu-devel@nongnu.org, lvivier@redhat.com, peterx@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 1/3] migration: Use savevm_handlers instead of loadvm copy
Date: Tue, 30 May 2017 18:30:39 +0100	[thread overview]
Message-ID: <20170530173038.GM2120@work-vm> (raw)
In-Reply-To: <20170530083705.15141-2-quintela@redhat.com>

* Juan Quintela (quintela@redhat.com) wrote:
> There is no reason for having the loadvm_handlers at all.  There is
> only one use, and we can use the savevm handlers.
> 
> We will remove the loadvm handlers on a following patch.

<snip>

>      trace_qemu_loadvm_state_section_partend(section_id);
> -    QLIST_FOREACH(le, &mis->loadvm_handlers, entry) {
> -        if (le->section_id == section_id) {
> +    QTAILQ_FOREACH(se, &savevm_state.handlers, entry) {
> +        if (se->section_id == section_id) {

Isn't this the problem?  What guarantees that the se->section_id
is the same as the source's section_id - I don't think anything.
It's just dynamically allocated in register_savevm_live so the
initialisation order on source/dest could be different and you'd
get different ID.  You can't update se->section_id
unless you guaranteed to updated all of them.

Dave

>              break;
>          }
>      }
> -    if (le == NULL) {
> +    if (se == NULL) {
>          error_report("Unknown savevm section %d", section_id);
>          return -EINVAL;
>      }
>  
> -    ret = vmstate_load(f, le->se, le->version_id);
> +    ret = vmstate_load(f, se, se->load_version_id);
>      if (ret < 0) {
>          error_report("error while loading state section id %d(%s)",
> -                     section_id, le->se->idstr);
> +                     section_id, se->idstr);
>          return ret;
>      }
> -    if (!check_section_footer(f, le)) {
> +    if (!check_section_footer(f, se)) {
>          return -EINVAL;
>      }
>  
> -- 
> 2.9.4
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

  parent reply	other threads:[~2017-05-30 17:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-30  8:37 [Qemu-devel] [PATCH v2 0/3] Remove of loadvm handlers Juan Quintela
2017-05-30  8:37 ` [Qemu-devel] [PATCH v2 1/3] migration: Use savevm_handlers instead of loadvm copy Juan Quintela
2017-05-30  9:19   ` Laurent Vivier
2017-05-30 17:30   ` Dr. David Alan Gilbert [this message]
2017-05-30 18:35     ` Juan Quintela
2017-05-30  8:37 ` [Qemu-devel] [PATCH v2 2/3] migration: loadvm handlers are not used Juan Quintela
2017-05-30  9:36   ` Laurent Vivier
2017-05-30  8:37 ` [Qemu-devel] [PATCH v2 3/3] migration: Remove section_id parameter from vmstate_load Juan Quintela
2017-05-30  9:36   ` Laurent Vivier

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=20170530173038.GM2120@work-vm \
    --to=dgilbert@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).