qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: qemu-devel@nongnu.org
Cc: dgilbert@redhat.com, lvivier@redhat.com, peterx@redhat.com,
	Jose Ricardo Ziviani <joserz@linux.ibm.com>
Subject: [Qemu-devel] [PULL 5/5] Add a hint message to loadvm and exits on failure
Date: Tue,  4 Sep 2018 00:27:58 +0200	[thread overview]
Message-ID: <20180903222758.13267-6-quintela@redhat.com> (raw)
In-Reply-To: <20180903222758.13267-1-quintela@redhat.com>

From: Jose Ricardo Ziviani <joserz@linux.ibm.com>

This patch adds a small hint for the failure case of the load snapshot
process. It may be useful for users to remember that the VM
configuration has changed between the save and load processes.

(qemu) loadvm vm-20180903083641
Unknown savevm section or instance 'cpu_common' 4.
Make sure that your current VM setup matches your saved VM setup, including any hotplugged devices
Error -22 while loading VM state
(qemu) device_add host-spapr-cpu-core,core-id=4
(qemu) loadvm vm-20180903083641
(qemu) c
(qemu) info status
VM status: running

It also exits Qemu if the snapshot cannot be loaded before reaching the
main loop (-loadvm in the command line).

$ qemu-system-ppc64 ... -loadvm vm-20180903083641
qemu-system-ppc64: Unknown savevm section or instance 'cpu_common' 4.
Make sure that your current VM setup matches your saved VM setup, including any hotplugged devices
qemu-system-ppc64: Error -22 while loading VM state
$

Signed-off-by: Jose Ricardo Ziviani <joserz@linux.ibm.com>
Message-Id: <20180903162613.15877-1-joserz@linux.ibm.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 migration/savevm.c | 4 +++-
 vl.c               | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/migration/savevm.c b/migration/savevm.c
index 13e51f0e34..9692577318 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -2078,7 +2078,9 @@ qemu_loadvm_section_start_full(QEMUFile *f, MigrationIncomingState *mis)
     /* Find savevm section */
     se = find_se(idstr, instance_id);
     if (se == NULL) {
-        error_report("Unknown savevm section or instance '%s' %d",
+        error_report("Unknown savevm section or instance '%s' %d. "
+                     "Make sure that your current VM setup matches your "
+                     "saved VM setup, including any hotplugged devices",
                      idstr, instance_id);
         return -EINVAL;
     }
diff --git a/vl.c b/vl.c
index 5ba06adf78..c63270a76a 100644
--- a/vl.c
+++ b/vl.c
@@ -4620,6 +4620,7 @@ int main(int argc, char **argv, char **envp)
         if (load_snapshot(loadvm, &local_err) < 0) {
             error_report_err(local_err);
             autostart = 0;
+            exit(1);
         }
     }
 
-- 
2.17.1

  parent reply	other threads:[~2018-09-03 22:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-03 22:27 [Qemu-devel] [PULL 0/5] Migration queue Juan Quintela
2018-09-03 22:27 ` [Qemu-devel] [PULL 1/5] migration/rdma: Fix uninitialised rdma_return_path Juan Quintela
2018-09-03 22:27 ` [Qemu-devel] [PULL 2/5] tests/migration: Enable the migration test on s390x, too Juan Quintela
2018-09-03 22:27 ` [Qemu-devel] [PULL 3/5] migration: fix calculating xbzrle_counters.cache_miss_rate Juan Quintela
2018-09-03 22:27 ` [Qemu-devel] [PULL 4/5] migration: handle the error condition properly Juan Quintela
2018-09-03 22:27 ` Juan Quintela [this message]
2018-09-13 13:33 ` [Qemu-devel] [PULL 0/5] Migration queue Juan Quintela

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=20180903222758.13267-6-quintela@redhat.com \
    --to=quintela@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=joserz@linux.ibm.com \
    --cc=lvivier@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).