Patchwork Add error message for loading snapshot without VM state

login
register
mail settings
Submitter Kevin Wolf
Date March 1, 2011, 9:49 a.m.
Message ID <1298972982-7609-1-git-send-email-kwolf@redhat.com>
Download mbox | patch
Permalink /patch/84921/
State New
Headers show

Comments

Kevin Wolf - March 1, 2011, 9:49 a.m.
It already fails, but it didn't tell the user why.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 savevm.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Juan Quintela - March 1, 2011, 10:19 a.m.
Kevin Wolf <kwolf@redhat.com> wrote:
> It already fails, but it didn't tell the user why.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  savevm.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/savevm.c b/savevm.c
> index a50fd31..6e026a8 100644
> --- a/savevm.c
> +++ b/savevm.c
> @@ -1996,6 +1996,8 @@ int load_vmstate(const char *name)
>      if (ret < 0) {
>          return ret;
>      } else if (sn.vm_state_size == 0) {
> +        error_report("This is a disk-only snapshot. Revert to it offline "
> +            "using qemu-img.");
>          return -EINVAL;
>      }

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

Patch

diff --git a/savevm.c b/savevm.c
index a50fd31..6e026a8 100644
--- a/savevm.c
+++ b/savevm.c
@@ -1996,6 +1996,8 @@  int load_vmstate(const char *name)
     if (ret < 0) {
         return ret;
     } else if (sn.vm_state_size == 0) {
+        error_report("This is a disk-only snapshot. Revert to it offline "
+            "using qemu-img.");
         return -EINVAL;
     }