[Libvir] [PATCH] When reporting errors, use "conn" whenever possible.
Daniel Veillard
veillard at redhat.com
Tue Nov 27 14:49:11 UTC 2007
On Tue, Nov 27, 2007 at 03:34:14PM +0100, Jim Meyering wrote:
> Here's a first cut at cleaning up.
> There are more ab/uses in other files, but nowhere near as
> many as in this one, so I'm starting here:
>
> When reporting errors, use "conn" whenever possible.
>
> * src/remote_internal.c: change all error (NULL, ... to error (conn, ...
> (check_cert_file): Add+use parameter, conn.
> Adjust callers.
> (initialise_gnutls): The "conn" parameter *is* used, so remove
> ATTRIBUTE_UNUSED.
> Suggested by Richard Jones.
Makes sense in general, we should always try to provide as much context
as possible when calling the error handler.
The only exception is maybe when creating a connection, as no error handler
could have been associated to it yet, and the failure is likely to block the
virConnectPtr from being returned (the copy in conn is then useless). But
this is a good thing to do in any case,
thanks a lot ! +1
Daniel
--
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard | virtualization library http://libvirt.org/
veillard at redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
More information about the libvir-list
mailing list