Bug 1016158

Summary: libvirtd dies on bindtextdomain with insufficient error
Product: [Community] Virtualization Tools Reporter: Andreas Fuchs <andreas.fuchs>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED UPSTREAM QA Contact:
Severity: low Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: crobinso, dwalsh, eblake, rbalakri
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-04-14 17:29:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Andreas Fuchs 2013-10-07 15:47:31 UTC
If bindtextdomain failes due to non-existing localization information, libvirtd dies upon startup with a very generic error: 

LC_MESSAGES=non_LANG libvirtd
libvirtd: initialization failed

Instead, libvirtd should fall back to locale "C" or at least give some more meaningful error information.

Small patch introducing both behaviours sent to the mailinglist in parallel.

Comment 1 Eric Blake 2013-10-07 16:26:14 UTC
Mailing list thread, for reference:
https://www.redhat.com/archives/libvir-list/2013-October/msg00296.html

Comment 2 Eric Blake 2013-11-04 21:05:21 UTC
*** Bug 1026514 has been marked as a duplicate of this bug. ***

Comment 3 Cole Robinson 2016-04-12 14:01:21 UTC
I sent a more complete patch:

http://www.redhat.com/archives/libvir-list/2016-April/msg00575.html

Comment 4 Cole Robinson 2016-04-14 17:29:12 UTC
commit e7db22781071a39668276a395fb547c0dd90875d
Author: Cole Robinson <crobinso>
Date:   Tue Apr 12 18:29:52 2016 -0400

    util: Add virGettextInitialize, convert the code
    
    Take setlocale/gettext error handling pattern from tools/virsh-*
    and use it for all standalone binaries via a new shared
    virGettextInitialize routine. The virsh* pattern differed slightly
    from other callers. All users now consistently:
    
    * Ignore setlocale errors. virsh has done this forever, presumably for
      good reason. This has been partially responsible for some bug reports:
    
      https://bugzilla.redhat.com/show_bug.cgi?id=1312688
      https://bugzilla.redhat.com/show_bug.cgi?id=1026514
      https://bugzilla.redhat.com/show_bug.cgi?id=1016158
    
    * Report the failed function name
    * Report strerror