Patchwork [for-1.4,stable,1/3] block-migration: improve "Unknown flags" error message

login
register
mail settings
Submitter Stefan Hajnoczi
Date Feb. 9, 2013, 6:01 p.m.
Message ID <1360432919-1379-2-git-send-email-stefanha@redhat.com>
Download mbox | patch
Permalink /patch/219416/
State New
Headers show

Comments

Stefan Hajnoczi - Feb. 9, 2013, 6:01 p.m.
Show the actual flags value and include "block migration" in the error
message so it's clear where the error is coming from.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 block-migration.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Paolo Bonzini - Feb. 11, 2013, 10:16 a.m.
Il 09/02/2013 19:01, Stefan Hajnoczi ha scritto:
> Show the actual flags value and include "block migration" in the error
> message so it's clear where the error is coming from.
> 
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>  block-migration.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/block-migration.c b/block-migration.c
> index 9ac7de6..573319a 100644
> --- a/block-migration.c
> +++ b/block-migration.c
> @@ -695,7 +695,7 @@ static int block_load(QEMUFile *f, void *opaque, int version_id)
>                     (addr == 100) ? '\n' : '\r');
>              fflush(stdout);
>          } else if (!(flags & BLK_MIG_FLAG_EOS)) {
> -            fprintf(stderr, "Unknown flags\n");
> +            fprintf(stderr, "Unknown block migration flags: %#x\n", flags);
>              return -EINVAL;
>          }
>          ret = qemu_file_get_error(f);
> 

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Juan Quintela - Feb. 11, 2013, 12:55 p.m.
Stefan Hajnoczi <stefanha@redhat.com> wrote:
> Show the actual flags value and include "block migration" in the error
> message so it's clear where the error is coming from.
>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>

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

Patch

diff --git a/block-migration.c b/block-migration.c
index 9ac7de6..573319a 100644
--- a/block-migration.c
+++ b/block-migration.c
@@ -695,7 +695,7 @@  static int block_load(QEMUFile *f, void *opaque, int version_id)
                    (addr == 100) ? '\n' : '\r');
             fflush(stdout);
         } else if (!(flags & BLK_MIG_FLAG_EOS)) {
-            fprintf(stderr, "Unknown flags\n");
+            fprintf(stderr, "Unknown block migration flags: %#x\n", flags);
             return -EINVAL;
         }
         ret = qemu_file_get_error(f);