Re: [PATCHv2 3/8] audit: also audit cgroup controller path

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

 



On 03/09/2011 08:10 AM, Daniel P. Berrange wrote:
>> +    virCgroupPathOfController(cgroup, VIR_CGROUP_CONTROLLER_DEVICES,
>> +                              NULL, &controller);
>> +
>> +    if (!(detail = virAuditEncode("cgroup", VIR_AUDIT_STR(controller)))) {
>> +        VIR_WARN0("OOM while encoding audit message");
>> +        goto cleanup;
>> +    }
>> +
>>      VIR_AUDIT(VIR_AUDIT_RECORD_RESOURCE, success,
>> -              "resrc=cgroup reason=%s %s uuid=%s class=%s",
>> -              reason, vmname, uuidstr, extra);
>> +              "resrc=cgroup reason=%s %s uuid=%s %s class=%s",
>> +              reason, vmname, uuidstr, detail, extra);
> 
> I think perhaps we should make a better effort to output the
> audit event if creating 'detail' fails. eg remove the goto cleanup
> and do  'detail ? detail : "cgroup=?"' here

Sure.  The VIR_AUDIT call is then likely to fail for the same OOM
reason, but we might as well try it rather than giving up right away,
since the cgroup mount point is not the central detail of the audit message.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
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]