From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NCYi2-0000qb-Jd for qemu-devel@nongnu.org; Mon, 23 Nov 2009 08:12:02 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NCYhx-0000og-57 for qemu-devel@nongnu.org; Mon, 23 Nov 2009 08:12:01 -0500 Received: from [199.232.76.173] (port=52686 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NCYhw-0000oX-Vy for qemu-devel@nongnu.org; Mon, 23 Nov 2009 08:11:57 -0500 Received: from mail-qy0-f194.google.com ([209.85.221.194]:57309) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NCYhw-0005QE-KP for qemu-devel@nongnu.org; Mon, 23 Nov 2009 08:11:56 -0500 Received: by qyk32 with SMTP id 32so2514024qyk.4 for ; Mon, 23 Nov 2009 05:11:56 -0800 (PST) Message-ID: <4B0A8A19.6030607@codemonkey.ws> Date: Mon, 23 Nov 2009 07:11:53 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 00/10]: QError v4 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> In-Reply-To: <20091123110619.4522c7cc@doriath> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: kraxel@redhat.com, Markus Armbruster , qemu-devel@nongnu.org Luiz Capitulino wrote: > On Sun, 22 Nov 2009 10:08:16 -0600 > Anthony Liguori wrote: > > >> I'm certainly willing to consider alternative ways to do qmp_error() but >> taking a free form string is not an option in my mind. It goes against >> the fundamentals of what we're trying to build with QMP. >> > > Agreed. > > >> So if you're opposed to structured error data, just having >> qmp_error(error_code) is a reasonable alternative. I don't think it's >> the right thing to do, but I think it's still within the spirit of the >> goals of QMP. >> > > You mean, we would have calls like: > > qemu_error_new(error_code, 'device '%s' not found', name); > Except drop the 'device %s not found' bit. > and on the wire: > > { "error": 1234 } > > Did I get it right? > > If so, I can see some problems with it: > > 1. It's impossible to know what 1234 means by watching the > protocol on the wire. Although this is a machine protocol, > this is a good feature > > 2. We may have errors where having the error data is needed, > and iirc someone gave an example of this some hundreds > of emails ago > > 3. A new error will require a new code. Classes have the > advantage of becoming stable over time and we'll end up > just automatically reusing existing ones > Yes, this is why I'm happy with the current state of QError. We address all of these problems nicely :-) Regards, Anthony Liguori