Re: [PATCH 7/9] Add systemd journal support

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

 



On 09/28/2012 02:08 AM, Daniel P. Berrange wrote:

>>> +static int virLogAddOutputToJournald(int priority)
>>> +{
>>> +    if ((journalfd = socket(AF_UNIX, SOCK_DGRAM, 0)) < 0)
>>> +        return -1;
>>> +    if (virSetInherit(journalfd, false) < 0) {
>>
>> Why not use SOCK_DGRAM | SOCK_CLOEXEC in the socket() call?
> 
> It wasn't clear to me whether GNULIB provides compat for
> SOCK_CLOEXEC or not. Even though we're only Linux, older
> glibc won't provide that

I looked; gnulib guarantees SOCK_CLOEXEC for accept4(), but has not yet
ported it to socket().  I guess we stick with two calls for now.

> 
>>> @@ -1114,6 +1285,12 @@ virLogParseOutputs(const char *outputs)
>>>                  count++;
>>>              VIR_FREE(name);
>>>              VIR_FREE(abspath);
>>> +        } else if (STREQLEN(cur, "journald", 8)) {
>>> +            cur += 8;
>>> +#if HAVE_SYSLOG_H
>>
>> Do we really want to silently parse and ignore 'journald' on systems
>> that lack syslog.h?
> 
> I just followed the same pattern that we used with the
> syslog parsing.

Reading patch 8/9 makes me concur - there, we try a log style, then if
is it silently ignored, virLogGetNbOutputs() returns 0, so we try the
next log style.  This is fine after all.

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