Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NCuGe-0004xj-Rq for qemu-devel@nongnu.org; Tue, 24 Nov 2009 07:13:12 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NCuGY-0004t2-88 for qemu-devel@nongnu.org; Tue, 24 Nov 2009 07:13:10 -0500 Received: from [199.232.76.173] (port=55828 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NCuGW-0004sD-DY for qemu-devel@nongnu.org; Tue, 24 Nov 2009 07:13:04 -0500 Received: from cantor.suse.de ([195.135.220.2]:38358 helo=mx1.suse.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NCuGV-0005xK-U8 for qemu-devel@nongnu.org; Tue, 24 Nov 2009 07:13:04 -0500 Subject: Re: [Qemu-devel] [PATCH 00/10]: QError v4 Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: Alexander Graf In-Reply-To: <20091124095522.436756c2@doriath> Date: Tue, 24 Nov 2009 13:13:00 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <5DF391BB-AE54-45D3-9B27-72D267E76284@suse.de> References: <1258487037-24950-1-git-send-email-lcapitulino@redhat.com> <4B04383A.9050101@linux.vnet.ibm.com> <4B06C00F.3020107@codemonkey.ws> <4B06E854.7080101@codemonkey.ws> <4B0961F0.3070004@codemonkey.ws> <20091123110619.4522c7cc@doriath> <4B0A8A19.6030607@codemonkey.ws> <20091123113413.0c1b05f3@doriath> <20091124095522.436756c2@doriath> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: "qemu-devel@nongnu.org" , "kraxel@redhat.com" , Markus Armbruster On 24.11.2009, at 12:55, Luiz Capitulino wrote: > On Mon, 23 Nov 2009 14:50:05 +0100 > Alexander Graf wrote: >=20 >>=20 >> Am 23.11.2009 um 14:34 schrieb Luiz Capitulino = : >>=20 >>> On Mon, 23 Nov 2009 07:11:53 -0600 >>> Anthony Liguori wrote: >>>=20 >>>> Luiz Capitulino wrote: >>>>> On Sun, 22 Nov 2009 10:08:16 -0600 >>>>> Anthony Liguori wrote: >>>>>=20 >>>>>=20 >>>>>> I'm certainly willing to consider alternative ways to do = qmp_error=20 >>>>>> () but >>>>>> taking a free form string is not an option in my mind. It goes =20= >>>>>> against >>>>>> the fundamentals of what we're trying to build with QMP. >>>>>>=20 >>>>>=20 >>>>> Agreed. >>>>>=20 >>>>>=20 >>>>>> So if you're opposed to structured error data, just having >>>>>> qmp_error(error_code) is a reasonable alternative. I don't think =20= >>>>>> it's >>>>>> the right thing to do, but I think it's still within the spirit =20= >>>>>> of the >>>>>> goals of QMP. >>>>>>=20 >>>>>=20 >>>>> You mean, we would have calls like: >>>>>=20 >>>>> qemu_error_new(error_code, 'device '%s' not found', name); >>>>>=20 >>>>=20 >>>> Except drop the 'device %s not found' bit. >>>=20 >>> We would need a table to have the strings for the user protocol >>> then. Not having the table is a key point in Markus's argument, >>> I guess. >>=20 >> We would need that for internationalization anyways, right? >>=20 >> Though I don't dislike the idea of passing a plain default syntax = over =20 >> the wire as a bonus / fallback. Especially for cases where the ui is =20= >> older than qemu. >>=20 >> So why not have the table inside qemu do a lookup and send that as =20= >> default format in addition to the error code (that should usually be =20= >> used to find out the format)? >=20 > The current proposal does have a table, the argument against it is > that we're making error reporting complex, as developers will have to > edit more than one place to report errors. So why not generate the table from the format strings? So in the code = there would only be qemu_error_new("device '%s' not found", name); and some code parsing magic on commit would put that in the official = table? Alex=