[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] scsi-generic: Simplify error handling code
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] scsi-generic: Simplify error handling code |
Date: |
Thu, 18 Jan 2018 17:19:56 -0500 (EST) |
----- Eduardo Habkost <address@hidden> ha scritto:
> We can do some effort to document the preferred convention to
> return success/failure, but I don't think we will be able to
> convert the existing void/ret/bool functions to a single style
> (whatever it is) in a reasonable time.
>
> That said, IMO returning 0/-1 or true/false is always preferred
> to returning void, so there's no need to add more local_err
> boilerplate code.
I strongly prefer having one way to say things, and having return value and
Error*
(with no clear winner for return value) is a disadvantage. Your solution is
slightly more verbose in that it makes it harder to use && and ||, but I am not
even sure it is a disadvantage. And the clear advantage that a full conversion
is mandatory and can be automated...
Paolo
>
> --
> Eduardo
- [Qemu-devel] [PATCH] scsi-generic: Simplify error handling code, Fam Zheng, 2018/01/17
- Re: [Qemu-devel] [PATCH] scsi-generic: Simplify error handling code, Philippe Mathieu-Daudé, 2018/01/17
- Re: [Qemu-devel] [PATCH] scsi-generic: Simplify error handling code, Paolo Bonzini, 2018/01/18
- Re: [Qemu-devel] [PATCH] scsi-generic: Simplify error handling code, Philippe Mathieu-Daudé, 2018/01/18
- Re: [Qemu-devel] [PATCH] scsi-generic: Simplify error handling code, Paolo Bonzini, 2018/01/18
- Re: [Qemu-devel] [PATCH] scsi-generic: Simplify error handling code, Philippe Mathieu-Daudé, 2018/01/18
- Re: [Qemu-devel] [PATCH] scsi-generic: Simplify error handling code, Paolo Bonzini, 2018/01/18
- Re: [Qemu-devel] [PATCH] scsi-generic: Simplify error handling code, Eric Blake, 2018/01/18
- Re: [Qemu-devel] [PATCH] scsi-generic: Simplify error handling code, Eduardo Habkost, 2018/01/18
- Re: [Qemu-devel] [PATCH] scsi-generic: Simplify error handling code,
Paolo Bonzini <=
- Re: [Qemu-devel] [PATCH] scsi-generic: Simplify error handling code, Eduardo Habkost, 2018/01/18