Re: [PATCH] When reporting errors, use "conn" whenever possible.

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

 



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@xxxxxxxxxx  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]