[libvirt] [PATCH 07/13] Convert all files in src/conf/ to use virReportError()

Eric Blake eblake at redhat.com
Wed Jul 18 16:59:18 UTC 2012


On 07/18/2012 05:52 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at redhat.com>
> 
> This rmoves all the per-file error reporting macros

s/rmoves/removes/

> from the code in src/conf/
> 
> Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
> ---
>  28 files changed, 1912 insertions(+), 1927 deletions(-)

Eep, that's big, so I'm assuming it's mostly mechanical.  But I didn't
spot anything obviously wrong while skimming through this message, other
than the typo in the commit log.

ACK.

> +++ b/src/nwfilter/nwfilter_dhcpsnoop.c
> @@ -69,6 +69,10 @@
>  
>  #define VIR_FROM_THIS VIR_FROM_NWFILTER
>  
> +#define virNWFilterReportError(code, fmt...)                       \
> +    virReportErrorHelper(VIR_FROM_NWFILTER, code, __FILE__,        \
> +                         __FUNCTION__, __LINE__, fmt)
> +
>  #ifdef HAVE_LIBPCAP
>  
>  # define LEASEFILE LOCALSTATEDIR "/run/libvirt/network/nwfilter.leases"

I first thought "What for?" when I saw this; then I realized - you
removed it out of the .h, but as this is src/nwfilter and not src/conf,
you had to (temporarily) re-add it here in the .c to keep things
compiling, and a later patch will again nuke it.  Nothing to see here,
move on...

> +++ b/src/test/test_driver.c
> @@ -5129,7 +5129,7 @@ testNodeDeviceLookupByName(virConnectPtr conn, const char *name)
>      testDriverUnlock(driver);
>  
>      if (!obj) {
> -        virNodeDeviceReportError(VIR_ERR_NO_NODE_DEVICE, NULL);
> +        testError(VIR_ERR_NO_NODE_DEVICE, NULL);

Even more fun - we were using the wrong error (thanks to the .h
pollution), but will still touch this line again in later patches.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

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


More information about the libvir-list mailing list