[libvirt] [PATCH 1/3] Turn libvirt.c error reporting functions into macros

Eric Blake eblake at redhat.com
Tue Jan 18 17:53:40 UTC 2011


On 01/18/2011 10:31 AM, Daniel P. Berrange wrote:
> The virLibConnError() function (and related ones) do not correctly
> report line number info. Turn them all into macros so line numbers
> are reported correctly. Drop the connection object in all of them
> since it is no longer used.
> 
> Also from the virLibConnWarning() equivalents completely. Now
> that the Xen driver is running 100% inside libvirtd, those
> codepaths for secondary drivers cannot be reached.
> 
> * src/libvirt.c: Replace error functions with macros
> ---
>  src/libvirt.c | 1708 ++++++++++++++++++++++++---------------------------------
>  1 files changed, 717 insertions(+), 991 deletions(-)

Large, but mostly mechanical.

> @@ -1302,7 +1059,7 @@ do_open (const char *name,
>  
>      if (!ret->driver) {
>          /* If we reach here, then all drivers declined the connection. */
> -        virLibConnError (NULL, VIR_ERR_NO_CONNECT, name);
> +        virLibConnError(VIR_ERR_NO_CONNECT, "No connection for URI %s", NULLSTR(name));

Looks like converting to a macro helped the compiler give better
warnings, too.

ACK.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110118/cb0252f8/attachment-0001.sig>


More information about the libvir-list mailing list