qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
To: qemu-devel@nongnu.org, quintela@redhat.com, peterx@redhat.com,
	ehabkost@redhat.com, richardw.yang@linux.intel.com,
	yury-kotov@yandex-team.ru, chen.zhang@intel.com
Subject: [Qemu-devel] [PULL 12/16] migration/savevm: load_header before load_setup
Date: Tue, 14 May 2019 19:34:50 +0100	[thread overview]
Message-ID: <20190514183454.12758-13-dgilbert@redhat.com> (raw)
In-Reply-To: <20190514183454.12758-1-dgilbert@redhat.com>

From: Wei Yang <richardw.yang@linux.intel.com>

In migration_thread() and qemu_savevm_state(), we savevm_state in
following sequence:

    qemu_savevm_state_header(f);
    qemu_savevm_state_setup(f);

Then it would be more proper to loadvm_state in the save sequence.

Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
Message-Id: <20190424004700.12766-4-richardw.yang@linux.intel.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 migration/savevm.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/migration/savevm.c b/migration/savevm.c
index 6e8912af49..4c7b8379e8 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -2434,10 +2434,6 @@ int qemu_loadvm_state(QEMUFile *f)
         return -ENOTSUP;
     }
 
-    if (qemu_loadvm_state_setup(f) != 0) {
-        return -EINVAL;
-    }
-
     if (migrate_get_current()->send_configuration) {
         if (qemu_get_byte(f) != QEMU_VM_CONFIGURATION) {
             error_report("Configuration section missing");
@@ -2452,6 +2448,10 @@ int qemu_loadvm_state(QEMUFile *f)
         }
     }
 
+    if (qemu_loadvm_state_setup(f) != 0) {
+        return -EINVAL;
+    }
+
     cpu_synchronize_all_pre_loadvm();
 
     ret = qemu_loadvm_state_main(f, mis);
-- 
2.21.0



  parent reply	other threads:[~2019-05-14 18:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-14 18:34 [Qemu-devel] [PULL 00/16] migration queue Dr. David Alan Gilbert (git)
2019-05-14 18:34 ` [Qemu-devel] [PULL 01/16] migration: comment VMSTATE_UNUSED*() properly Dr. David Alan Gilbert (git)
2019-05-14 18:34 ` [Qemu-devel] [PULL 02/16] migration: not necessary to check ops again Dr. David Alan Gilbert (git)
2019-05-14 18:34 ` [Qemu-devel] [PULL 03/16] migration: remove not used field xfer_limit Dr. David Alan Gilbert (git)
2019-05-14 18:34 ` [Qemu-devel] [PULL 04/16] vmstate: check subsection_found is enough Dr. David Alan Gilbert (git)
2019-05-14 18:34 ` [Qemu-devel] [PULL 05/16] migration: savevm: fix error code with migration blockers Dr. David Alan Gilbert (git)
2019-05-14 18:34 ` [Qemu-devel] [PULL 06/16] migration/colo.c: Remove redundant input parameter Dr. David Alan Gilbert (git)
2019-05-14 18:34 ` [Qemu-devel] [PULL 07/16] migration/colo.h: Remove obsolete codes Dr. David Alan Gilbert (git)
2019-05-14 18:34 ` [Qemu-devel] [PULL 08/16] qemu-option.hx: Update missed parameter for colo-compare Dr. David Alan Gilbert (git)
2019-05-14 18:34 ` [Qemu-devel] [PULL 09/16] migration/ram.c: start of migration_bitmap_sync_range is always 0 Dr. David Alan Gilbert (git)
2019-05-14 18:34 ` [Qemu-devel] [PULL 10/16] migration: update comments of migration bitmap Dr. David Alan Gilbert (git)
2019-05-14 18:34 ` [Qemu-devel] [PULL 11/16] migration/savevm: remove duplicate check of migration_is_blocked Dr. David Alan Gilbert (git)
2019-05-14 18:34 ` Dr. David Alan Gilbert (git) [this message]
2019-05-14 18:34 ` [Qemu-devel] [PULL 13/16] migration/savevm: wrap into qemu_loadvm_state_header() Dr. David Alan Gilbert (git)
2019-05-14 18:34 ` [Qemu-devel] [PULL 14/16] migration: Fix use-after-free during process exit Dr. David Alan Gilbert (git)
2019-05-14 18:34 ` [Qemu-devel] [PULL 15/16] migration/ram.c: fix typos in comments Dr. David Alan Gilbert (git)
2019-05-14 18:34 ` [Qemu-devel] [PULL 16/16] monitor: Call mon_get_cpu() only once at hmp_gva2gpa() Dr. David Alan Gilbert (git)
2019-05-16 11:54 ` [Qemu-devel] [PULL 00/16] migration queue Peter Maydell

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=20190514183454.12758-13-dgilbert@redhat.com \
    --to=dgilbert@redhat.com \
    --cc=chen.zhang@intel.com \
    --cc=ehabkost@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=richardw.yang@linux.intel.com \
    --cc=yury-kotov@yandex-team.ru \
    /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).