Skip to contentSkip to conversation

block/qapi: Clear err for further error

PATCH In review Fam Zheng 4 participants 4 messages Dec 22, 2015 – Jan 11, 2016 Block layer

lore
Share & tools
lore

Fam Zheng

author
#0 lore raw

PATCH 1/1 block/qapi: Clear err for further error

Since a5002d5 (block/qapi: allow best-effort query) we don't return at this error, however err must be cleared before passing to bdrv_query_snapshot_info_list below, as required by error API.

---
 block/qapi.c | 1 +
 1 file changed, 1 insertion(+)
block/qapi.c +1 -0
index fecac25..58d3975 100644
@@ -250,6 +250,7 @@ void bdrv_query_image_info(BlockDriverState *bs,
             g_free(backing_filename2);
             backing_filename2 = NULL;
             error_free(err);
+            err = NULL;
         }
 
         /* Always report the full_backing_filename if present, even if it's the
Signature · 1 line
2.4.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · Fam Zheng

Since a5002d5 (block/qapi: allow best-effort query) we don't return at this error, however err must be cleared before passing to bdrv_query_snapshot_info_list below, as required by error API.

---
 block/qapi.c | 1 +
 1 file changed, 1 insertion(+)
block/qapi.c +0 -0
index fecac25..58d3975 100644

block/qapi.c void bdrv_query_image_info(BlockDriverState *bs, · line 256

Quoted 7 lines
block/qapi.c +1 -0
@@ -250,6 +250,7 @@ void bdrv_query_image_info(BlockDriverState *bs,
             g_free(backing_filename2);
             backing_filename2 = NULL;
             error_free(err);
+            err = NULL;
         }
 
         /* Always report the full_backing_filename if present, even if it's the

Sorry Markus, I've failed you.

#2 lore raw
Quoted 23 lines · John Snow
Quoted 20 lines · Fam Zheng

Since a5002d5 (block/qapi: allow best-effort query) we don't return at this error, however err must be cleared before passing to bdrv_query_snapshot_info_list below, as required by error API.

---
 block/qapi.c | 1 +
 1 file changed, 1 insertion(+)
block/qapi.c +1 -0
index fecac25..58d3975 100644
@@ -250,6 +250,7 @@ void bdrv_query_image_info(BlockDriverState *bs,
             g_free(backing_filename2);
             backing_filename2 = NULL;
             error_free(err);
+            err = NULL;
         }
 
Quoted 6 lines

block/qapi.c void bdrv_query_image_info(BlockDriverState *bs, · line 256

Quoted 2 lines
block/qapi.c +0 -0
         /* Always report the full_backing_filename if present, even if it's the

Sorry Markus, I've failed you.

As did I by giving an R-b and applying it.

Let us hereby atone for our sins:

https://github.com/XanClic/qemu/commits/block

I hope the spirit of christmas will make Markus forgive us.

Max

#3 lore raw
Quoted 24 lines · Max Reitz
Quoted 23 lines · John Snow
Quoted 20 lines · Fam Zheng

Since a5002d5 (block/qapi: allow best-effort query) we don't return at this error, however err must be cleared before passing to bdrv_query_snapshot_info_list below, as required by error API.

---
 block/qapi.c | 1 +
 1 file changed, 1 insertion(+)
block/qapi.c +1 -0
index fecac25..58d3975 100644
@@ -250,6 +250,7 @@ void bdrv_query_image_info(BlockDriverState *bs,
             g_free(backing_filename2);
             backing_filename2 = NULL;
             error_free(err);
+            err = NULL;
         }
 
Quoted 4 lines
Quoted 4 lines

block/qapi.c void bdrv_query_image_info(BlockDriverState *bs, · line 256

Quoted 2 lines
block/qapi.c +0 -0
         /* Always report the full_backing_filename if present, even if it's the

Sorry Markus, I've failed you.

There, for the grace of God, go I.

Quoted 10 lines
Quoted 1 line

As did I by giving an R-b and applying it.

Let us hereby atone for our sins:

https://github.com/XanClic/qemu/commits/block

I hope the spirit of christmas will make Markus forgive us.

Happy new year!