master - lvmlockd: always try to connect to lvmetad
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=47a29f6b2eb78a...
Commit: 47a29f6b2eb78a71ba6eafa9f47c7519a629155f
Parent: b12961e7ebd6fb29d760daafd3c16e4ba3e54e80
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Jun 20 13:47:26 2016 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Jun 20 14:01:46 2016 -0500
lvmlockd: always try to connect to lvmetad
Reconnect to lvmetad if either the send fails (e.g. lvmetad
was restarted since lvmlockd last connected), or if no
lvmetad connection exists (e.g. lvmetad was started after
lvmlockd so no previous connection existed.)
---
daemons/lvmlockd/lvmlockd-core.c | 32 ++++++++++++++++++--------------
1 files changed, 18 insertions(+), 14 deletions(-)
diff --git a/daemons/lvmlockd/lvmlockd-core.c b/daemons/lvmlockd/lvmlockd-core.c
index f92ca01..f61939a 100644
--- a/daemons/lvmlockd/lvmlockd-core.c
+++ b/daemons/lvmlockd/lvmlockd-core.c
@@ -1013,6 +1013,7 @@ static daemon_reply send_lvmetad(const char *id, ...)
daemon_reply reply;
va_list ap;
int retries = 0;
+ int err;
va_start(ap, id);
@@ -1022,20 +1023,27 @@ static daemon_reply send_lvmetad(const char *id, ...)
*/
pthread_mutex_lock(&lvmetad_mutex);
retry:
- reply = daemon_send_simple_v(lvmetad_handle, id, ap);
-
- /* lvmetad may have been restarted */
- if ((reply.error == ECONNRESET) && (retries < 2)) {
- daemon_close(lvmetad_handle);
- lvmetad_connected = 0;
-
+ if (!lvmetad_connected) {
lvmetad_handle = lvmetad_open(NULL);
if (lvmetad_handle.error || lvmetad_handle.socket_fd < 0) {
- log_error("lvmetad_open reconnect error %d", lvmetad_handle.error);
+ err = lvmetad_handle.error ?: lvmetad_handle.socket_fd;
+ pthread_mutex_unlock(&lvmetad_mutex);
+ log_error("lvmetad_open reconnect error %d", err);
+ memset(&reply, 0, sizeof(reply));
+ reply.error = err;
+ return reply;
} else {
log_debug("lvmetad reconnected");
lvmetad_connected = 1;
}
+ }
+
+ reply = daemon_send_simple_v(lvmetad_handle, id, ap);
+
+ /* lvmetad may have been restarted */
+ if ((reply.error == ECONNRESET) && (retries < 2)) {
+ daemon_close(lvmetad_handle);
+ lvmetad_connected = 0;
retries++;
goto retry;
}
@@ -1240,10 +1248,6 @@ static int res_lock(struct lockspace *ls, struct resource *r, struct action *act
rv = -EREMOVED;
}
- if (!lvmetad_connected && inval_meta)
- log_debug("S %s R %s res_lock no lvmetad connection to invalidate",
- ls->name, r->name);
-
/*
* r is vglk: tell lvmetad to set the vg invalid
* flag, and provide the new r_version. If lvmetad finds
@@ -1259,7 +1263,7 @@ static int res_lock(struct lockspace *ls, struct resource *r, struct action *act
* caches, and tell lvmetad to set global invalid to 0.
*/
- if (lvmetad_connected && inval_meta && (r->type == LD_RT_VG)) {
+ if (inval_meta && (r->type == LD_RT_VG)) {
daemon_reply reply;
char *uuid;
@@ -1283,7 +1287,7 @@ static int res_lock(struct lockspace *ls, struct resource *r, struct action *act
daemon_reply_destroy(reply);
}
- if (lvmetad_connected && inval_meta && (r->type == LD_RT_GL)) {
+ if (inval_meta && (r->type == LD_RT_GL)) {
daemon_reply reply;
log_debug("S %s R %s res_lock set lvmetad global invalid",
7 years, 10 months
master - lvmetad: process new connections after shutdown signal
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b12961e7ebd6fb...
Commit: b12961e7ebd6fb29d760daafd3c16e4ba3e54e80
Parent: 6ae22125c62ddea4340916a5e255d55844bfd087
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Jun 20 13:19:02 2016 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Jun 20 13:19:02 2016 -0500
lvmetad: process new connections after shutdown signal
Currently, a shutdown signal will cause lvmetad to quit
responding to new connections, but not actually exit until
all connections are gone. If a program is maintaining a
long running connection (e.g. lvmlockd, or even an lvm
command) when lvmetad gets a shutdown signal, then all
further commands will hang indefinately waiting for a
response that won't be sent.
With this patch, make lvmetad continue handling new
connections even after a shutdown signal. It will exit
once all connections are gone.
---
libdaemon/server/daemon-server.c | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c
index d18bd4b..7911dd6 100644
--- a/libdaemon/server/daemon-server.c
+++ b/libdaemon/server/daemon-server.c
@@ -490,8 +490,10 @@ static int handle_connect(daemon_state s)
socklen_t sl = sizeof(sockaddr);
client.socket_fd = accept(s.socket_fd, (struct sockaddr *) &sockaddr, &sl);
- if (client.socket_fd < 0)
+ if (client.socket_fd < 0) {
+ ERROR(&s, "Failed to accept connection.");
return 0;
+ }
if (fcntl(client.socket_fd, F_SETFD, FD_CLOEXEC))
WARN(&s, "setting CLOEXEC on client socket fd %d failed", client.socket_fd);
@@ -510,8 +512,10 @@ static int handle_connect(daemon_state s)
ts->s = s;
ts->client = client;
- if (pthread_create(&ts->client.thread_id, NULL, client_thread, ts))
+ if (pthread_create(&ts->client.thread_id, NULL, client_thread, ts)) {
+ ERROR(&s, "Failed to create client thread.");
return 0;
+ }
return 1;
}
@@ -622,7 +626,7 @@ void daemon_start(daemon_state s)
if (!s.daemon_init(&s))
failed = 1;
- while (!_shutdown_requested && !failed) {
+ while (!failed) {
_reset_timeout(s);
FD_ZERO(&in);
FD_SET(s.socket_fd, &in);
@@ -630,12 +634,14 @@ void daemon_start(daemon_state s)
perror("select error");
if (FD_ISSET(s.socket_fd, &in)) {
timeout_count = 0;
- if (!_shutdown_requested && !handle_connect(s))
- ERROR(&s, "Failed to handle a client connection.");
+ handle_connect(s);
}
reap(s, 0);
+ if (_shutdown_requested && !s.threads->next)
+ break;
+
/* s.idle == NULL equals no shutdown on timeout */
if (_is_idle(s)) {
DEBUGLOG(&s, "timeout occured");
7 years, 10 months
master - vgcfgrestore: use lvmetad disabled state
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6ae22125c62dde...
Commit: 6ae22125c62ddea4340916a5e255d55844bfd087
Parent: cae6591b9ddc5e94b64c542503d34448babf720f
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Jun 17 16:37:30 2016 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Jun 20 11:19:49 2016 -0500
vgcfgrestore: use lvmetad disabled state
Previously, vgcfgrestore would attempt to vg_remove the
existing VG from lvmetad and then vg_update to add the
restored VG. But, if there was a failure in the command
or with vg_update, the lvmetad cache would be left incorrect.
Now, disable lvmetad before the restore begins, and then
rescan to populate lvmetad from disk after restore has
written the new VG to disk.
---
daemons/lvmetad/lvmetad-client.h | 1 +
daemons/lvmetad/lvmetad-core.c | 10 +++++++---
lib/cache/lvmetad.c | 3 +++
lib/format_text/archiver.c | 16 ++--------------
lib/format_text/archiver.h | 4 +---
tools/vgcfgrestore.c | 32 +++++++++++++++++++++++++++++++-
tools/vgconvert.c | 2 +-
7 files changed, 46 insertions(+), 22 deletions(-)
diff --git a/daemons/lvmetad/lvmetad-client.h b/daemons/lvmetad/lvmetad-client.h
index b352c04..dd6a379 100644
--- a/daemons/lvmetad/lvmetad-client.h
+++ b/daemons/lvmetad/lvmetad-client.h
@@ -24,6 +24,7 @@
#define LVMETAD_DISABLE_REASON_DIRECT "DIRECT"
#define LVMETAD_DISABLE_REASON_LVM1 "LVM1"
#define LVMETAD_DISABLE_REASON_DUPLICATES "DUPLICATES"
+#define LVMETAD_DISABLE_REASON_VGRESTORE "VGRESTORE"
struct volume_group;
diff --git a/daemons/lvmetad/lvmetad-core.c b/daemons/lvmetad/lvmetad-core.c
index ca1e4ed..aab569f 100644
--- a/daemons/lvmetad/lvmetad-core.c
+++ b/daemons/lvmetad/lvmetad-core.c
@@ -202,8 +202,9 @@ struct vg_info {
#define GLFL_DISABLE_REASON_DIRECT 0x00000004
#define GLFL_DISABLE_REASON_LVM1 0x00000008
#define GLFL_DISABLE_REASON_DUPLICATES 0x00000010
+#define GLFL_DISABLE_REASON_VGRESTORE 0x00000020
-#define GLFL_DISABLE_REASON_ALL (GLFL_DISABLE_REASON_DIRECT | GLFL_DISABLE_REASON_LVM1 | GLFL_DISABLE_REASON_DUPLICATES)
+#define GLFL_DISABLE_REASON_ALL (GLFL_DISABLE_REASON_DIRECT | GLFL_DISABLE_REASON_LVM1 | GLFL_DISABLE_REASON_DUPLICATES | GLFL_DISABLE_REASON_VGRESTORE)
#define VGFL_INVALID 0x00000001
@@ -2347,6 +2348,8 @@ static response set_global_info(lvmetad_state *s, request r)
reason_flags |= GLFL_DISABLE_REASON_LVM1;
if (strstr(reason, LVMETAD_DISABLE_REASON_DUPLICATES))
reason_flags |= GLFL_DISABLE_REASON_DUPLICATES;
+ if (strstr(reason, LVMETAD_DISABLE_REASON_VGRESTORE))
+ reason_flags |= GLFL_DISABLE_REASON_VGRESTORE;
}
if (global_invalid != -1) {
@@ -2404,10 +2407,11 @@ static response get_global_info(lvmetad_state *s, request r)
pid = (int)daemon_request_int(r, "pid", 0);
if (s->flags & GLFL_DISABLE) {
- snprintf(reason, REASON_BUF_SIZE - 1, "%s%s%s",
+ snprintf(reason, REASON_BUF_SIZE - 1, "%s%s%s%s",
(s->flags & GLFL_DISABLE_REASON_DIRECT) ? LVMETAD_DISABLE_REASON_DIRECT "," : "",
(s->flags & GLFL_DISABLE_REASON_LVM1) ? LVMETAD_DISABLE_REASON_LVM1 "," : "",
- (s->flags & GLFL_DISABLE_REASON_DUPLICATES) ? LVMETAD_DISABLE_REASON_DUPLICATES "," : "");
+ (s->flags & GLFL_DISABLE_REASON_DUPLICATES) ? LVMETAD_DISABLE_REASON_DUPLICATES "," : "",
+ (s->flags & GLFL_DISABLE_REASON_VGRESTORE) ? LVMETAD_DISABLE_REASON_VGRESTORE "," : "");
}
if (!reason[0])
diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c
index 0508291..ee44202 100644
--- a/lib/cache/lvmetad.c
+++ b/lib/cache/lvmetad.c
@@ -2726,6 +2726,9 @@ int lvmetad_is_disabled(struct cmd_context *cmd, const char **reason)
} else if (strstr(reply_reason, LVMETAD_DISABLE_REASON_DUPLICATES)) {
*reason = "duplicate PVs were found";
+ } else if (strstr(reply_reason, LVMETAD_DISABLE_REASON_VGRESTORE)) {
+ *reason = "vgcfgrestore is restoring VG metadata";
+
} else {
*reason = "<unknown>";
}
diff --git a/lib/format_text/archiver.c b/lib/format_text/archiver.c
index 4e85e0e..e6d4b59 100644
--- a/lib/format_text/archiver.c
+++ b/lib/format_text/archiver.c
@@ -359,9 +359,7 @@ static int _restore_vg_should_write_pv(struct physical_volume *pv, int do_pvcrea
/* ORPHAN and VG locks held before calling this */
int backup_restore_vg(struct cmd_context *cmd, struct volume_group *vg,
- int drop_lvmetad,
- int do_pvcreate,
- struct pv_create_args *pva)
+ int do_pvcreate, struct pv_create_args *pva)
{
struct dm_list new_pvs;
struct pv_list *pvl, *new_pvl;
@@ -502,16 +500,6 @@ int backup_restore_vg(struct cmd_context *cmd, struct volume_group *vg,
if (!vg_write(vg))
return_0;
- if (drop_lvmetad && lvmetad_used()) {
- struct volume_group *vg_lvmetad = lvmetad_vg_lookup(cmd, vg->name, NULL);
- if (vg_lvmetad) {
- /* FIXME Cope with failure to update lvmetad */
- if (!lvmetad_vg_remove(vg_lvmetad))
- stack;
- release_vg(vg_lvmetad);
- }
- }
-
if (!vg_commit(vg))
return_0;
@@ -550,7 +538,7 @@ int backup_restore_from_file(struct cmd_context *cmd, const char *vg_name,
missing_pvs = vg_missing_pv_count(vg);
if (missing_pvs == 0)
- r = backup_restore_vg(cmd, vg, 1, 0, NULL);
+ r = backup_restore_vg(cmd, vg, 0, NULL);
else
log_error("Cannot restore Volume Group %s with %i PVs "
"marked as missing.", vg->name, missing_pvs);
diff --git a/lib/format_text/archiver.h b/lib/format_text/archiver.h
index 82f7620..e949751 100644
--- a/lib/format_text/archiver.h
+++ b/lib/format_text/archiver.h
@@ -53,9 +53,7 @@ struct volume_group *backup_read_vg(struct cmd_context *cmd,
const char *vg_name, const char *file);
int backup_restore_vg(struct cmd_context *cmd, struct volume_group *vg,
- int drop_lvmetad,
- int do_pvcreate,
- struct pv_create_args *pva);
+ int do_pvcreate, struct pv_create_args *pva);
int backup_restore_from_file(struct cmd_context *cmd, const char *vg_name,
const char *file, int force);
diff --git a/tools/vgcfgrestore.c b/tools/vgcfgrestore.c
index 8e51ed6..54e382c 100644
--- a/tools/vgcfgrestore.c
+++ b/tools/vgcfgrestore.c
@@ -14,10 +14,12 @@
*/
#include "tools.h"
+#include "lvmetad-client.h"
int vgcfgrestore(struct cmd_context *cmd, int argc, char **argv)
{
const char *vg_name = NULL;
+ int lvmetad_rescan = 0;
if (argc == 1) {
vg_name = skip_dev_dir(cmd, argv[0], NULL);
@@ -44,7 +46,21 @@ int vgcfgrestore(struct cmd_context *cmd, int argc, char **argv)
return ECMD_PROCESSED;
}
- lvmcache_seed_infos_from_lvmetad(cmd);
+ /*
+ * lvmetad does not handle a VG being restored, which would require
+ * vg_remove of the existing VG, then vg_update of the restored VG. A
+ * command failure after removing the existing VG from lvmetad would
+ * not be easily recovered from. So, disable the lvmetad cache before
+ * doing the restore. After the VG is restored on disk, rescan
+ * metadata from disk to populate lvmetad from scratch which will pick
+ * up the VG that was restored on disk.
+ */
+
+ if (lvmetad_used()) {
+ lvmetad_set_disabled(cmd, LVMETAD_DISABLE_REASON_VGRESTORE);
+ lvmetad_disconnect();
+ lvmetad_rescan = 1;
+ }
if (!lock_vol(cmd, vg_name, LCK_VG_WRITE, NULL)) {
log_error("Unable to lock volume group %s", vg_name);
@@ -74,5 +90,19 @@ int vgcfgrestore(struct cmd_context *cmd, int argc, char **argv)
unlock_vg(cmd, VG_ORPHANS);
unlock_vg(cmd, vg_name);
+
+ if (lvmetad_rescan) {
+ if (!lvmetad_connect(cmd)) {
+ log_warn("WARNING: Failed to connect to lvmetad.");
+ log_warn("WARNING: Update lvmetad with pvscan --cache.");
+ goto out;
+ }
+ if (!lvmetad_pvscan_all_devs(cmd, 1)) {
+ log_warn("WARNING: Failed to scan devices.");
+ log_warn("WARNING: Update lvmetad with pvscan --cache.");
+ goto out;
+ }
+ }
+out:
return ECMD_PROCESSED;
}
diff --git a/tools/vgconvert.c b/tools/vgconvert.c
index 846db05..4c3d560 100644
--- a/tools/vgconvert.c
+++ b/tools/vgconvert.c
@@ -126,7 +126,7 @@ static int vgconvert_single(struct cmd_context *cmd, const char *vg_name,
log_verbose("Writing metadata for VG %s using format %s", vg_name,
cmd->fmt->name);
- if (!backup_restore_vg(cmd, vg, 0, 1, &pva)) {
+ if (!backup_restore_vg(cmd, vg, 1, &pva)) {
log_error("Conversion failed for volume group %s.", vg_name);
log_error("Use pvcreate and vgcfgrestore to repair from "
"archived metadata.");
7 years, 10 months
master - vgscan: fix process_each args
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=cae6591b9ddc5e...
Commit: cae6591b9ddc5e94b64c542503d34448babf720f
Parent: d1d3820219f6b0906bc0b3980b6eefcc187999d9
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Jun 20 11:18:36 2016 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Jun 20 11:18:36 2016 -0500
vgscan: fix process_each args
zero/null args were mixed up.
---
tools/vgscan.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/tools/vgscan.c b/tools/vgscan.c
index 45a2d7e..dfb1d46 100644
--- a/tools/vgscan.c
+++ b/tools/vgscan.c
@@ -117,8 +117,7 @@ int vgscan(struct cmd_context *cmd, int argc, char **argv)
else
log_print_unless_silent("Reading volume groups from cache.");
- maxret = process_each_vg(cmd, argc, argv, NULL, NULL, 0, NULL, 0,
- &vgscan_single);
+ maxret = process_each_vg(cmd, argc, argv, NULL, NULL, 0, 0, NULL, &vgscan_single);
if (arg_count(cmd, mknodes_ARG)) {
ret = vgmknodes(cmd, argc, argv);
7 years, 10 months
master - conf: add more comments for new settings related to output format and log report
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d1d3820219f6b0...
Commit: d1d3820219f6b0906bc0b3980b6eefcc187999d9
Parent: 99ea03571a835c3a56b364be4ccebcc745d09dbe
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon Jun 20 16:21:38 2016 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon Jun 20 16:21:38 2016 +0200
conf: add more comments for new settings related to output format and log report
---
conf/example.conf.in | 49 +++++++++++++++++++++++++++++++---------
lib/config/config_settings.h | 51 ++++++++++++++++++++++++++++++++----------
2 files changed, 77 insertions(+), 23 deletions(-)
diff --git a/conf/example.conf.in b/conf/example.conf.in
index bf8f177..f7cebf9 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -479,30 +479,51 @@ allocation {
log {
# Configuration option log/report_command_log.
- # If enabled, LVM will collect log during command processing.
- # After that the log is reported using current output format
- # as defined by report/output_format setting.
+ # Enable or disable LVM log reporting.
+ # If enabled, LVM will collect a log of operations, messages,
+ # per-object return codes with object identification and associated
+ # error numbers (errnos) during LVM command processing. Then the
+ # log is either reported solely or in addition to any existing
+ # reports, depending on LVM command used. If it is a reporting command
+ # (e.g. pvs, vgs, lvs, lvm fullreport), then the log is reported in
+ # addition to any existing reports. Otherwise, there's only log report
+ # on output. For all applicable LVM commands, you can request that
+ # the output has only log report by using --logonly command line
+ # option. Use log/command_log_cols and log/command_log_sort settings
+ # to define fields to display and sort fields for the log report.
+ # You can also use log/command_log_selection to define selection
+ # criteria used each time the log is reported.
# This configuration option has an automatic default value.
# report_command_log = 0
# Configuration option log/command_log_sort.
# List of columns to sort by when reporting command log.
- # Possible fields are: log_seq_num, log_type, log_context, log_object_type,
- # log_object_name, log_object_id, log_object_group, log_object_group_id,
- # log_message, log_errno, log_ret_code.
+ # See <lvm command> --logonly --configreport log -o help
+ # for the list of possible fields.
# This configuration option has an automatic default value.
# command_log_sort = "log_seq_num"
# Configuration option log/command_log_cols.
# List of columns to report when reporting command log.
- # Possible fields are: log_seq_num, log_type, log_context, log_object_type,
- # log_object_name, log_object_id, log_object_group, log_object_group_id,
- # log_message, log_errno, log_ret_code.
+ # See <lvm command> --logonly --configreport log -o help
+ # for the list of possible fields.
# This configuration option has an automatic default value.
# command_log_cols = "log_seq_num,log_type,log_context,log_object_type,log_object_name,log_object_id,log_object_group,log_object_group_id,log_message,log_errno,log_ret_code"
# Configuration option log/command_log_selection.
# Selection criteria used when reporting command log.
+ # You can define selection criteria that are applied each
+ # time log is reported. This way, it is possible to control the
+ # amount of log that is displayed on output and you can select
+ # only parts of the log that are important for you. To define
+ # selection criteria, use fields from log report. See also
+ # <lvm command> --logonly --configreport log -S help for the
+ # list of possible fields and selection operators. You can also
+ # define selection criteria for log report on command line directly
+ # using <lvm command> --configreport log -S <selection criteria>
+ # which has precedence over log/command_log_selection setting.
+ # For more information about selection criteria in general, see
+ # lvm(8) man page.
# This configuration option has an automatic default value.
# command_log_selection = "!(log_type=status && message=success)"
@@ -1580,10 +1601,16 @@ activation {
# report {
# Configuration option report/output_format.
- # Format of LVM2 command report output.
+ # Format of LVM command's report output.
+ # If there is more than one report per command, then the format
+ # is applied for all reports. You can also change output format
+ # directly on command line using --reportformat option which
+ # has precedence over log/output_format setting.
# Accepted values:
# basic
- # Original format with columns and rows.
+ # Original format with columns and rows. If there is more than
+ # one report per command, each report is prefixed with report's
+ # name for identification.
# json
# JSON format.
# This configuration option has an automatic default value.
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index 64859e4..25914ea 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -548,24 +548,45 @@ cfg(allocation_physical_extent_size_CFG, "physical_extent_size", allocation_CFG_
"Default physical extent size in KiB to use for new VGs.\n")
cfg(log_report_command_log_CFG, "report_command_log", log_CFG_SECTION, CFG_PROFILABLE | CFG_DEFAULT_COMMENTED, CFG_TYPE_BOOL, DEFAULT_COMMAND_LOG_REPORT, vsn(2, 2, 158), NULL, 0, NULL,
- "If enabled, LVM will collect log during command processing.\n"
- "After that the log is reported using current output format\n"
- "as defined by report/output_format setting.\n")
+ "Enable or disable LVM log reporting.\n"
+ "If enabled, LVM will collect a log of operations, messages,\n"
+ "per-object return codes with object identification and associated\n"
+ "error numbers (errnos) during LVM command processing. Then the\n"
+ "log is either reported solely or in addition to any existing\n"
+ "reports, depending on LVM command used. If it is a reporting command\n"
+ "(e.g. pvs, vgs, lvs, lvm fullreport), then the log is reported in\n"
+ "addition to any existing reports. Otherwise, there's only log report\n"
+ "on output. For all applicable LVM commands, you can request that\n"
+ "the output has only log report by using --logonly command line\n"
+ "option. Use log/command_log_cols and log/command_log_sort settings\n"
+ "to define fields to display and sort fields for the log report.\n"
+ "You can also use log/command_log_selection to define selection\n"
+ "criteria used each time the log is reported.\n")
cfg(log_command_log_sort_CFG, "command_log_sort", log_CFG_SECTION, CFG_PROFILABLE | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_COMMAND_LOG_SORT, vsn(2, 2, 158), NULL, 0, NULL,
"List of columns to sort by when reporting command log.\n"
- "Possible fields are: log_seq_num, log_type, log_context, log_object_type,\n"
- "log_object_name, log_object_id, log_object_group, log_object_group_id,\n"
- "log_message, log_errno, log_ret_code.\n")
+ "See <lvm command> --logonly --configreport log -o help\n"
+ "for the list of possible fields.\n")
cfg(log_command_log_cols_CFG, "command_log_cols", log_CFG_SECTION, CFG_PROFILABLE | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_COMMAND_LOG_COLS, vsn(2, 2, 158), NULL, 0, NULL,
"List of columns to report when reporting command log.\n"
- "Possible fields are: log_seq_num, log_type, log_context, log_object_type,\n"
- "log_object_name, log_object_id, log_object_group, log_object_group_id,\n"
- "log_message, log_errno, log_ret_code.\n")
+ "See <lvm command> --logonly --configreport log -o help\n"
+ "for the list of possible fields.\n")
cfg(log_command_log_selection_CFG, "command_log_selection", log_CFG_SECTION, CFG_PROFILABLE | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_COMMAND_LOG_SELECTION, vsn(2, 2, 158), NULL, 0, NULL,
- "Selection criteria used when reporting command log.\n")
+ "Selection criteria used when reporting command log.\n"
+ "You can define selection criteria that are applied each\n"
+ "time log is reported. This way, it is possible to control the\n"
+ "amount of log that is displayed on output and you can select\n"
+ "only parts of the log that are important for you. To define\n"
+ "selection criteria, use fields from log report. See also\n"
+ "<lvm command> --logonly --configreport log -S help for the\n"
+ "list of possible fields and selection operators. You can also\n"
+ "define selection criteria for log report on command line directly\n"
+ "using <lvm command> --configreport log -S <selection criteria>\n"
+ "which has precedence over log/command_log_selection setting.\n"
+ "For more information about selection criteria in general, see\n"
+ "lvm(8) man page.\n")
cfg(log_verbose_CFG, "verbose", log_CFG_SECTION, 0, CFG_TYPE_INT, DEFAULT_VERBOSE, vsn(1, 0, 0), NULL, 0, NULL,
"Controls the messages sent to stdout or stderr.\n")
@@ -1483,10 +1504,16 @@ cfg(disk_area_size_CFG, "size", disk_area_CFG_SUBSECTION, CFG_UNSUPPORTED | CFG_
cfg(disk_area_id_CFG, "id", disk_area_CFG_SUBSECTION, CFG_UNSUPPORTED | CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(1, 0, 0), NULL, 0, NULL, NULL)
cfg(report_output_format_CFG, "output_format", report_CFG_SECTION, CFG_PROFILABLE | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_REP_OUTPUT_FORMAT, vsn(2, 2, 158), NULL, 0, NULL,
- "Format of LVM2 command report output.\n"
+ "Format of LVM command's report output.\n"
+ "If there is more than one report per command, then the format\n"
+ "is applied for all reports. You can also change output format\n"
+ "directly on command line using --reportformat option which\n"
+ "has precedence over log/output_format setting.\n"
"Accepted values:\n"
" basic\n"
- " Original format with columns and rows.\n"
+ " Original format with columns and rows. If there is more than\n"
+ " one report per command, each report is prefixed with report's\n"
+ " name for identification.\n"
" json\n"
" JSON format.\n")
7 years, 10 months
master - cleanup: log: use hex numbers instead of decimal for _LOG_*
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=99ea03571a835c...
Commit: 99ea03571a835c3a56b364be4ccebcc745d09dbe
Parent: a77732c18089a12fa7c009a02cc1f1d6636a4284
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon Jun 20 14:22:31 2016 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon Jun 20 14:22:31 2016 +0200
cleanup: log: use hex numbers instead of decimal for _LOG_*
---
lib/log/log.h | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/lib/log/log.h b/lib/log/log.h
index 15d363e..1bc9cbe 100644
--- a/lib/log/log.h
+++ b/lib/log/log.h
@@ -41,16 +41,16 @@
#define EUNCLASSIFIED -1 /* Generic error code */
-#define _LOG_STDERR 128 /* force things to go to stderr, even if loglevel
- would make them go to stdout */
-#define _LOG_ONCE 256 /* downgrade to NOTICE if this has been already logged */
-#define _LOG_BYPASS_REPORT 512 /* do not log through report even if report available */
-#define _LOG_DEBUG 7
-#define _LOG_INFO 6
-#define _LOG_NOTICE 5
-#define _LOG_WARN 4
-#define _LOG_ERR 3
-#define _LOG_FATAL 2
+#define _LOG_FATAL 0x0002
+#define _LOG_ERR 0x0003
+#define _LOG_WARN 0x0004
+#define _LOG_NOTICE 0x0005
+#define _LOG_INFO 0x0006
+#define _LOG_DEBUG 0x0007
+#define _LOG_STDERR 0x0080 /* force things to go to stderr, even if loglevel would make them go to stdout */
+#define _LOG_ONCE 0x0100 /* downgrade to NOTICE if this has been already logged */
+#define _LOG_BYPASS_REPORT 0x0200 /* do not log through report even if report available */
+
#define INTERNAL_ERROR "Internal error: "
/*
7 years, 10 months
master - log: add 'label' log report object type; annotate process_each_label with log_set_report_object_{type, id_and_name} and report_log_ret_code
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a77732c18089a1...
Commit: a77732c18089a12fa7c009a02cc1f1d6636a4284
Parent: db6b4c1eef733769a3ca9f2f01c29c77cf83cc24
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon Jun 20 13:46:35 2016 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon Jun 20 14:05:13 2016 +0200
log: add 'label' log report object type; annotate process_each_label with log_set_report_object_{type, id_and_name} and report_log_ret_code
---
lib/log/log.c | 1 +
lib/log/lvm-logging.h | 1 +
tools/toollib.c | 21 ++++++++++++++++++---
3 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/lib/log/log.c b/lib/log/log.c
index e8793c6..0d253e7 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -300,6 +300,7 @@ 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_ORPHAN] = "orphan",
[LOG_REPORT_OBJECT_TYPE_PV] = "pv",
+ [LOG_REPORT_OBJECT_TYPE_LABEL] = "label",
[LOG_REPORT_OBJECT_TYPE_VG] = "vg",
[LOG_REPORT_OBJECT_TYPE_LV] = "lv"};
return log_object_type_names[object_type];
diff --git a/lib/log/lvm-logging.h b/lib/log/lvm-logging.h
index e5b8b63..59ed7ac 100644
--- a/lib/log/lvm-logging.h
+++ b/lib/log/lvm-logging.h
@@ -76,6 +76,7 @@ typedef enum {
LOG_REPORT_OBJECT_TYPE_NULL,
LOG_REPORT_OBJECT_TYPE_ORPHAN,
LOG_REPORT_OBJECT_TYPE_PV,
+ LOG_REPORT_OBJECT_TYPE_LABEL,
LOG_REPORT_OBJECT_TYPE_VG,
LOG_REPORT_OBJECT_TYPE_LV,
LOG_REPORT_OBJECT_TYPE_COUNT
diff --git a/tools/toollib.c b/tools/toollib.c
index fe9f9c0..833d6ce 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -1456,6 +1456,7 @@ int process_each_label(struct cmd_context *cmd, int argc, char **argv,
struct processing_handle *handle,
process_single_label_fn_t process_single_label)
{
+ log_report_t saved_log_report_state = log_get_report_state();
struct label *label;
struct dev_iter *iter;
struct device *dev;
@@ -1464,6 +1465,8 @@ int process_each_label(struct cmd_context *cmd, int argc, char **argv,
int ret;
int opt = 0;
+ log_set_report_object_type(LOG_REPORT_OBJECT_TYPE_LABEL);
+
if (argc) {
for (; opt < argc; opt++) {
if (!(dev = dev_cache_get(argv[opt], cmd->full_filter))) {
@@ -1473,6 +1476,8 @@ int process_each_label(struct cmd_context *cmd, int argc, char **argv,
continue;
}
+ log_set_report_object_name_and_id(dev_name(dev), NULL);
+
if (!label_read(dev, &label, 0)) {
log_error("No physical volume label read from %s.",
argv[opt]);
@@ -1481,20 +1486,24 @@ int process_each_label(struct cmd_context *cmd, int argc, char **argv,
}
ret = process_single_label(cmd, label, handle);
+ report_log_ret_code(ret);
if (ret > ret_max)
ret_max = ret;
+ log_set_report_object_name_and_id(NULL, NULL);
+
if (sigint_caught())
break;
}
- return ret_max;
+ goto out;
}
if (!(iter = dev_iter_create(cmd->full_filter, 1))) {
log_error("dev_iter creation failed.");
- return ECMD_FAILED;
+ ret_max = ECMD_FAILED;
+ goto out;
}
while ((dev = dev_iter_get(iter)))
@@ -1502,17 +1511,23 @@ int process_each_label(struct cmd_context *cmd, int argc, char **argv,
if (!label_read(dev, &label, 0))
continue;
+ log_set_report_object_name_and_id(dev_name(label->dev), NULL);
+
ret = process_single_label(cmd, label, handle);
+ report_log_ret_code(ret);
if (ret > ret_max)
ret_max = ret;
+ log_set_report_object_name_and_id(NULL, NULL);
+
if (sigint_caught())
break;
}
dev_iter_destroy(iter);
-
+out:
+ log_restore_report_state(saved_log_report_state);
return ret_max;
}
7 years, 10 months
master - report: compare --configreport value with basic report type
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=db6b4c1eef7337...
Commit: db6b4c1eef733769a3ca9f2f01c29c77cf83cc24
Parent: 2593cab5c4f6cd05edab521b0ae997077790234b
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon Jun 20 13:15:33 2016 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon Jun 20 14:04:37 2016 +0200
report: compare --configreport value with basic report type
Reporting commands can be of different types (even if the command name
is the same):
- pvs command can be either of PVS, PVSEGS or LABEL report type,
- vgs command is of VGS report type,
- lvs command is of LVS or SEGS report type.
Use basic report type when looking for report prefix used for
--configreport option.
This means that:
- 'pvs --configreport pv' applies to PVS, PVSEGS or LABEL report type
- 'vgs --configreport vg' applies to VGS report type
- 'lvs --configreport lv' applies to LVS and SEGS report type
---
tools/reporter.c | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/tools/reporter.c b/tools/reporter.c
index c7dee20..8d213cd 100644
--- a/tools/reporter.c
+++ b/tools/reporter.c
@@ -747,6 +747,14 @@ static report_idx_t _get_report_idx_from_name(report_type_t report_type, const c
if (!name || !*name)
return REPORT_IDX_NULL;
+ /* Change to basic report type for comparison. */
+ if (report_type == LABEL)
+ report_type = PVS;
+ else if (report_type == SEGS)
+ report_type = LVS;
+ else if (report_type == PVSEGS)
+ report_type = PVSEGS;
+
if (!strcasecmp(name, "log"))
idx = REPORT_IDX_LOG;
else if (!strcasecmp(name, "vg"))
@@ -755,10 +763,12 @@ static report_idx_t _get_report_idx_from_name(report_type_t report_type, const c
idx = _get_report_idx(report_type, PVS);
else if (!strcasecmp(name, "lv"))
idx = _get_report_idx(report_type, LVS);
- else if (!strcasecmp(name, "pvseg"))
- idx = _get_report_idx(report_type, PVSEGS);
- else if (!strcasecmp(name, "seg"))
- idx = _get_report_idx(report_type, SEGS);
+ else if (!strcasecmp(name, "pvseg")) {
+ idx = (report_type == FULL) ? _get_report_idx(report_type, PVSEGS)
+ : _get_report_idx(report_type, PVS);
+ } else if (!strcasecmp(name, "seg"))
+ idx = (report_type == FULL) ? _get_report_idx(report_type, SEGS)
+ : _get_report_idx(report_type, LVS);
else {
idx = REPORT_IDX_NULL;
log_error("Unknonwn report specifier in "
7 years, 10 months
master - commands: add --configreport arg for all relevant commands
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2593cab5c4f6cd...
Commit: 2593cab5c4f6cd05edab521b0ae997077790234b
Parent: 083e538030e8ee5f8a888d11ddc7f06cd793678c
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon Jun 20 11:57:24 2016 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon Jun 20 11:57:24 2016 +0200
commands: add --configreport arg for all relevant commands
---
tools/commands.h | 69 ++++++++++++++++++++++++++++++-----------------------
1 files changed, 39 insertions(+), 30 deletions(-)
diff --git a/tools/commands.h b/tools/commands.h
index 4bebcd4..c0b3f3b 100644
--- a/tools/commands.h
+++ b/tools/commands.h
@@ -144,6 +144,7 @@ xx(fullreport,
"\t[--binary]\n"
"\t[-a|--all]\n"
"\t[--commandprofile ProfileName]\n"
+ "\t[--configreport ReportName]\n"
"\t[-d|--debug]\n"
"\t[--foreign]\n"
"\t[-h|--help]\n"
@@ -169,11 +170,12 @@ xx(fullreport,
"\t[--version]\n"
"\t[VolumeGroupName [VolumeGroupName...]]\n",
- aligned_ARG, all_ARG, binary_ARG, foreign_ARG, ignorelockingfailure_ARG,
- ignoreskippedcluster_ARG, logonly_ARG, nameprefixes_ARG, noheadings_ARG,
- nolocking_ARG, nosuffix_ARG, options_ARG, partial_ARG, readonly_ARG,
- reportformat_ARG, rows_ARG, select_ARG, separator_ARG, shared_ARG,
- sort_ARG, trustcache_ARG, unbuffered_ARG, units_ARG, unquoted_ARG)
+ aligned_ARG, all_ARG, binary_ARG, configreport_ARG, foreign_ARG,
+ ignorelockingfailure_ARG, ignoreskippedcluster_ARG, logonly_ARG,
+ nameprefixes_ARG, noheadings_ARG, nolocking_ARG, nosuffix_ARG,
+ options_ARG, partial_ARG, readonly_ARG, reportformat_ARG, rows_ARG,
+ select_ARG, separator_ARG, shared_ARG, sort_ARG, trustcache_ARG,
+ unbuffered_ARG, units_ARG, unquoted_ARG)
xx(lastlog,
"Display last command's log report",
@@ -481,6 +483,7 @@ xx(lvdisplay,
"\t[-a|--all]\n"
"\t[--binary]\n"
"\t[--commandprofile ProfileName]\n"
+ "\t[--configreport ReportName]\n"
"\t[-d|--debug]\n"
"\t[--foreign]\n"
"\t[-h|--help]\n"
@@ -504,11 +507,12 @@ xx(lvdisplay,
"\t[--version]\n"
"\t[LogicalVolume[Path] [LogicalVolume[Path]...]]\n",
- aligned_ARG, all_ARG, binary_ARG, colon_ARG, columns_ARG, foreign_ARG,
- history_ARG, ignorelockingfailure_ARG, ignoreskippedcluster_ARG,
- logonly_ARG, maps_ARG, noheadings_ARG, nosuffix_ARG, options_ARG, sort_ARG,
- partial_ARG, readonly_ARG, reportformat_ARG, segments_ARG, select_ARG,
- separator_ARG, shared_ARG, unbuffered_ARG, units_ARG)
+ aligned_ARG, all_ARG, binary_ARG, colon_ARG, columns_ARG,
+ configreport_ARG< foreign_ARG, history_ARG, ignorelockingfailure_ARG,
+ ignoreskippedcluster_ARG, logonly_ARG, maps_ARG, noheadings_ARG,
+ nosuffix_ARG, options_ARG, sort_ARG, partial_ARG, readonly_ARG,
+ reportformat_ARG, segments_ARG, select_ARG, separator_ARG,
+ shared_ARG, unbuffered_ARG, units_ARG)
xx(lvextend,
"Add space to a logical volume",
@@ -916,6 +920,7 @@ xx(pvdisplay,
"\t[-a|--all]\n"
"\t[--binary]\n"
"\t[--commandprofile ProfileName]\n"
+ "\t[--configreport ReportName]\n"
"\t[-d|--debug]\n"
"\t[--foreign]\n"
"\t[-h|--help]\n"
@@ -936,11 +941,11 @@ xx(pvdisplay,
"\t[--version]\n"
"\t[PhysicalVolumePath [PhysicalVolumePath...]]\n",
- aligned_ARG, all_ARG, binary_ARG, colon_ARG, columns_ARG, foreign_ARG,
- ignorelockingfailure_ARG, ignoreskippedcluster_ARG, logonly_ARG, maps_ARG,
- noheadings_ARG, nosuffix_ARG, options_ARG, readonly_ARG, reportformat_ARG,
- select_ARG, separator_ARG, shared_ARG, short_ARG, sort_ARG, unbuffered_ARG,
- units_ARG)
+ aligned_ARG, all_ARG, binary_ARG, colon_ARG, columns_ARG, configreport_ARG,
+ foreign_ARG, ignorelockingfailure_ARG, ignoreskippedcluster_ARG,
+ logonly_ARG, maps_ARG, noheadings_ARG, nosuffix_ARG, options_ARG,
+ readonly_ARG, reportformat_ARG, select_ARG, separator_ARG, shared_ARG,
+ short_ARG, sort_ARG, unbuffered_ARG, units_ARG)
/* ALL_VGS_IS_DEFAULT is for polldaemon to find pvmoves in-progress using process_each_vg. */
@@ -1013,6 +1018,7 @@ xx(pvs,
"\t[--aligned]\n"
"\t[--binary]\n"
"\t[--commandprofile ProfileName]\n"
+ "\t[--configreport ReportName]\n"
"\t[-d|--debug]\n"
"\t[--foreign]\n"
"\t[-h|-?|--help]\n"
@@ -1039,12 +1045,12 @@ xx(pvs,
"\t[--version]\n"
"\t[PhysicalVolume [PhysicalVolume...]]\n",
- aligned_ARG, all_ARG, binary_ARG, foreign_ARG, ignorelockingfailure_ARG,
- ignoreskippedcluster_ARG, logonly_ARG, nameprefixes_ARG, noheadings_ARG,
- nolocking_ARG, nosuffix_ARG, options_ARG, partial_ARG, readonly_ARG,
- reportformat_ARG, rows_ARG, segments_ARG, select_ARG, separator_ARG,
- shared_ARG, sort_ARG, trustcache_ARG, unbuffered_ARG, units_ARG,
- unquoted_ARG)
+ aligned_ARG, all_ARG, binary_ARG, configreport_ARG, foreign_ARG,
+ ignorelockingfailure_ARG, ignoreskippedcluster_ARG, logonly_ARG,
+ nameprefixes_ARG, noheadings_ARG, nolocking_ARG, nosuffix_ARG,
+ options_ARG, partial_ARG, readonly_ARG, reportformat_ARG, rows_ARG,
+ segments_ARG, select_ARG, separator_ARG, shared_ARG, sort_ARG,
+ trustcache_ARG, unbuffered_ARG, units_ARG, unquoted_ARG)
xx(pvscan,
"List all physical volumes",
@@ -1266,6 +1272,7 @@ xx(vgdisplay,
"\t[--aligned]\n"
"\t[--binary]\n"
"\t[--commandprofile ProfileName]\n"
+ "\t[--configreport ReportName]\n"
"\t[-d|--debug]\n"
"\t[--foreign]\n"
"\t[-h|--help]\n"
@@ -1288,10 +1295,10 @@ xx(vgdisplay,
"\t[VolumeGroupName [VolumeGroupName...]]\n",
activevolumegroups_ARG, aligned_ARG, binary_ARG, colon_ARG, columns_ARG,
- foreign_ARG, ignorelockingfailure_ARG, ignoreskippedcluster_ARG,
- logonly_ARG, noheadings_ARG, nosuffix_ARG, options_ARG, partial_ARG,
- readonly_ARG, reportformat_ARG, select_ARG, shared_ARG, short_ARG,
- separator_ARG, sort_ARG, unbuffered_ARG, units_ARG)
+ configreport_ARG, foreign_ARG, ignorelockingfailure_ARG,
+ ignoreskippedcluster_ARG, logonly_ARG, noheadings_ARG, nosuffix_ARG,
+ options_ARG, partial_ARG, readonly_ARG, reportformat_ARG, select_ARG,
+ shared_ARG, short_ARG, separator_ARG, sort_ARG, unbuffered_ARG, units_ARG)
xx(vgexport,
"Unregister volume group(s) from the system",
@@ -1448,6 +1455,7 @@ xx(vgs,
"\t[--binary]\n"
"\t[-a|--all]\n"
"\t[--commandprofile ProfileName]\n"
+ "\t[--configreport ReportName]\n"
"\t[-d|--debug]\n"
"\t[--foreign]\n"
"\t[-h|--help]\n"
@@ -1473,11 +1481,12 @@ xx(vgs,
"\t[--version]\n"
"\t[VolumeGroupName [VolumeGroupName...]]\n",
- aligned_ARG, all_ARG, binary_ARG, foreign_ARG, ignorelockingfailure_ARG,
- ignoreskippedcluster_ARG, logonly_ARG, nameprefixes_ARG, noheadings_ARG,
- nolocking_ARG, nosuffix_ARG, options_ARG, partial_ARG, readonly_ARG,
- reportformat_ARG, rows_ARG, select_ARG, separator_ARG, shared_ARG,
- sort_ARG, trustcache_ARG, unbuffered_ARG, units_ARG, unquoted_ARG)
+ aligned_ARG, all_ARG, binary_ARG, configreport_ARG, foreign_ARG,
+ ignorelockingfailure_ARG, ignoreskippedcluster_ARG, logonly_ARG,
+ nameprefixes_ARG, noheadings_ARG, nolocking_ARG, nosuffix_ARG,
+ options_ARG, partial_ARG, readonly_ARG, reportformat_ARG, rows_ARG,
+ select_ARG, separator_ARG, shared_ARG, sort_ARG, trustcache_ARG,
+ unbuffered_ARG, units_ARG, unquoted_ARG)
xx(vgscan,
"Search for all volume groups",
7 years, 10 months
master - conf: regenerate profile templates
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=083e538030e8ee...
Commit: 083e538030e8ee5f8a888d11ddc7f06cd793678c
Parent: 92caebab95353e13b37fc724a6f31c23c8fd2cac
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon Jun 20 11:25:24 2016 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon Jun 20 11:33:43 2016 +0200
conf: regenerate profile templates
---
conf/command_profile_template.profile.in | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/conf/command_profile_template.profile.in b/conf/command_profile_template.profile.in
index 3e5b031..156dc0d 100644
--- a/conf/command_profile_template.profile.in
+++ b/conf/command_profile_template.profile.in
@@ -16,15 +16,20 @@ allocation {
cache_settings {
}
}
-
+log {
+ report_command_log=0
+ command_log_sort="log_seq_num"
+ command_log_cols="log_seq_num,log_type,log_context,log_object_type,log_object_name,log_object_id,log_object_group,log_object_group_id,log_message,log_errno,log_ret_code"
+ command_log_selection="!(log_type=status && message=success)"
+}
global {
units="h"
si_unit_consistency=1
suffix=1
lvdisplay_shows_full_device_path=0
}
-
report {
+ output_format="basic"
compact_output=0
compact_output_cols=""
aligned=1
@@ -55,5 +60,15 @@ report {
pvsegs_sort="pv_name,pvseg_start"
pvsegs_cols="pv_name,vg_name,pv_fmt,pv_attr,pv_size,pv_free,pvseg_start,pvseg_size"
pvsegs_cols_verbose="pv_name,vg_name,pv_fmt,pv_attr,pv_size,pv_free,pvseg_start,pvseg_size,lv_name,seg_start_pe,segtype,seg_pe_ranges"
+ vgs_cols_full="vg_all"
+ pvs_cols_full="pv_all"
+ lvs_cols_full="lv_all"
+ pvsegs_cols_full="pvseg_all,pv_uuid,lv_uuid"
+ segs_cols_full="seg_all,lv_uuid"
+ vgs_sort_full="vg_name"
+ pvs_sort_full="pv_name"
+ lvs_sort_full="vg_name,lv_name"
+ pvsegs_sort_full="pv_uuid,pvseg_start"
+ segs_sort_full="lv_uuid,seg_start"
mark_hidden_devices=1
}
7 years, 10 months