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

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



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 redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


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