qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 09/20] cow: correctly propagate errors


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH v2 09/20] cow: correctly propagate errors
Date: Fri, 14 Feb 2014 19:19:26 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Am 14.02.2014 um 18:02 hat Paolo Bonzini geschrieben:
> Il 14/02/2014 17:45, Kevin Wolf ha scritto:
> >>> -    ret = bdrv_file_open(&cow_bs, filename, NULL, NULL, BDRV_O_RDWR,
> >>> -                         &local_err);
> >>> +    ret = bdrv_file_open(&cow_bs, filename, NULL, NULL, BDRV_O_RDWR, 
> >>> errp);
> >>>      if (ret < 0) {
> >>> -        qerror_report_err(local_err);
> >>> -        error_free(local_err);
> >>>          return ret;
> >>>      }
> >This is technically correct, but I think general policy is that using
> >the local_err pattern is preferred anyway.
> 
> I think only for void-returning functions.  I checked callers of
> monitor_get_fd and they use this pattern, even if they pass
> &local_err instead of errp.

Eventually this function will return void; having both a -errno return
and the errp argument is just an intermediate step (as probably in all
other cases). So I still think this is going in the wrong direction and
will make the conversion harder than necessary. Now that this patch
series is already here, I won't insist on respinning it, but please
be aware that you're just creating additional work for other people and
keep existing local_errs in any future patches.

Kevin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]