From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38205) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0xMo-0000XP-LN for qemu-devel@nongnu.org; Mon, 23 Nov 2015 15:05:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0xMj-0003ks-J0 for qemu-devel@nongnu.org; Mon, 23 Nov 2015 15:05:38 -0500 Received: from roura.ac.upc.es ([147.83.33.10]:37390) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0xMj-0003kC-4A for qemu-devel@nongnu.org; Mon, 23 Nov 2015 15:05:33 -0500 From: =?utf-8?Q?Llu=C3=ADs_Vilanova?= References: <144830407261.1693.6845199723252391860.stgit@localhost> <144830408403.1693.5595372859320618258.stgit@localhost> <20151123185116.GV18085@redhat.com> Date: Mon, 23 Nov 2015 21:05:30 +0100 In-Reply-To: <20151123185116.GV18085@redhat.com> (Daniel P. Berrange's message of "Mon, 23 Nov 2015 18:51:16 +0000") Message-ID: <87twocfpmd.fsf@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v2 2/2] doc: Introduce coding style for errors List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: Stefan Hajnoczi , Thomas Huth , qemu-devel@nongnu.org, "Dr . David Alan Gilbert" , Markus Armbruster 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