From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=45621 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pway7-0006ZF-Iy for qemu-devel@nongnu.org; Mon, 07 Mar 2011 08:59:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pway6-0004RG-Lt for qemu-devel@nongnu.org; Mon, 07 Mar 2011 08:59:27 -0500 Received: from mail-yi0-f45.google.com ([209.85.218.45]:54034) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pway6-0004RA-Ir for qemu-devel@nongnu.org; Mon, 07 Mar 2011 08:59:26 -0500 Received: by yib19 with SMTP id 19so2023470yib.4 for ; Mon, 07 Mar 2011 05:59:25 -0800 (PST) Message-ID: <4D74E4BC.6020400@codemonkey.ws> Date: Mon, 07 Mar 2011 07:59:24 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 03/22] qapi: add Error object References: <1299460984-15849-1-git-send-email-aliguori@us.ibm.com> <1299460984-15849-4-git-send-email-aliguori@us.ibm.com> <20110307110600.GH21899@redhat.com> In-Reply-To: <20110307110600.GH21899@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: qemu-devel@nongnu.org, Adam Litke , Markus Armbruster , Luiz Capitulino On 03/07/2011 05:06 AM, Daniel P. Berrange wrote: > On Sun, Mar 06, 2011 at 07:22:45PM -0600, Anthony Liguori wrote: > >> The Error class is similar to QError (now deprecated) except that it supports >> propagation. This allows for higher quality error handling. It's losely >> modeled after glib style GErrors. >> > I know this offers more functionality than GError, but if we're going > to be using GLib IMHO it would be very desirable to just use GError > everywhere. Are the extra arbitary key,value pair fields really a > compelling enough addition to make us not use GError ? libvirt started > off with a very flexible error object that allowed extra string& int > values to be passed with each error, but after 5 years dev there is > not a single place in our code where we use this. Simple error code > and formatted strings have been sufficient, much like GError would > allow. > I wrote Error without even thinking of using GError. My motivation was to move us off of QError. We would lose key/value pairs which are actually quite useful. Consider executing the qmp_cont() command after starting a guest with -S. Right now, we'll throw a DeviceEncrypted error message that contains the drive name and encrypted filename which means a management app can immediately prompt the user for a password and then execute block_passwd. Without key/value pairs, a management tool would need another round trip to do an info block and find out which devices are encrypted before doing the prompt. I need to think a bit more about it. Regards, Anthony Liguori > Regards, > Daniel >