[Qemu-devel] [PATCH] block: Fix error path in bdrv_backing_update_filename()

Kevin Wolf posted 1 patch 6 years, 5 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20171106165500.30278-1-kwolf@redhat.com
Test checkpatch passed
Test docker passed
Test ppc passed
Test s390x passed
block.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[Qemu-devel] [PATCH] block: Fix error path in bdrv_backing_update_filename()
Posted by Kevin Wolf 6 years, 5 months ago
error_setg_errno() takes a positive errno code.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block.c b/block.c
index 684cb018da..f6415547fe 100644
--- a/block.c
+++ b/block.c
@@ -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)) {
-- 
2.13.6


Re: [Qemu-devel] [PATCH] block: Fix error path in bdrv_backing_update_filename()
Posted by Eric Blake 6 years, 5 months ago
On 11/06/2017 10:55 AM, Kevin Wolf wrote:
> error_setg_errno() takes a positive errno code.
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  block.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

Worth mentioning Coverity in the commit message?

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Re: [Qemu-devel] [Qemu-block] [PATCH] block: Fix error path in bdrv_backing_update_filename()
Posted by Alberto Garcia 6 years, 5 months ago
On Mon 06 Nov 2017 05:55:00 PM CET, Kevin Wolf <kwolf@redhat.com> wrote:
> error_setg_errno() takes a positive errno code.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>

Reviewed-by: Alberto Garcia <berto@igalia.com>

Berto

Re: [Qemu-devel] [PATCH] block: Fix error path in bdrv_backing_update_filename()
Posted by Stefan Hajnoczi 6 years, 5 months ago
On Mon, Nov 06, 2017 at 05:55:00PM +0100, Kevin Wolf wrote:
> error_setg_errno() takes a positive errno code.
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  block.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Re: [Qemu-devel] [PATCH] block: Fix error path in bdrv_backing_update_filename()
Posted by Peter Maydell 6 years, 5 months ago
On 6 November 2017 at 16:55, Kevin Wolf <kwolf@redhat.com> wrote:
> error_setg_errno() takes a positive errno code.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  block.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/block.c b/block.c
> index 684cb018da..f6415547fe 100644
> --- a/block.c
> +++ b/block.c
> @@ -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)) {
> --
> 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

Re: [Qemu-devel] [PATCH] block: Fix error path in bdrv_backing_update_filename()
Posted by Kevin Wolf 6 years, 5 months ago
Am 15.11.2017 um 20:41 hat Peter Maydell geschrieben:
> On 6 November 2017 at 16:55, Kevin Wolf <kwolf@redhat.com> wrote:
> > error_setg_errno() takes a positive errno code.
> >
> > Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> > ---
> >  block.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/block.c b/block.c
> > index 684cb018da..f6415547fe 100644
> > --- a/block.c
> > +++ b/block.c
> > @@ -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)) {
> > --
> > 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