close(auditfd);
#endif
}
+
+char *virAuditEncode(const char *key, const char *value)
+{
+#if HAVE_AUDIT
+ return audit_encode_nv_string(key, value, 0);
+#else
+ char *str;
+ if (virAsprintf(&str, "%s=%s", key, value) < 0)
+ return NULL;
+ return str;
+#endif
+}
enum virAuditRecordType type, bool success,
const char *fmt, ...);
+char *virAuditEncode(const char *key, const char *value);
+
void virAuditClose(void);
# define VIR_AUDIT(type, success, ...) \
virAuditSend(__FILE__, __func__, __LINE__, \
clienttty, clientaddr, type, success, __VA_ARGS__);
+# define VIR_AUDIT_STR(str) \
+ ((str) ? (str) : "?")
#endif /* __LIBVIRT_AUDIT_H__ */