mirror: drop local_err in mirror_compelte
PATCH 1/1 mirror: drop local_err in mirror_compelte
There is errp passed in, so no need for local_err and error_propagate.
--- block/mirror.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
block/mirror.c +1 -3
@@ -505,15 +505,13 @@ static void mirror_iostatus_reset(BlockJob *job)static void mirror_complete (BlockJob *job,Error **errp) {MirrorBlockJob *s =container_of (job, MirrorBlockJob, common); -Error *local_err =NULL ;int ret; - ret =bdrv_open_backing_file (s->target,NULL , &local_err); + ret =bdrv_open_backing_file (s->target,NULL , errp);if (ret <0 ) {char backing_filename[PATH_MAX ];bdrv_get_full_backing_filename (s->target, backing_filename,sizeof (backing_filename)); -error_propagate (errp, local_err);return ; }if (!s->synced) {
Signature · 1 line
1.8.3.1
Quoted 1 line · Fam Zheng
There is errp passed in, so no need for
local_erranderror_propagate.
s/compelte/complete/ in the subject
Quoted 16 lines
Signed-off-by Fam Zheng <[email protected]>--- block/mirror.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)block/mirror.c +0
-1@@ -505,15 +505,13 @@ static void mirror_iostatus_reset(BlockJob *job)static void mirror_complete (BlockJob *job,Error **errp) {MirrorBlockJob *s =container_of (job, MirrorBlockJob, common); -Error *local_err =NULL ;
block/mirror.c static void mirror_iostatus_reset(BlockJob *job) · line 515
Quoted 10 lines
block/mirror.c +1
-2int ret; - ret =bdrv_open_backing_file (s->target,NULL , &local_err); + ret =bdrv_open_backing_file (s->target,NULL , errp);if (ret <0 ) {char backing_filename[PATH_MAX ];bdrv_get_full_backing_filename (s->target, backing_filename,sizeof (backing_filename)); -error_propagate (errp, local_err);return ;
What purpose does backing_filename serve? It looks like it was rendered dead code with the introduction of commit 34b5d2c, and that you could simplify further to:
if (bdrv_open_backing_file(s->target, NULL, errp) < 0) {
return;
}Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Quoted 36 lines · Eric Blake
Quoted 1 line · Fam Zheng
There is errp passed in, so no need for
local_erranderror_propagate.s/compelte/complete/ in the subject
Quoted 16 lines
Signed-off-by Fam Zheng <[email protected]>--- block/mirror.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)block/mirror.c +0
-1@@ -505,15 +505,13 @@ static void mirror_iostatus_reset(BlockJob *job)static void mirror_complete (BlockJob *job,Error **errp) {MirrorBlockJob *s =container_of (job, MirrorBlockJob, common); -Error *local_err =NULL ;block/mirror.c static void mirror_iostatus_reset(BlockJob *job) · line 515
Quoted 10 lines
block/mirror.c +1
-2int ret; - ret =bdrv_open_backing_file (s->target,NULL , &local_err); + ret =bdrv_open_backing_file (s->target,NULL , errp);if (ret <0 ) {char backing_filename[PATH_MAX ];bdrv_get_full_backing_filename (s->target, backing_filename,sizeof (backing_filename)); -error_propagate (errp, local_err);return ;What purpose does
backing_filenameserve? It looks like it was rendered dead code with the introduction of commit 34b5d2c, and that you could simplify further to:
Quoted 4 lines
if (bdrv_open_backing_file(s->target, NULL, errp) < 0) {
return;
}Good idea, thanks!
Fam