[libvirt] g_error considered harmful

Christophe Fergeau cfergeau at redhat.com
Tue Jan 17 13:05:33 UTC 2012


On Mon, Jan 16, 2012 at 03:01:00PM +0100, Christophe Fergeau wrote:
> Hi,
> 
> g_error calls abort() when it's called, thus it should only be used for
> bad assertion failures. We currently are using it in some places in
> libvirt-gobject as if it was g_warning. This patch series gets rid of most
> occurrences of g_error by either replacing it with g_warning or by adding a
> GError ** argument to  the function calling g_error.

And I forgot to mention that the only remaining use of g_error are in
gvir_init_object and gvir_init_config where it's probably acceptable to die
if things didn't work as expected.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120117/60fcb69c/attachment-0001.sig>


More information about the libvir-list mailing list