[libvirt] [PATCH 4/5] virdbus: Remove redundant error macro

Eric Blake eblake at redhat.com
Mon May 5 20:02:07 UTC 2014


On 05/03/2014 01:59 PM, Cole Robinson wrote:
> This is the only callsite.
> 
> We drop use of localerror.name here, because it's not actually useful
> to us: rather than the parameter name which received an invalid value
> (which was assumed), it's actually the the dbus errno equivalent.
> Just use the string.
> ---
>  src/util/virdbus.c  | 7 ++++---
>  src/util/virerror.h | 6 ------
>  2 files changed, 4 insertions(+), 9 deletions(-)
> 
> diff --git a/src/util/virdbus.c b/src/util/virdbus.c
> index 709d6ee..03ec028 100644
> --- a/src/util/virdbus.c
> +++ b/src/util/virdbus.c
> @@ -1423,9 +1423,10 @@ virDBusCall(DBusConnection *conn,
>                                                              error ? error : &localerror))) {
>          if (error)
>              ret = 0;
> -        else
> -            virReportDBusServiceError(localerror.message ? localerror.message : "unknown error",
> -                                      localerror.name);
> +        else {
> +            virReportError(VIR_ERR_DBUS_SERVICE, "%s",
> +                localerror.message ? localerror.message : _("unknown error"));
> +        }

Bonus points for getting it translated.

ACK.

-- 
Eric Blake   eblake 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: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140505/111dcd72/attachment-0001.sig>


More information about the libvir-list mailing list