Re: [PATCH 3/4] Switch libvirtd config loading code to use error APIs

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

 



On 04/04/2012 08:07 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
> 
> Using VIR_ERROR means the test suite can't catch error messages
> easily. Use the proper error reporting APIs instead
> ---
>  daemon/libvirtd-config.c |   56 ++++++++++++++++++++++++++++-----------------
>  daemon/libvirtd.c        |    6 ++++-
>  2 files changed, 40 insertions(+), 22 deletions(-)
> 

> +++ b/daemon/libvirtd.c
> @@ -923,7 +923,11 @@ int main(int argc, char **argv) {
>      /* Read the config file if it exists*/
>      if (remote_config_file &&
>          daemonConfigLoadFile(config, remote_config_file, implicit_conf) < 0) {
> -        VIR_ERROR(_("Can't load config file '%s'"), remote_config_file);
> +        virErrorPtr err = virGetLastError();
> +        if (err && err->message)
> +            VIR_ERROR(_("%s"), err->message);

Huh?  _("%s") is useless (no one needs to translate the printf format
that just outputs a string).  This should be

VIR_ERROR("%s", err->message);

ACK with that nit fixed.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
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]