master - post-release
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7831a650914f35...
Commit: 7831a650914f35c97f9deab6b871970b303a8948
Parent: 15a97cc610712efe818f96b9630b72de89a0cf57
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Sat Oct 31 01:35:47 2015 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Sat Oct 31 01:35:47 2015 +0000
post-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 3 +++
WHATS_NEW_DM | 3 +++
4 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/VERSION b/VERSION
index 20d1cc4..f36c01d 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.133(2)-git (2015-10-30)
+2.02.134(2)-git (2015-10-30)
diff --git a/VERSION_DM b/VERSION_DM
index ef5a8f8..ebca82f 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.110-git (2015-10-30)
+1.02.111-git (2015-10-30)
diff --git a/WHATS_NEW b/WHATS_NEW
index cfd0a1a..7431483 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,3 +1,6 @@
+Version 2.02.134 -
+====================================
+
Version 2.02.133 - 30th October 2015
====================================
Support repeated -o|--options for reporting commands.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 5004f84..113a4bb 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,3 +1,6 @@
+Version 1.02.111 -
+====================================
+
Version 1.02.110 - 30th October 2015
====================================
Disable thin monitoring plugin when it fails too often (>10 times).
8 years, 1 month
v2_02_133 annotated tag has been created
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=af330ff842aef4...
Commit: af330ff842aef4d473f7dd9e17eb7a066f373528
Parent: 0000000000000000000000000000000000000000
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: 2015-10-30 15:35 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: 2015-10-30 15:35 +0000
annotated tag: v2_02_133 has been created
at af330ff842aef4d473f7dd9e17eb7a066f373528 (tag)
tagging 15a97cc610712efe818f96b9630b72de89a0cf57 (commit)
replaces v2_02_132
Release 2.02.133.
This is a development release that provides us with a checkpoint.
(Any interface changes in this release might be modified further.)
329 files changed, 6524 insertions(+), 4152 deletions(-)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
iEYEABECAAYFAlYzj1YACgkQIoGRwVZ+LBc0rwCeI1s7/WqxlO4EDpeVuAfZvk4x
LyEAniwQZ5fUTo+VBx48GfmqvJHUukOb
=M010
-----END PGP SIGNATURE-----
Alasdair G Kergon (15):
post-release
segtypes: Use SEG_TYPE_NAME_ string constants.
segtypes: Make constants ULL.
style: lv_manip.c changes
segtypes: Add and use new segtype macros.
stripes: Introduce _round_to_stripe_boundary.
alloc: Move _calc_area_multiple.
test: Cope with stripe rounding message change.
libdm: Move status fns from deptree to targets.
raid: Fail if kernel status denominator is zero.
raid: Add metadata dev information to reports.
Revert "log: no file for external logging"
thin: Fix typo in policy threshold message.
device: Tidy DASD CDL format detection code.
pre-release
David Teigland (26):
man lvmthin: use --poolmetadatasize option
lockd: fix changing lock type on VG with pool
lockd: fix rescanning VG metadata
lockd: add debug logging for metadata error
lockd: add VG name to debug logging
config: improve cache_settings description
man lvmcache: updates for mode and policy
lockd: add error message for EEXIST
vgcreate: allow both --shared and --lock-type options
vgcreate: improve error message for multiple lock managers
man lvmsystemd: fix typo
man lvmsystemid: fix typos
Fix segfault when lvmlockd is running but not lvmetad
lvmlockd: use flag to avoid blocking in sanlock_acquire
pvscan: use process_each_pv
libdaemon: allow all debug levels for stderr
libdaemon: fix typo in last log enable commit
man: document possible lvmetad -l values
vg_read: sometimes ignore read errors
vgextend: fix use of the wrong flag
vg_read: remove unused inconsistent check
pvs: fix missing PVs when VG is removed
toollib: fix wrong paren placement
vgs, lvs: ignore error if VG is removed
pvs: don't treat duplicate PVs as missed
New entries for pvs related fixes.
Heinz Mauelshagen (11):
segtypes: Extend flags to 64 bits.
style: Miscellaneous tidying up of metadata/lv*
libdm: Improve raid segment parameter handling.
raid: Fix raid target write_behind parameter.
libdm: fix bogus macro causing false parameter count
raid: Detect whether or not kernel supports raid0.
raid: Add a segtype flag for each raid type.
segtypes: Use flags in raid segtype macros.
raid: Use loop for text uint32_t parameter import.
raid: Introduce DEFAULT_RAID_MAX_IMAGES
raid_manip: fix wrong image size allocation on raid10 "lvconvert --replace ..."
Lidong Zhong (1):
pvcreate: don't support unpartitioned DASD devices with CDL formatted
Marian Csontos (2):
test: Fix timeout handling
cleanup: snapshots of snapshots message
Ondrej Kozina (6):
polldaemon: fix missing mirror in-sync info with lvmpolld
tests: add test for missing mirror in-sync info
lvmetad: add optional timeout option
lvmetad.8.in: update man page with timeout info
tests: add lvmetad shutdown on idle test
tests: replace invalid use of 'fail' with 'die'
Peter Rajnoha (37):
systemd: use {local,remote}-fs-pre.target instead of {local,remote}-fs.target
blkdeactivate: recognize and deactivate MD devices too
report: identify LV hodling sanlock locks as 'private,lockd,sanlock' within lv_role report field
metadata: format_text: provide more detailed error message when metadata too large for PV mda
report: add vg_missing_pv_count field
vgimportclone: cleanup the script and remove dependency on awk, grep, cut and tr
vgimportclone: fix vgimportclone with -n to not add number unnecessarily to base VG name
vgimportclone: make sure there's no prefix in VG name list
tests: test vgimportclone and -n option
wiping: make libblkid detect all copies of the same signature if use_blkid_wiping=1
libdm: add dm_report_compact_given_fields
config: add report/compact_output_cols to control which columns to compact in report output
cleanup: typo in comment: compact_output_fields should be compact-output_cols
conf: regenerate
conf: clarify compact output settings
pvremove: make sure even invalid info is removed from lvmcache on pvremove
lvmcache: update cached info properly when moving from VG to orphan while lvmetad is used
revert: 3d03e504cda6307f692c5879f6850b2e27af7d71: message about VG metadata size vs. PV mda size
metadata: format_text: check metadata area size is at least MDA_SIZE_MIN
metadata: format_text: check VG metadata do not overlap themselves
WHATS_NEW: recent commits
metadata: format_text: better check for metadata overlap
tests: add test for minimum mda size
metadata: format_text: also count with calculated mda size of 0
str_list: also allow memory allocation without memory pool
str_list: add str_list_to_str and str_to_str_list functions
str_list: add str_list_destroy function
refactor: move code detecting report options to a separate function
report: make report options defined by "-o" groupable
report: support "-o -field_name1,field_name2,...."
report: add report_get_field_prefix function
report: recognize known prefix when processing "-o -field_name1,field_name2,..."
report: support "-o #field_name1,field_name2,..."
tests: add report-fields.sh test
man: pvs/vgs/lvs and -o+, -o-, -o#
commands: update command help for -o|--options for reporting commands
WHATS_NEW: reporting commands and -o-/-o+ extension
Zdenek Kabelac (118):
alloc: fix update or area_len
man: update dmsetup and dmstats pages
man: update lvm pages
tests: use proper target name for check
tests: ensure test will not block
cleanup: fix compiler warning
man: fsadm
man: lvcreate continue
tests: check devices with prefix aren't in use
libdm: enforce writethrough mode for cleaner
thin: check for overflown pool earlier
dmeventd: correct ret code for fail
thin: enhance logging
toolcontext: do not change already set dm_log
log: no file for external logging
dmeventd: fix loging report
dmeventd: log all commands with CMD: prefix
libdmevent: add dm_event_log
dmeventd: syslog -> log_xxxxx
dmeventd: use log_ macros in plugins
dmeventd: enable new logging
dmeventd: enable new logging
dmeventd: drop changing logging
dmeventd: add more debug messages
man: dmeventd update
dmeventd: handle snapshot overflow
cleanup: static with _
dmeventd: support logging on stdout
cleanup: more readable code
cleanup: always set nsec
cleanup: remove multilog
cleanup: avoid using private
cleanup: move system defines before structs
cleanup: typo in comment
dmeventd: new initialization of plugin threads
dmeventd: introduce macro for init
dmeventd: use new macros to init mempool
dmeventd: add local mempool for raid and mirror
dmeventd: less locking for snapshot and thin
dmeventd: less locking mirror
dmeventd: rework raid plugin
makefiles: generate Local
makefiles: drop explicit linking
makefiles: src dirs have depth 5
tests: show status in in_sync
tests: better regex check
tests: start logging dmeventd output
tests: wait for initial sync
tests: more extend testing
dmeventd: compilable without DEBUG CFLAG
makefiles: older gcc needs hint with rpath
dmeventd: fix missing '!'
makefiles: switch to rpath-link
thin: enforce local activation when creation new thin
dmeventd: use matching function
lib: better reporting of threshold
memlock: report memlock daemon counter
tools: preselect some setting for memlocked daemons
tools: do not change signals for memlocked daemons
libdm: add dm_hold_control_dev
dmeventd: check for malloc return
dmeventd: lvm2 plugin correctly debug
dmeventd: raid plugin reporting
dmeventd: mirror plugin update
dmeventd: snapshot plugin updates
dmeventd: snapshot plugin device removal
dmeventd: thin plugin update
dmeventd: no registering of 0 event mask
dmeventd: using warning level
dmeventd: move dso handling into single code section
dmeventd: use dm_hold_control_dev
dmeventd: wake up timer when setting new timeout
dmeventd: drop unneded test
dmeventd: minimize locking time for get_imeout
dmeventd: code mode _get_device_status
cleanup: use enums
dmeventd: rework locking code
dmeventd: handle signal from plugin
dmeventd: snapshot plugin unmonitor
dmeventd: debug signals
dmeventd: exit on idle
cleanup: declare vars before code
cleanup: easier to read code
cleanup: drop uneeded header file
cleanup: indents
tests: enable raid test on 4.3
dmeventd: debug error paths
dmeventd: ensure filter is empty
tools: update for lvm2_disable_dmeventd_monitoring
cleanup: gcc warning for old-style
cleanup: fix gcc compile with older pthread
cleanup: drop debug
thin: fix percentage compare
lv_manip: ensure it will fit bellow threshold
libdm: dm_tree_node_size_changed recognizes reduction
dev_manager: enabled no_flush for suspend
dev_manager: no flush for extension
libdm: enable no_flush for driver version > 11
tests: snapshot now respects threshold
dmevent: fix referencing
thin: limit no-flush using only for thin-pool
tests: extend timer for 4 hours
tests: support skip flags
tests: use skip flags
dmeventd: event string parser handles empty field
tests: avoid reading utils when skipping
tests: use more SKIP
tests: using matching type
thin: dmeventd plugin check number of failures
thin: enable usage of kernel low_water_mark
cleanup: easier error messages
cleanup: use same type
cleanup: remove thin low_water_mark from metadata
cleanup: error is not a WARNING
tests: no point in using should
tests: fix wrong line has been commented
tests: let pass bigger readahead
tests: update test for resize
8 years, 1 month
master - pre-release
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=15a97cc610712e...
Commit: 15a97cc610712efe818f96b9630b72de89a0cf57
Parent: 3f1c63c812ba5f79768f23b8d6d2e2965a458e0e
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Fri Oct 30 15:34:00 2015 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Fri Oct 30 15:34:00 2015 +0000
pre-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 4 ++--
WHATS_NEW_DM | 4 ++--
test/shell/snapshot-remove-dmsetup.sh | 2 +-
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/VERSION b/VERSION
index 3d59279..20d1cc4 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.133(2)-git (2015-09-22)
+2.02.133(2)-git (2015-10-30)
diff --git a/VERSION_DM b/VERSION_DM
index 0cc8062..ef5a8f8 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.110-git (2015-09-22)
+1.02.110-git (2015-10-30)
diff --git a/WHATS_NEW b/WHATS_NEW
index 3808cb6..cfd0a1a 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,5 @@
-Version 2.02.133 -
-======================================
+Version 2.02.133 - 30th October 2015
+====================================
Support repeated -o|--options for reporting commands.
Support -o- and -o# for reporting commands to remove and compact fields.
Fix missing PVs from pvs output if vgremove is run concurrently.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 63cb2cc..5004f84 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,5 @@
-Version 1.02.110 -
-======================================
+Version 1.02.110 - 30th October 2015
+====================================
Disable thin monitoring plugin when it fails too often (>10 times).
Fix/restore parsing of empty field '-' when processing dmeventd event.
Enhance dm_tree_node_size_changed() to recognize size reduction.
diff --git a/test/shell/snapshot-remove-dmsetup.sh b/test/shell/snapshot-remove-dmsetup.sh
index 6a4f9d2..14023a0 100644
--- a/test/shell/snapshot-remove-dmsetup.sh
+++ b/test/shell/snapshot-remove-dmsetup.sh
@@ -36,7 +36,7 @@ mount -o errors=remount-ro "$DM_DEV_DIR/$vg1/snap" mnt
sync
-# intentionally suspend layer bellow
+# intentionally suspend layer below
dmsetup suspend $vg-$lv1
# now this should pass without blocking
8 years, 1 month
master - WHATS_NEW: reporting commands and -o-/-o+ extension
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3f1c63c812ba5f...
Commit: 3f1c63c812ba5f79768f23b8d6d2e2965a458e0e
Parent: dd52721b68a7c393a54149649f518f4e2d9440b5
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Oct 30 15:50:35 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Oct 30 15:50:35 2015 +0100
WHATS_NEW: reporting commands and -o-/-o+ extension
---
WHATS_NEW | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 415efc7..3808cb6 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,7 @@
Version 2.02.133 -
======================================
+ Support repeated -o|--options for reporting commands.
+ Support -o- and -o# for reporting commands to remove and compact fields.
Fix missing PVs from pvs output if vgremove is run concurrently.
Remove unwanted error message when running pvs/vgs/lvs and vgremove at once.
Check newly created VG's metadata do not overlap in metadata ring buffer.
8 years, 1 month
master - commands: update command help for -o|--options for reporting commands
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=dd52721b68a7c3...
Commit: dd52721b68a7c393a54149649f518f4e2d9440b5
Parent: 7f125c1116df74d23b442304d8109a784f677251
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Oct 30 15:43:57 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Oct 30 15:47:56 2015 +0100
commands: update command help for -o|--options for reporting commands
---
tools/commands.h | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/tools/commands.h b/tools/commands.h
index ae5dff7..a141135 100644
--- a/tools/commands.h
+++ b/tools/commands.h
@@ -70,7 +70,7 @@ xx(devtypes,
"\t[--nameprefixes]\n"
"\t[--noheadings]\n"
"\t[--nosuffix]\n"
- "\t[-o|--options [+]Field[,Field]]\n"
+ "\t[-o|--options [+|-|#]Field[,Field]]\n"
"\t[-O|--sort [+|-]key1[,[+|-]key2[,...]]]\n"
"\t[--rows]\n"
"\t[-S|--select Selection]\n"
@@ -431,7 +431,7 @@ xx(lvdisplay,
"\t[--ignoreskippedcluster]\n"
"\t[--noheadings]\n"
"\t[--nosuffix]\n"
- "\t[-o|--options [+]Field[,Field]]\n"
+ "\t[-o|--options [+|-|#]Field[,Field]]\n"
"\t[-O|--sort [+|-]key1[,[+|-]key2[,...]]]\n"
"\t[-S|--select Selection]\n"
"\t[-P|--partial]\n"
@@ -665,7 +665,7 @@ xx(lvs,
"\t[--nameprefixes]\n"
"\t[--noheadings]\n"
"\t[--nosuffix]\n"
- "\t[-o|--options [+]Field[,Field]]\n"
+ "\t[-o|--options [+|-|#]Field[,Field]]\n"
"\t[-O|--sort [+|-]key1[,[+|-]key2[,...]]]\n"
"\t[-P|--partial]\n"
"\t[--readonly]\n"
@@ -846,7 +846,7 @@ xx(pvdisplay,
"\t[--ignoreskippedcluster]\n"
"\t[--noheadings]\n"
"\t[--nosuffix]\n"
- "\t[-o|--options [+]Field[,Field]]\n"
+ "\t[-o|--options [+|-|#]Field[,Field]]\n"
"\t[-O|--sort [+|-]key1[,[+|-]key2[,...]]]\n"
"\t[-S|--select Selection]\n"
"\t[--readonly]\n"
@@ -938,7 +938,7 @@ xx(pvs,
"\t[--nameprefixes]\n"
"\t[--noheadings]\n"
"\t[--nosuffix]\n"
- "\t[-o|--options [+]Field[,Field]]\n"
+ "\t[-o|--options [+|-|#]Field[,Field]]\n"
"\t[-O|--sort [+|-]key1[,[+|-]key2[,...]]]\n"
"\t[-P|--partial]\n"
"\t[--readonly]\n"
@@ -1177,7 +1177,7 @@ xx(vgdisplay,
"\t[--ignoreskippedcluster]\n"
"\t[--noheadings]\n"
"\t[--nosuffix]\n"
- "\t[-o|--options [+]Field[,Field]]\n"
+ "\t[-o|--options [+|-|#]Field[,Field]]\n"
"\t[-O|--sort [+|-]key1[,[+|-]key2[,...]]]\n"
"\t[-P|--partial]\n"
"\t[-S|--select Selection]\n"
@@ -1350,7 +1350,7 @@ xx(vgs,
"\t[--nameprefixes]\n"
"\t[--noheadings]\n"
"\t[--nosuffix]\n"
- "\t[-o|--options [+]Field[,Field]]\n"
+ "\t[-o|--options [+|-|#]Field[,Field]]\n"
"\t[-O|--sort [+|-]key1[,[+|-]key2[,...]]]\n"
"\t[-P|--partial]\n"
"\t[--readonly]\n"
8 years, 1 month
master - man: pvs/vgs/lvs and -o+, -o-, -o#
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7f125c1116df74...
Commit: 7f125c1116df74d23b442304d8109a784f677251
Parent: 5b04eda93f903d25e25385d148d28b8cfa1157ea
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Oct 30 15:36:35 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Oct 30 15:47:56 2015 +0100
man: pvs/vgs/lvs and -o+, -o-, -o#
---
man/lvdisplay.8.in | 2 +-
man/lvs.8.in | 11 ++++++++---
man/pvdisplay.8.in | 2 +-
man/pvs.8.in | 11 ++++++++---
man/vgdisplay.8.in | 2 +-
man/vgs.8.in | 11 ++++++++---
6 files changed, 27 insertions(+), 12 deletions(-)
diff --git a/man/lvdisplay.8.in b/man/lvdisplay.8.in
index ed1d3f7..f14fa03 100644
--- a/man/lvdisplay.8.in
+++ b/man/lvdisplay.8.in
@@ -37,7 +37,7 @@ lvdisplay \(em display attributes of a logical volume
.RB [ \-\-noheadings ]
.RB [ \-\-nosuffix ]
.RB [ \-o | \-\-options
-.RI [ + ] Field [ ,Field ...]]
+.RI [ + | \- | # ] Field [ ,Field ...]]
.RB [ \-O | \-\-sort
.RI [ + | \- ] Key1 [ , [ + | \- ] Key2 ...]]
.RB [ \-P | \-\-partial ]
diff --git a/man/lvs.8.in b/man/lvs.8.in
index 3cb2ec0..952b6ec 100644
--- a/man/lvs.8.in
+++ b/man/lvs.8.in
@@ -16,7 +16,7 @@ lvs \(em report information about logical volumes
.RB [ \-\-noheadings ]
.RB [ \-\-nosuffix ]
.RB [ \-o | \-\-options
-.RI [ + ] Field [, Field ]]
+.RI [ + | \- | # ] Field [, Field ]]
.RB [ \-O | \-\-sort
.RI [ + | \- ] Key1 [,[ + | \- ] Key2 [,...]]]
.RB [ \-P | \-\-partial ]
@@ -76,8 +76,13 @@ Suppress the suffix on output sizes. Use with \fB\-\-units\fP
(except h and H) if processing the output.
.TP
.BR \-o ", " \-\-options
-Comma-separated ordered list of columns. Precede the list with '\fI+\fP'
-to append to the default selection of columns instead of replacing it.
+Comma-separated ordered list of columns.
+.IP
+Precede the list with '\fI+\fP' to append to the current list
+of columns, '\fI-\fP' to remove from the current list of columns
+or '\fI#\fP' to compact given columns. The \fI\-o\fP option can
+be repeated, providing several lists. These lists are evaluated
+from left to right.
.IP
Use \fB\-o lv_all\fP to select all logical volume columns,
and \fB\-o seg_all\fP
diff --git a/man/pvdisplay.8.in b/man/pvdisplay.8.in
index c1232d6..5f93634 100644
--- a/man/pvdisplay.8.in
+++ b/man/pvdisplay.8.in
@@ -37,7 +37,7 @@ pvdisplay \- display attributes of a physical volume
.RB [ \-\-noheadings ]
.RB [ \-\-nosuffix ]
.RB [ \-o | \-\-options
-.RI [ + ] Field [ ,Field ...]]
+.RI [ + | \- | # ] Field [ ,Field ...]]
.RB [ \-O | \-\-sort
.RI [ + | \- ] Key1 [ , [ + | \- ] Key2 ...
.RI ]]
diff --git a/man/pvs.8.in b/man/pvs.8.in
index 605b13d..efafbde 100644
--- a/man/pvs.8.in
+++ b/man/pvs.8.in
@@ -16,7 +16,7 @@ pvs \(em report information about physical volumes
.RB [ \-\-noheadings ]
.RB [ \-\-nosuffix ]
.RB [ \-o | \-\-options
-.RI [ + ] Field [ ,Field ...]]
+.RI [ + | \- | # ] Field [ ,Field ...]]
.RB [ \-O | \-\-sort
.RI [ + | \- ] Key1 [ , [ + | \- ] Key2 ...]]
.RB [ \-P | \-\-partial ]
@@ -65,8 +65,13 @@ Suppress the suffix on output sizes. Use with \fB\-\-units\fP
(except h and H) if processing the output.
.TP
.BR \-o ", " \-\-options
-Comma-separated ordered list of columns. Precede the list with '\fI+\fP'
-to append to the default selection of columns.
+Comma-separated ordered list of columns.
+.IP
+Precede the list with '\fI+\fP' to append to the current list
+of columns, '\fI-\fP' to remove from the current list of columns
+or '\fI#\fP' to compact given columns. The \fI\-o\fP option can
+be repeated, providing several lists. These lists are evaluated
+from left to right.
.IP
Use \fB-o pv_all\fP to select all physical volume columns,
and \fB-o pvseg_all\fP to select all Physical Volume segment columns.
diff --git a/man/vgdisplay.8.in b/man/vgdisplay.8.in
index 172dba4..89a7a5a 100644
--- a/man/vgdisplay.8.in
+++ b/man/vgdisplay.8.in
@@ -37,7 +37,7 @@ vgdisplay \(em display attributes of volume groups
.RB [ \-\-noheadings ]
.RB [ \-\-nosuffix ]
.RB [ \-o|\-\-options
-.RI [ + ] Field1 [ ,Field2 ...]]
+.RI [ + | \- | # ] Field1 [ ,Field2 ...]]
.RB [ \-O | \-\-sort
.RI [ + | \- ] Key1 [ , [ + | \- ] Key2 ...]]
.RB [ \-P | \-\-partial ]
diff --git a/man/vgs.8.in b/man/vgs.8.in
index 654e8bb..f219665 100644
--- a/man/vgs.8.in
+++ b/man/vgs.8.in
@@ -16,7 +16,7 @@ vgs \(em report information about volume groups
.RB [ \-\-noheadings ]
.RB [ \-\-nosuffix ]
.RB [ \-o | \-\-options
-.RI [ + ] Field1 [ ,Field2 ...]]
+.RI [ + | \- | # ] Field1 [ ,Field2 ...]]
.RB [ \-O | \-\-sort
.RI [ + | \- ] Key1 [ , [ + | \- ] Key2 ...]]
.RB [ \-P | \-\-partial ]
@@ -63,8 +63,13 @@ Suppress the suffix on output sizes. Use with \fB\-\-units\fP
(except h and H) if processing the output.
.TP
.BR \-o ", " \-\-options
-Comma-separated ordered list of columns. Precede the list with '+' to append
-to the default selection of columns.
+Comma-separated ordered list of columns.
+.IP
+Precede the list with '\fI+\fP' to append to the current list
+of columns, '\fI-\fP' to remove from the current list of columns
+or '\fI#\fP' to compact given columns. The \fI\-o\fP option can
+be repeated, providing several lists. These lists are evaluated
+from left to right.
.IP
Use \fB\-o vg_all\fP to select all volume group columns.
.IP
8 years, 1 month
master - tests: add report-fields.sh test
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5b04eda93f903d...
Commit: 5b04eda93f903d25e25385d148d28b8cfa1157ea
Parent: 77c31d0c39c3ba9caf7a5a70282f1c5a6b0f48e2
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Oct 30 15:06:49 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Oct 30 15:47:56 2015 +0100
tests: add report-fields.sh test
---
test/shell/report-fields.sh | 91 +++++++++++++++++++++++++++++++++++++++++++
1 files changed, 91 insertions(+), 0 deletions(-)
diff --git a/test/shell/report-fields.sh b/test/shell/report-fields.sh
new file mode 100644
index 0000000..e0c7308
--- /dev/null
+++ b/test/shell/report-fields.sh
@@ -0,0 +1,91 @@
+#!/bin/sh
+# Copyright (C) 2015 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+SKIP_WITH_LVMETAD=1
+SKIP_WITH_LVMPOLLD=1
+SKIP_WITH_CLVMD=1
+
+. lib/inittest
+
+# Test only that there's correct set of fields displayed on output.
+
+aux prepare_pvs 1
+
+OPTS="--nameprefixes --noheadings --rows"
+
+aux lvmconf 'report/pvs_cols="pv_name,pv_size"'
+aux lvmconf 'report/compact_output=0'
+aux lvmconf 'report/compact_output_cols=""'
+
+pvs $OPTS > out
+grep LVM2_PV_NAME out
+grep LVM2_PV_SIZE out
+
+pvs $OPTS -o pv_attr > out
+grep LVM2_PV_ATTR out
+not grep -v LVM2_PV_ATTR out
+
+pvs $OPTS -o+pv_attr > out
+grep LVM2_PV_NAME out
+grep LVM2_PV_SIZE out
+grep LVM2_PV_ATTR out
+
+pvs $OPTS -o-pv_name > out
+not grep LVM2_PV_NAME out
+grep LVM2_PV_SIZE out
+
+pvs $OPTS -o+pv_attr -o-pv_attr > out
+grep LVM2_PV_NAME out
+grep LVM2_PV_SIZE out
+not grep LVM2_PV_ATTR out
+
+pvs $OPTS -o-pv_attr -o+pv_attr > out
+grep LVM2_PV_NAME out
+grep LVM2_PV_SIZE out
+grep LVM2_PV_ATTR out
+
+pvs $OPTS -o+pv_attr -o-pv_attr -o pv_attr > out
+grep LVM2_PV_ATTR out
+not grep -v LVM2_PV_ATTR out
+
+# -o-size is the same as -o-pv_size - the prefix is recognized
+pvs $OPTS -o-size > out
+not grep LVM2_PV_SIZE out
+
+# PV does not have tags nor is it exported if we haven't done that explicitly.
+# Check compaction per field is done correctly.
+pvs $OPTS -o pv_name,pv_exported,pv_tags -o#pv_tags > out
+grep LVM2_PV_NAME out
+grep LVM2_PV_EXPORTED out
+not grep LVM2_PV_TAGS out
+
+aux lvmconf 'report/compact_output_cols="pv_tags"'
+
+pvs $OPTS -o pv_name,pv_exported,pv_tags > out
+grep LVM2_PV_NAME out
+grep LVM2_PV_EXPORTED out
+not grep LVM2_PV_TAGS out
+
+pvs $OPTS -o pv_name,pv_exported,pv_tags -o#pv_exported > out
+grep LVM2_PV_NAME out
+not grep LVM2_PV_EXPORTED out
+grep LVM2_PV_TAGS out
+
+aux lvmconf 'report/compact_output=1'
+pvs $OPTS -o pv_name,pv_exported,pv_tags > out
+grep LVM2_PV_NAME out
+not grep LVM2_PV_EXPORTED out
+not grep LVM2_PV_TAGS out
+
+pvs $OPTS -o pv_name,pv_exported,pv_tags -o#pv_exported > out
+grep LVM2_PV_NAME out
+not grep LVM2_PV_EXPORTED out
+not grep LVM2_PV_TAGS out
8 years, 1 month
master - report: support "-o #field_name1, field_name2, ..."
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=77c31d0c39c3ba...
Commit: 77c31d0c39c3ba9caf7a5a70282f1c5a6b0f48e2
Parent: baf320455b06141eb472faa687e7fcdc838bdd8c
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Oct 22 15:37:27 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Oct 30 15:47:56 2015 +0100
report: support "-o #field_name1,field_name2,..."
---
tools/reporter.c | 34 +++++++++++++++++++++++++++++-----
1 files changed, 29 insertions(+), 5 deletions(-)
diff --git a/tools/reporter.c b/tools/reporter.c
index f4f9b71..89024c2 100644
--- a/tools/reporter.c
+++ b/tools/reporter.c
@@ -642,17 +642,21 @@ static void _del_option_from_list(struct dm_list *sll, const char *prefix,
static int _get_report_options(struct cmd_context *cmd,
report_type_t report_type,
- const char **options)
+ const char **options,
+ const char **fields_to_compact)
{
const char *prefix = report_get_field_prefix(report_type);
size_t prefix_len = strlen(prefix);
struct arg_value_group_list *current_group;
struct dm_list *final_opts_list;
+ struct dm_list *final_compact_list = NULL;
struct dm_list *opts_list = NULL;
+ int opts_list_destroy = 1;
struct dm_str_list *sl;
const char *opts;
int r = ECMD_PROCESSED;
+
if (!(final_opts_list = str_to_str_list(NULL, *options, ",", 1))) {
r = ECMD_FAILED;
goto_out;
@@ -673,6 +677,8 @@ static int _get_report_options(struct cmd_context *cmd,
case '+':
/* fall through */
case '-':
+ /* fall through */
+ case '#':
if (!(opts_list = str_to_str_list(NULL, opts + 1, ",", 1))) {
r = ECMD_FAILED;
goto_out;
@@ -683,8 +689,17 @@ static int _get_report_options(struct cmd_context *cmd,
dm_list_iterate_items(sl, opts_list)
_del_option_from_list(final_opts_list, prefix,
prefix_len, sl->str);
+ } else if (*opts == '#') {
+ if (!final_compact_list) {
+ final_compact_list = opts_list;
+ opts_list_destroy = 0;
+ } else
+ dm_list_splice(final_compact_list, opts_list);
}
- str_list_destroy(opts_list, 1);
+ if (opts_list_destroy)
+ str_list_destroy(opts_list, 1);
+ else
+ opts_list_destroy = 1;
opts_list = NULL;
break;
default:
@@ -700,9 +715,17 @@ static int _get_report_options(struct cmd_context *cmd,
r = ECMD_FAILED;
goto out;
}
+ if (final_compact_list &&
+ !(*fields_to_compact = str_list_to_str(cmd->mem, final_compact_list, ","))) {
+ dm_pool_free(cmd->mem, (char *) *options);
+ r = ECMD_FAILED;
+ goto out;
+ }
out:
if (opts_list)
str_list_destroy(final_opts_list, 1);
+ if (final_compact_list)
+ str_list_destroy(final_compact_list, 1);
if (final_opts_list)
str_list_destroy(final_opts_list, 1);
return r;
@@ -720,7 +743,7 @@ static int _report(struct cmd_context *cmd, int argc, char **argv,
unsigned args_are_pvs;
int lv_info_needed, lv_segment_status_needed;
int lock_global = 0;
- const char *fields_to_compact;
+ const char *fields_to_compact = NULL;
aligned = find_config_tree_bool(cmd, report_aligned_CFG, NULL);
buffered = find_config_tree_bool(cmd, report_buffered_CFG, NULL);
@@ -792,7 +815,7 @@ static int _report(struct cmd_context *cmd, int argc, char **argv,
/* If -o supplied use it, else use default for report_type */
if (arg_count(cmd, options_ARG) &&
- ((r = _get_report_options(cmd, report_type, &options) != ECMD_PROCESSED)))
+ ((r = _get_report_options(cmd, report_type, &options, &fields_to_compact) != ECMD_PROCESSED)))
return r;
/* -O overrides default sort settings */
@@ -909,7 +932,8 @@ static int _report(struct cmd_context *cmd, int argc, char **argv,
if (find_config_tree_bool(cmd, report_compact_output_CFG, NULL)) {
if (!dm_report_compact_fields(report_handle))
log_error("Failed to compact report output.");
- } else if ((fields_to_compact = find_config_tree_str_allow_empty(cmd, report_compact_output_cols_CFG, NULL))) {
+ } else if (fields_to_compact ||
+ (fields_to_compact = find_config_tree_str_allow_empty(cmd, report_compact_output_cols_CFG, NULL))) {
if (!dm_report_compact_given_fields(report_handle, fields_to_compact))
log_error("Failed to compact given columns in report output.");
}
8 years, 1 month
master - report: recognize known prefix when processing "-o -field_name1, field_name2, ..."
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=baf320455b0614...
Commit: baf320455b06141eb472faa687e7fcdc838bdd8c
Parent: bb4d3fa7a70881b72ddf61cba02760b89cf07b53
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Oct 22 14:30:11 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Oct 30 15:47:56 2015 +0100
report: recognize known prefix when processing "-o -field_name1,field_name2,..."
---
tools/reporter.c | 35 +++++++++++++++++++++++++++++++----
1 files changed, 31 insertions(+), 4 deletions(-)
diff --git a/tools/reporter.c b/tools/reporter.c
index 591f4ed..f4f9b71 100644
--- a/tools/reporter.c
+++ b/tools/reporter.c
@@ -604,22 +604,48 @@ static void _check_pv_list(struct cmd_context *cmd, int argc, char **argv,
}
}
-static void _del_option_from_list(struct dm_list *sll, const char *str)
+static void _del_option_from_list(struct dm_list *sll, const char *prefix,
+ size_t prefix_len, const char *str)
{
struct dm_list *slh;
struct dm_str_list *sl;
+ const char *a = str, *b;
+ prefix_len--;
dm_list_uniterate(slh, sll, sll) {
sl = dm_list_item(slh, struct dm_str_list);
+
+ /* exact match */
if (!strcmp(str, sl->str)) {
dm_list_del(slh);
return;
}
+
+ /* also try to match with known prefix */
+ b = sl->str;
+ if (!strncmp(prefix, a, prefix_len)) {
+ a += prefix_len;
+ if (*a == '_')
+ a++;
+ }
+ if (!strncmp(prefix, b, prefix_len)) {
+ b += prefix_len;
+ if (*b == '_')
+ b++;
+ }
+ if (!strcmp(a, b)) {
+ dm_list_del(slh);
+ return;
+ }
}
}
-static int _get_report_options(struct cmd_context *cmd, const char **options)
+static int _get_report_options(struct cmd_context *cmd,
+ report_type_t report_type,
+ const char **options)
{
+ const char *prefix = report_get_field_prefix(report_type);
+ size_t prefix_len = strlen(prefix);
struct arg_value_group_list *current_group;
struct dm_list *final_opts_list;
struct dm_list *opts_list = NULL;
@@ -655,7 +681,8 @@ static int _get_report_options(struct cmd_context *cmd, const char **options)
dm_list_splice(final_opts_list, opts_list);
} else if (*opts == '-') {
dm_list_iterate_items(sl, opts_list)
- _del_option_from_list(final_opts_list, sl->str);
+ _del_option_from_list(final_opts_list, prefix,
+ prefix_len, sl->str);
}
str_list_destroy(opts_list, 1);
opts_list = NULL;
@@ -765,7 +792,7 @@ static int _report(struct cmd_context *cmd, int argc, char **argv,
/* If -o supplied use it, else use default for report_type */
if (arg_count(cmd, options_ARG) &&
- ((r = _get_report_options(cmd, &options) != ECMD_PROCESSED)))
+ ((r = _get_report_options(cmd, report_type, &options) != ECMD_PROCESSED)))
return r;
/* -O overrides default sort settings */
8 years, 1 month
master - report: add report_get_field_prefix function
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=bb4d3fa7a70881...
Commit: bb4d3fa7a70881b72ddf61cba02760b89cf07b53
Parent: 3e18b101a0845f826de29cfd0c554c5e2be2baa5
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Oct 22 13:27:59 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Oct 30 15:47:56 2015 +0100
report: add report_get_field_prefix function
---
lib/report/report.c | 15 +++++++++++++++
lib/report/report.h | 1 +
2 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/lib/report/report.c b/lib/report/report.c
index dea66ee..911c96e 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -3396,6 +3396,21 @@ void *report_init_for_selection(struct cmd_context *cmd,
cmd);
}
+const char *report_get_field_prefix(report_type_t report_type_id)
+{
+ const struct dm_report_object_type *report_types, *report_type;
+
+ report_types = report_type_id & DEVTYPES ? _devtypes_report_types
+ : _report_types;
+
+ for (report_type = report_types; report_type->id; report_type++) {
+ if (report_type_id & report_type->id)
+ return report_type->prefix;
+ }
+
+ return "";
+}
+
/*
* Create a row of data for an object
*/
diff --git a/lib/report/report.h b/lib/report/report.h
index 84c5f91..6c8b026 100644
--- a/lib/report/report.h
+++ b/lib/report/report.h
@@ -71,6 +71,7 @@ void *report_init(struct cmd_context *cmd, const char *format, const char *keys,
int quoted, int columns_as_rows, const char *selection);
void *report_init_for_selection(struct cmd_context *cmd, report_type_t *report_type,
const char *selection);
+const char *report_get_field_prefix(report_type_t report_type);
int report_for_selection(struct cmd_context *cmd,
struct selection_handle *sh,
struct physical_volume *pv,
8 years, 1 month