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