All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Add a hint message to loadvm and exits on failure
@ 2018-09-03 16:26 Jose Ricardo Ziviani
  2018-09-03 17:49 ` Juan Quintela
  0 siblings, 1 reply; 2+ messages in thread
From: Jose Ricardo Ziviani @ 2018-09-03 16:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: quintela, dgilbert, pbonzini

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>
---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] Add a hint message to loadvm and exits on failure
  2018-09-03 16:26 [Qemu-devel] [PATCH] Add a hint message to loadvm and exits on failure Jose Ricardo Ziviani
@ 2018-09-03 17:49 ` Juan Quintela
  0 siblings, 0 replies; 2+ messages in thread
From: Juan Quintela @ 2018-09-03 17:49 UTC (permalink / raw)
  To: Jose Ricardo Ziviani; +Cc: qemu-devel, dgilbert, pbonzini

Jose Ricardo Ziviani <joserz@linux.ibm.com> wrote:
> 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>

Reviewed-by: Juan Quintela <quintela@redhat.com>

There are two bits of functionality on your patch, I will have put it as
two patches (yes, I know they are both trivial, but comment is bigger
than it should be).

Queued.


> ---
>  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);
>          }
>      }

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-09-03 17:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-03 16:26 [Qemu-devel] [PATCH] Add a hint message to loadvm and exits on failure Jose Ricardo Ziviani
2018-09-03 17:49 ` Juan Quintela

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.