[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 2/2] doc: Introduce coding style for errors
From: |
Lluís Vilanova |
Subject: |
Re: [Qemu-devel] [PATCH v2 2/2] doc: Introduce coding style for errors |
Date: |
Mon, 23 Nov 2015 21:05:30 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Daniel P Berrange writes:
[...]
> I don't think this "Errors in user inputs" vs "Other errors" distinction
> really makes sense. Whether an error raised in a piece of code is related
> to user input or not is almost impossible to determine in practice. So as
> a rule to follow it is not practical.
> AFAIK, include/qemu/error-report.h is the historical failed experiment
> in structured error reporting, while include/qapi/error.h is the new
> preferred error reporting system that everything should be using.
> On this basis, I'd simply say that include/qemu/error-report.h is
> legacy code that should no longer be used, and that new code should
> use include/qapi/error.h exclusively and existing code converted
> where practical.
Mmmm, I've just reviewed both headers and you sound partially right.
AFAIU, "qemu/error-report.h" contains the additional logic to manage "input
locations", not present anywhere else. Also, you state that only the reporting
functions in "qemu/error.h" should be used.
Since "qemu/error.h" internally uses 'error_report()' (from
"qemu/error-report.h"), it includes the input location information (if any). So,
I will simply refer to "qemu/error.h" for the general reporting functions, plus
the location management functions in "qemu/error-report.h".
Does this sound to follow the expected flow of latest QEMU?
Thanks,
Lluis
--
"And it's much the same thing with knowledge, for whenever you learn
something new, the whole world becomes that much richer."
-- The Princess of Pure Reason, as told by Norton Juster in The Phantom
Tollbooth
- [Qemu-devel] [RFC][PATCH v2 0/2] utils: Improve and document error reporting, Lluís Vilanova, 2015/11/23
- [Qemu-devel] [PATCH v2 1/2] utils: Add warning messages, Lluís Vilanova, 2015/11/23
- [Qemu-devel] [PATCH v2 2/2] doc: Introduce coding style for errors, Lluís Vilanova, 2015/11/23
- Re: [Qemu-devel] [PATCH v2 2/2] doc: Introduce coding style for errors, Markus Armbruster, 2015/11/24
- Re: [Qemu-devel] [PATCH v2 2/2] doc: Introduce coding style for errors, Lluís Vilanova, 2015/11/24
- Re: [Qemu-devel] [PATCH v2 2/2] doc: Introduce coding style for errors, Markus Armbruster, 2015/11/24