diff options
author | Peter Rajnoha <prajnoha@redhat.com> | 2022-08-22 13:59:08 +0200 |
---|---|---|
committer | Peter Rajnoha <prajnoha@redhat.com> | 2022-08-22 14:06:34 +0200 |
commit | 508782a9135acf13b39b47605e675a5678495c58 (patch) | |
tree | b54b22a9b355c496d7317284c0bc26437c2fd999 /lib/log | |
parent | 8c3cfc75c72696ae8b620555fcc4f815b0c1d6b6 (diff) | |
download | lvm2-508782a9135acf13b39b47605e675a5678495c58.tar.gz |
shell: add pre-cmd log report object type and enable lastlog for it
If we failed or logged anything before we actually execute given command
in lvm shell, we couldn't report the log using lastlog command after.
This patch adds specific 'pre-cmd' log report object type to identify
such log messages and enables lastlog to report even this log.
Diffstat (limited to 'lib/log')
-rw-r--r-- | lib/log/log.c | 1 | ||||
-rw-r--r-- | lib/log/lvm-logging.h | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/lib/log/log.c b/lib/log/log.c index 5771a1d01..118a3ba42 100644 --- a/lib/log/log.c +++ b/lib/log/log.c @@ -446,6 +446,7 @@ const char *log_get_report_context_name(log_report_context_t context) const char *log_get_report_object_type_name(log_report_object_type_t object_type) { static const char *log_object_type_names[LOG_REPORT_OBJECT_TYPE_COUNT] = {[LOG_REPORT_OBJECT_TYPE_NULL] = "", + [LOG_REPORT_OBJECT_TYPE_PRE_CMD] = "pre-cmd", [LOG_REPORT_OBJECT_TYPE_CMD] = "cmd", [LOG_REPORT_OBJECT_TYPE_ORPHAN] = "orphan", [LOG_REPORT_OBJECT_TYPE_PV] = "pv", diff --git a/lib/log/lvm-logging.h b/lib/log/lvm-logging.h index 5b975a6b8..f5a4277a8 100644 --- a/lib/log/lvm-logging.h +++ b/lib/log/lvm-logging.h @@ -91,6 +91,7 @@ typedef enum { typedef enum { LOG_REPORT_OBJECT_TYPE_NULL, + LOG_REPORT_OBJECT_TYPE_PRE_CMD, LOG_REPORT_OBJECT_TYPE_CMD, LOG_REPORT_OBJECT_TYPE_ORPHAN, LOG_REPORT_OBJECT_TYPE_PV, |