arch_init/ram_load: add error message for block length mismatch
PATCH 1/1 arch_init/ram_load: add error message for block length mismatch
--- arch_init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch_init.c +3 -1
@@ -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 ; }
Signature · 1 line
1.8.0.1
PATCH v2 1/1 arch_init/ram_load: add error message for block length mismatch
---
Please ignore previous version, accidentally removed goto done and used wrong format size specifiers.
arch_init.c | 3 +++ 1 file changed, 3 insertions(+)
arch_init.c +3 -0
@@ -808,6 +808,9 @@ 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: %ld " +"in != %ld\n" , id, length, + block->length); ret = -EINVAL ; goto done; }
Signature · 1 line
1.8.0.1
Quoted 4 lines · Alon Levy
Signed-off-by Alon Levy <[email protected]>---
Please ignore previous version, accidentally removed goto done and used wrong format size specifiers.
missed that too, but I'm adding better error messages anyway :)
Quoted 19 lines
arch_init.c | 3 +++ 1 file changed, 3 insertions(+)arch_init.c +3
-0@@ -808,6 +808,9 @@ 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: %ld " +"in != %ld\n" , id, length, + block->length); ret = -EINVAL ; goto done; }
Quoted 13 lines · Alon Levy
Signed-off-by Alon Levy <[email protected]>---
Please ignore previous version, accidentally removed goto done and used wrong format size specifiers.arch_init.c | 3 +++ 1 file changed, 3 insertions(+)arch_init.c +0
-0
arch_init.c static int ram_load(QEMUFile *f, void *opaque, int version_id) · line 813
Quoted 6 lines
arch_init.c +3
-0@@ -808,6 +808,9 @@ 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: %ld " +"in != %ld\n" , id, length, + block->length);
Please use RAM_ADDR_FMT for ram_addr_t values.
Stefan
Quoted 12 lines · Alon Levy
Signed-off-by Alon Levy <[email protected]>--- arch_init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)arch_init.c +0
-0@@ -808,8 +808,10 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id) QLIST_FOREACH(block, &ram_list.blocks, next) {
arch_init.c static int ram_load(QEMUFile *f, void *opaque, int version_id) · line 817
Quoted 10 lines
arch_init.c +3
-1if (!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 ; }
But the real question is what did we break this time? can it be fixed?
Orit
Quoted 28 lines · Alon Levy
Quoted 18 lines
Signed-off-by Alon Levy <[email protected]>--- arch_init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)arch_init.c +1
-0@@ -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 "
arch_init.c static int ram_load(QEMUFile *f, void *opaque, int version_id) · line 817
Quoted 7 lines
arch_init.c +2
-1+"in != %d\n" , id, length, + block->length); ret = -EINVAL ; - goto done; }break ; }Reviewed-by Orit Wasserman <[email protected]>
Quoted 2 lines
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.
Quoted 4 lines
Orit