Skip to contentSkip to conversation

block: Fix error path in bdrv_backing_update_filename()

PATCH In review Kevin Wolf 5 participants 6 messages Nov 6, 2017 – Nov 16, 2017

lore
Share & tools
lore

Kevin Wolf

author
#0 lore raw

PATCH 1/1 block: Fix error path in bdrv_backing_update_filename()

error_setg_errno() takes a positive errno code.

---
 block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block.c +1 -1
index 684cb018da..f6415547fe 100644
@@ -998,7 +998,7 @@ static int bdrv_backing_update_filename(BdrvChild *c, BlockDriverState *base,
     ret = bdrv_change_backing_file(parent, filename,
                                    base->drv ? base->drv->format_name : "");
     if (ret < 0) {
-        error_setg_errno(errp, ret, "Could not update backing file link");
+        error_setg_errno(errp, -ret, "Could not update backing file link");
     }
 
     if (!(orig_flags & BDRV_O_RDWR)) {
Signature · 1 line
2.13.6
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Kevin Wolf

error_setg_errno() takes a positive errno code.

---
 block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Worth mentioning Coverity in the commit message?

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
#4 lore raw
In reply to Kevin Wolf
Quoted 21 lines · Kevin Wolf

error_setg_errno() takes a positive errno code.

---
 block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block.c +1 -2
index 684cb018da..f6415547fe 100644
@@ -998,7 +998,7 @@ static int bdrv_backing_update_filename(BdrvChild *c, BlockDriverState *base,
     ret = bdrv_change_backing_file(parent, filename,
                                    base->drv ? base->drv->format_name : "");
     if (ret < 0) {
-        error_setg_errno(errp, ret, "Could not update backing file link");
+        error_setg_errno(errp, -ret, "Could not update backing file link");
     }
 
     if (!(orig_flags & BDRV_O_RDWR)) {
--
Quoted 1 line

2.13.6

Just noticed going through coverity warnings that this didn't make it into rc1 -- could we get it in for rc2, please?

thanks
-- PMM

author
#5 lore raw

Am 15.11.2017 um 20:41 hat Peter Maydell geschrieben:

Quoted 20 lines · Kevin Wolf
Quoted 19 lines

error_setg_errno() takes a positive errno code.

---
 block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block.c +1 -1
index 684cb018da..f6415547fe 100644
@@ -998,7 +998,7 @@ static int bdrv_backing_update_filename(BdrvChild *c, BlockDriverState *base,
     ret = bdrv_change_backing_file(parent, filename,
                                    base->drv ? base->drv->format_name : "");
     if (ret < 0) {
-        error_setg_errno(errp, ret, "Could not update backing file link");
+        error_setg_errno(errp, -ret, "Could not update backing file link");
     }
 
Quoted 6 lines
Quoted 3 lines
block.c +0 -1
     if (!(orig_flags & BDRV_O_RDWR)) {
--

2.13.6

Just noticed going through coverity warnings that this didn't make it into rc1 -- could we get it in for rc2, please?

Yes. I was sick at the start of the week and Max didn't include my queue in his pull request, so all the patches I had queued missed -rc1 and will be sent for -rc2 instead.

Kevin