[Qemu-devel] [PATCH v4 0/3] qapi/error: converts error_setg(&error_fatal) to error_report() + exit()

Philippe Mathieu-Daudé posted 3 patches 5 years, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20180625165749.3910-1-f4bug@amsat.org
Test checkpatch passed
Test docker-mingw@fedora passed
Test docker-quick@centos7 passed
Test s390x passed
device_tree.c       | 23 +++++++++++---------
hw/arm/sysbus-fdt.c | 53 +++++++++++++++++++++++++--------------------
hw/block/fdc.c      |  9 +-------
3 files changed, 44 insertions(+), 41 deletions(-)
[Qemu-devel] [PATCH v4 0/3] qapi/error: converts error_setg(&error_fatal) to error_report() + exit()
Posted by Philippe Mathieu-Daudé 5 years, 10 months ago
Hi,

This series converts error_setg(&error_fatal) to error_report() + exit() as
suggested by the "qapi/error.h" documentation.

This reduce Coverity and Clang static analyzer positive falses.

See http://lists.nongnu.org/archive/html/qemu-devel/2017-07/msg07585.html:

    On 07/24/2017 04:52 PM, Eric Blake wrote:
    That's a shame.  Rather, we should patch this file (and others) to avoid
    all the inconsistent uses of error_setg(&error_*), to comply with the
    error.h documentation.

Since v3:
- corrected error display in copy_properties_from_host (Eric)
  display error if property required and returned -FDT_ERR_NOTFOUND
- resetted Markus R-b tag

Since v2:
- added R-b, A-b (Markus, John, David)
- fixed incorrect update of sysbus-fdt patch between v1->v2 (Markus)

Since v1:
- patch #1: use assert() directly (Markus explanation)
- patch #2: use abort() without error_report() (Markus 'no lipstick')
- patch #3: replaced exit() by assert() (Markus)
- patch #4: no change, added R-b

Regards,

Phil.

[----] : patches are identical
[####] : number of functional differences between upstream/downstream patch
The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively

001/3:[----] [--] 'hw/block/fdc: Replace error_setg(&error_abort) by assert()'
002/3:[0010] [FC] 'hw/arm/sysbus-fdt: Replace error_setg(&error_fatal) by error_report() + exit()'
003/3:[----] [--] 'device_tree: Replace error_setg(&error_fatal) by error_report() + exit()'

Philippe Mathieu-Daudé (3):
  hw/block/fdc: Replace error_setg(&error_abort) by assert()
  hw/arm/sysbus-fdt: Replace error_setg(&error_fatal) by error_report() + exit()
  device_tree: Replace error_setg(&error_fatal) by error_report() + exit()

 device_tree.c       | 23 +++++++++++---------
 hw/arm/sysbus-fdt.c | 53 +++++++++++++++++++++++++--------------------
 hw/block/fdc.c      |  9 +-------
 3 files changed, 44 insertions(+), 41 deletions(-)

-- 
2.18.0


Re: [Qemu-devel] [PATCH v4 0/3] qapi/error: converts error_setg(&error_fatal) to error_report() + exit()
Posted by Peter Maydell 5 years, 10 months ago
On 25 June 2018 at 17:57, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> Hi,
>
> This series converts error_setg(&error_fatal) to error_report() + exit() as
> suggested by the "qapi/error.h" documentation.
>
> This reduce Coverity and Clang static analyzer positive falses.
>
> See http://lists.nongnu.org/archive/html/qemu-devel/2017-07/msg07585.html:
>
>     On 07/24/2017 04:52 PM, Eric Blake wrote:
>     That's a shame.  Rather, we should patch this file (and others) to avoid
>     all the inconsistent uses of error_setg(&error_*), to comply with the
>     error.h documentation.
>

Applied to target-arm.next, thanks. (Not all arm code, but mostly
close enough that that seems the easiest way to deal with it.)

thanks
-- PMM

Re: [Qemu-devel] [PATCH v4 0/3] qapi/error: converts error_setg(&error_fatal) to error_report() + exit()
Posted by Philippe Mathieu-Daudé 5 years, 10 months ago
On 06/28/2018 10:51 AM, Peter Maydell wrote:
> On 25 June 2018 at 17:57, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>> Hi,
>>
>> This series converts error_setg(&error_fatal) to error_report() + exit() as
>> suggested by the "qapi/error.h" documentation.
>>
>> This reduce Coverity and Clang static analyzer positive falses.
>>
>> See http://lists.nongnu.org/archive/html/qemu-devel/2017-07/msg07585.html:
>>
>>     On 07/24/2017 04:52 PM, Eric Blake wrote:
>>     That's a shame.  Rather, we should patch this file (and others) to avoid
>>     all the inconsistent uses of error_setg(&error_*), to comply with the
>>     error.h documentation.
>>
> 
> Applied to target-arm.next, thanks. (Not all arm code, but mostly
> close enough that that seems the easiest way to deal with it.)

Thanks!