char *vmname;
char *oldsrc = NULL;
char *newsrc = NULL;
+ const char *virt;
virUUIDFormat(vm->def->uuid, uuidstr);
if (!(vmname = virAuditEncode("vm", vm->def->name))) {
return;
}
+ if (!(virt = virDomainVirtTypeToString(vm->def->virtType))) {
+ VIR_WARN("Unexpected virt type %d while encoding audit message", vm->def->virtType);
+ virt = "?";
+ }
+
if (!(oldsrc = virAuditEncode("old-disk",
oldDef && oldDef->src ?
oldDef->src : "?"))) {
}
VIR_AUDIT(VIR_AUDIT_RECORD_RESOURCE, success,
- "resrc=disk reason=%s %s uuid=%s %s %s",
- reason, vmname, uuidstr,
+ "virt=%s resrc=disk reason=%s %s uuid=%s %s %s",
+ virt, reason, vmname, uuidstr,
oldsrc, newsrc);
cleanup:
char *vmname;
char *oldsrc = NULL;
char *newsrc = NULL;
+ const char *virt;
virUUIDFormat(vm->def->uuid, uuidstr);
if (!(vmname = virAuditEncode("vm", vm->def->name))) {
return;
}
+ if (!(virt = virDomainVirtTypeToString(vm->def->virtType))) {
+ VIR_WARN("Unexpected virt type %d while encoding audit message", vm->def->virtType);
+ virt = "?";
+ }
+
if (!(oldsrc = virAuditEncode("old-fs",
oldDef && oldDef->src ?
oldDef->src : "?"))) {
}
VIR_AUDIT(VIR_AUDIT_RECORD_RESOURCE, success,
- "resrc=fs reason=%s %s uuid=%s %s %s",
- reason, vmname, uuidstr,
+ "virt=%s resrc=fs reason=%s %s uuid=%s %s %s",
+ virt, reason, vmname, uuidstr,
oldsrc, newsrc);
cleanup:
char newMacstr[VIR_MAC_STRING_BUFLEN];
char oldMacstr[VIR_MAC_STRING_BUFLEN];
char *vmname;
+ const char *virt;
virUUIDFormat(vm->def->uuid, uuidstr);
if (oldDef)
return;
}
+ if (!(virt = virDomainVirtTypeToString(vm->def->virtType))) {
+ VIR_WARN("Unexpected virt type %d while encoding audit message", vm->def->virtType);
+ virt = "?";
+ }
+
VIR_AUDIT(VIR_AUDIT_RECORD_RESOURCE, success,
- "resrc=net reason=%s %s uuid=%s old-net='%s' new-net='%s'",
- reason, vmname, uuidstr,
+ "virt=%s resrc=net reason=%s %s uuid=%s old-net='%s' new-net='%s'",
+ virt, reason, vmname, uuidstr,
oldDef ? oldMacstr : "?",
newDef ? newMacstr : "?");
char *vmname;
char *devname;
char *rdev;
+ const char *virt;
virUUIDFormat(vmDef->uuid, uuidstr);
virFormatMacAddr(netDef->mac, macstr);
goto cleanup;
}
+ if (!(virt = virDomainVirtTypeToString(vmDef->virtType))) {
+ VIR_WARN("Unexpected virt type %d while encoding audit message", vmDef->virtType);
+ virt = "?";
+ }
+
VIR_AUDIT(VIR_AUDIT_RECORD_RESOURCE, success,
- "resrc=net reason=open %s uuid=%s net='%s' %s rdev=%s",
- vmname, uuidstr, macstr, devname, VIR_AUDIT_STR(rdev));
+ "virt=%s resrc=net reason=open %s uuid=%s net='%s' %s rdev=%s",
+ virt, vmname, uuidstr, macstr, devname, VIR_AUDIT_STR(rdev));
cleanup:
VIR_FREE(vmname);
char *vmname;
char *address;
char *device;
+ const char *virt;
virUUIDFormat(vm->def->uuid, uuidstr);
if (!(vmname = virAuditEncode("vm", vm->def->name))) {
return;
}
+ if (!(virt = virDomainVirtTypeToString(vm->def->virtType))) {
+ VIR_WARN("Unexpected virt type %d while encoding audit message", vm->def->virtType);
+ virt = "?";
+ }
+
switch (hostdev->source.subsys.type) {
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
if (virAsprintf(&address, "%.4x:%.2x:%.2x.%.1x",
}
VIR_AUDIT(VIR_AUDIT_RECORD_RESOURCE, success,
- "resrc=dev reason=%s %s uuid=%s bus=%s %s",
- reason, vmname, uuidstr,
+ "virt=%s resrc=dev reason=%s %s uuid=%s bus=%s %s",
+ virt, reason, vmname, uuidstr,
virDomainHostdevSubsysTypeToString(hostdev->source.subsys.type),
device);
char *vmname;
char *controller = NULL;
char *detail;
+ const char *virt;
virUUIDFormat(vm->def->uuid, uuidstr);
if (!(vmname = virAuditEncode("vm", vm->def->name))) {
return;
}
+ if (!(virt = virDomainVirtTypeToString(vm->def->virtType))) {
+ VIR_WARN("Unexpected virt type %d while encoding audit message", vm->def->virtType);
+ virt = "?";
+ }
+
ignore_value(virCgroupPathOfController(cgroup,
VIR_CGROUP_CONTROLLER_DEVICES,
NULL, &controller));
detail = virAuditEncode("cgroup", VIR_AUDIT_STR(controller));
VIR_AUDIT(VIR_AUDIT_RECORD_RESOURCE, success,
- "resrc=cgroup reason=%s %s uuid=%s %s class=%s",
- reason, vmname, uuidstr,
+ "virt=%s resrc=cgroup reason=%s %s uuid=%s %s class=%s",
+ virt, reason, vmname, uuidstr,
detail ? detail : "cgroup=?", extra);
VIR_FREE(vmname);
{
char uuidstr[VIR_UUID_STRING_BUFLEN];
char *vmname;
+ const char *virt;
virUUIDFormat(vm->def->uuid, uuidstr);
if (!(vmname = virAuditEncode("vm", vm->def->name))) {
return;
}
+ if (!(virt = virDomainVirtTypeToString(vm->def->virtType))) {
+ VIR_WARN("Unexpected virt type %d while encoding audit message", vm->def->virtType);
+ virt = "?";
+ }
+
VIR_AUDIT(VIR_AUDIT_RECORD_RESOURCE, success,
- "resrc=%s reason=%s %s uuid=%s old-%s=%lld new-%s=%lld",
- resource, reason, vmname, uuidstr,
+ "virt=%s resrc=%s reason=%s %s uuid=%s old-%s=%lld new-%s=%lld",
+ virt, resource, reason, vmname, uuidstr,
resource, oldval, resource, newval);
VIR_FREE(vmname);
{
char uuidstr[VIR_UUID_STRING_BUFLEN];
char *vmname;
+ const char *virt;
virUUIDFormat(vm->def->uuid, uuidstr);
return;
}
+ if (!(virt = virDomainVirtTypeToString(vm->def->virtType))) {
+ VIR_WARN("Unexpected virt type %d while encoding audit message", vm->def->virtType);
+ virt = "?";
+ }
+
VIR_AUDIT(VIR_AUDIT_RECORD_MACHINE_CONTROL, success,
- "op=%s reason=%s %s uuid=%s", op, reason, vmname, uuidstr);
+ "virt=%s op=%s reason=%s %s uuid=%s",
+ virt, op, reason, vmname, uuidstr);
VIR_FREE(vmname);
}
{
char uuidstr[VIR_UUID_STRING_BUFLEN];
char *vmname;
+ const char *virt;
virUUIDFormat(vm->def->uuid, uuidstr);
if (!(vmname = virAuditEncode("vm", vm->def->name))) {
return;
}
+ if (!(virt = virDomainVirtTypeToString(vm->def->virtType))) {
+ VIR_WARN("Unexpected virt type %d while encoding audit message", vm->def->virtType);
+ virt = "?";
+ }
+
VIR_AUDIT(VIR_AUDIT_RECORD_MACHINE_ID, success,
- "%s uuid=%s vm-ctx=%s img-ctx=%s",
- vmname, uuidstr,
+ "virt=%s %s uuid=%s vm-ctx=%s img-ctx=%s",
+ virt, vmname, uuidstr,
VIR_AUDIT_STR(vm->def->seclabel.label),
VIR_AUDIT_STR(vm->def->seclabel.imagelabel));