diff mbox

block: Fix error path in bdrv_backing_update_filename()

Message ID 20171106165500.30278-1-kwolf@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kevin Wolf Nov. 6, 2017, 4:55 p.m. UTC
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(-)

Comments

Eric Blake Nov. 6, 2017, 5:04 p.m. UTC | #1
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?
Alberto Garcia Nov. 6, 2017, 8:18 p.m. UTC | #2
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
Stefan Hajnoczi Nov. 9, 2017, 11:24 a.m. UTC | #3
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>
Peter Maydell Nov. 15, 2017, 7:41 p.m. UTC | #4
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
Kevin Wolf Nov. 16, 2017, 11:59 a.m. UTC | #5
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
diff mbox

Patch

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)) {