[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 03/22] qapi: add Error object

From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 03/22] qapi: add Error object
Date: Mon, 07 Mar 2011 07:59:24 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20101027 Lightning/1.0b1 Thunderbird/3.0.10

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

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.


Anthony Liguori


reply via email to

[Prev in Thread] Current Thread [Next in Thread]