Patchwork arch_init/ram_load: add error message for block length mismatch

login
register
mail settings
Submitter Alon Levy
Date Dec. 6, 2012, 12:02 p.m.
Message ID <1354795349-2613-1-git-send-email-alevy@redhat.com>
Download mbox | patch
Permalink /patch/204212/
State New
Headers show

Comments

Alon Levy - Dec. 6, 2012, 12:02 p.m.
Signed-off-by: Alon Levy <alevy@redhat.com>
---
 arch_init.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Orit Wasserman - Dec. 6, 2012, 12:11 p.m.
On 12/06/2012 02:02 PM, Alon Levy wrote:
> Signed-off-by: Alon Levy <alevy@redhat.com>
> ---
>  arch_init.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/arch_init.c b/arch_init.c
> index e6effe8..84bca99 100644
> --- a/arch_init.c
> +++ b/arch_init.c
> @@ -808,8 +808,10 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id)
>                      QLIST_FOREACH(block, &ram_list.blocks, next) {
>                          if (!strncmp(id, block->idstr, sizeof(id))) {
>                              if (block->length != length) {
> +                                fprintf(stderr, "Length mismatch: %s: %d "
> +                                        "in != %d\n", id, length,
> +                                        block->length);
>                                  ret =  -EINVAL;
> -                                goto done;
>                              }
>                              break;
>                          }
> 
Reviewed-by: Orit Wasserman <owasserm@redhat.com>

But the real question is what did we break this time? can it be fixed?

Orit
Alon Levy - Dec. 6, 2012, 12:17 p.m.
> On 12/06/2012 02:02 PM, Alon Levy wrote:
> > Signed-off-by: Alon Levy <alevy@redhat.com>
> > ---
> >  arch_init.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/arch_init.c b/arch_init.c
> > index e6effe8..84bca99 100644
> > --- a/arch_init.c
> > +++ b/arch_init.c
> > @@ -808,8 +808,10 @@ static int ram_load(QEMUFile *f, void *opaque,
> > int version_id)
> >                      QLIST_FOREACH(block, &ram_list.blocks, next) {
> >                          if (!strncmp(id, block->idstr,
> >                          sizeof(id))) {
> >                              if (block->length != length) {
> > +                                fprintf(stderr, "Length mismatch:
> > %s: %d "
> > +                                        "in != %d\n", id, length,
> > +                                        block->length);
> >                                  ret =  -EINVAL;
> > -                                goto done;
> >                              }
> >                              break;
> >                          }
> > 
> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
> 
> But the real question is what did we break this time? can it be
> fixed?

qxl - we changed the rom bar size for all revisions of the device. I'm checking the upstream fix and will send it when I'm happy.

> 
> Orit
> 
>

Patch

diff --git a/arch_init.c b/arch_init.c
index e6effe8..84bca99 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -808,8 +808,10 @@  static int ram_load(QEMUFile *f, void *opaque, int version_id)
                     QLIST_FOREACH(block, &ram_list.blocks, next) {
                         if (!strncmp(id, block->idstr, sizeof(id))) {
                             if (block->length != length) {
+                                fprintf(stderr, "Length mismatch: %s: %d "
+                                        "in != %d\n", id, length,
+                                        block->length);
                                 ret =  -EINVAL;
-                                goto done;
                             }
                             break;
                         }