[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
- [Qemu-devel] [PATCH v2 07/20] gluster: default scheme to gluster:// and host to localhost., (continued)
- [Qemu-devel] [PATCH v2 07/20] gluster: default scheme to gluster:// and host to localhost., Paolo Bonzini, 2014/02/11
- [Qemu-devel] [PATCH v2 06/20] iscsi: correctly propagate errors in iscsi_open, Paolo Bonzini, 2014/02/11
- [Qemu-devel] [PATCH v2 08/20] gluster: correctly propagate errors, Paolo Bonzini, 2014/02/11
- [Qemu-devel] [PATCH v2 10/20] curl: correctly propagate errors, Paolo Bonzini, 2014/02/11
- [Qemu-devel] [PATCH v2 09/20] cow: correctly propagate errors, Paolo Bonzini, 2014/02/11
[Qemu-devel] [PATCH v2 11/20] qcow: correctly propagate errors, Paolo Bonzini, 2014/02/11
[Qemu-devel] [PATCH v2 12/20] qed: correctly propagate errors, Paolo Bonzini, 2014/02/11
[Qemu-devel] [PATCH v2 13/20] vhdx: correctly propagate errors, Paolo Bonzini, 2014/02/11
[Qemu-devel] [PATCH v2 14/20] vvfat: correctly propagate errors, Paolo Bonzini, 2014/02/11
[Qemu-devel] [PATCH v2 15/20] vmdk: extract vmdk_read_desc, Paolo Bonzini, 2014/02/11
[Qemu-devel] [PATCH v2 16/20] vmdk: push vmdk_read_desc up to caller, Paolo Bonzini, 2014/02/11
[Qemu-devel] [PATCH v2 17/20] vmdk: do not try opening a file as both image and descriptor, Paolo Bonzini, 2014/02/11
[Qemu-devel] [PATCH v2 18/20] vmdk: correctly propagate errors, Paolo Bonzini, 2014/02/11
[Qemu-devel] [PATCH v2 19/20] block: do not abuse EMEDIUMTYPE, Paolo Bonzini, 2014/02/11