master - cleanup: rename variable wait
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b193a3b09ffd28...
Commit: b193a3b09ffd28b7a170acc74095a05fa8fe2f8e
Parent: 00af0d13c91d24952ec0542b5fe8323835d59051
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jun 19 11:33:11 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jun 19 12:02:48 2014 +0200
cleanup: rename variable wait
With older system headers (sys/wait.h) this shadows declaration.
---
libdaemon/server/daemon-server.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c
index 0ea3f69..8ed3cce 100644
--- a/libdaemon/server/daemon-server.c
+++ b/libdaemon/server/daemon-server.c
@@ -490,13 +490,13 @@ static int handle_connect(daemon_state s)
return 1;
}
-static void reap(daemon_state s, int wait)
+static void reap(daemon_state s, int waiting)
{
thread_state *last = s.threads, *ts = last->next;
void *rv;
while (ts) {
- if (wait || !ts->active) {
+ if (waiting || !ts->active) {
pthread_join(ts->client.thread_id, &rv);
last->next = ts->next;
dm_free(ts);
8 years, 9 months
master - cleanup: more readable
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=00af0d13c91d24...
Commit: 00af0d13c91d24952ec0542b5fe8323835d59051
Parent: aa3e41309368c1504943b8a116f5a3646777e2a0
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jun 19 11:30:57 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jun 19 12:02:48 2014 +0200
cleanup: more readable
Older gcc complained a bit about uninitialized vars
so reorder code for better readability.
---
lib/commands/toolcontext.c | 23 +++++++++--------------
1 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index cc08747..326bfe0 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -629,26 +629,21 @@ static int _init_tag_configs(struct cmd_context *cmd)
static int _init_profiles(struct cmd_context *cmd)
{
const char *dir;
- struct profile_params *pp;
- int initialized = cmd->profile_params != NULL;
-
- if (!initialized && !(pp = dm_pool_zalloc(cmd->libmem, sizeof(*pp)))) {
- log_error("profile_params alloc failed");
- return 0;
- }
if (!(dir = find_config_tree_str(cmd, config_profile_dir_CFG, NULL)))
return_0;
- if (initialized) {
- dm_strncpy(cmd->profile_params->dir, dir, sizeof(pp->dir));
- } else {
- dm_strncpy(pp->dir, dir, sizeof(pp->dir));
- dm_list_init(&pp->profiles_to_load);
- dm_list_init(&pp->profiles);
- cmd->profile_params = pp;
+ if (!cmd->profile_params) {
+ if (!(cmd->profile_params = dm_pool_zalloc(cmd->libmem, sizeof(*cmd->profile_params)))) {
+ log_error("profile_params alloc failed");
+ return 0;
+ }
+ dm_list_init(&cmd->profile_params->profiles_to_load);
+ dm_list_init(&cmd->profile_params->profiles);
}
+ dm_strncpy(cmd->profile_params->dir, dir, sizeof(cmd->profile_params->dir));
+
return 1;
}
8 years, 9 months
master - lvchange: better --refresh of raid and mirrors
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=aa3e41309368c1...
Commit: aa3e41309368c1504943b8a116f5a3646777e2a0
Parent: 57faf97e6fe9a8d7be859db2edb1ba2ad855113d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jun 19 11:58:28 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jun 19 12:01:34 2014 +0200
lvchange: better --refresh of raid and mirrors
Use lv_check_not_in_use() to detect openned device.
Plain info.open_count is not good enough for udev random
device openning.
---
WHATS_NEW | 1 +
tools/lvchange.c | 5 +----
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 5d59845..f7d2b96 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.107 -
==================================
+ Fix open_count test for lvchange --refresh or mirrors and raids.
Update pvs,vgs,lvs and lvm man page for selection support.
Add -S/--select to lvm devtypes for report selection.
Add -S/--select to pvs,vgs,lvs and {pv,vg,lv}display -C for report selection.
diff --git a/tools/lvchange.c b/tools/lvchange.c
index 48e48d4..9bd6a88 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -347,7 +347,7 @@ static int lvchange_resync(struct cmd_context *cmd, struct logical_volume *lv)
}
if (lv_info(cmd, lv, 0, &info, 1, 0)) {
- if (info.open_count) {
+ if (!lv_check_not_in_use(cmd, lv, &info)) {
log_error("Can't resync open logical volume \"%s\"",
lv->name);
return 0;
@@ -363,9 +363,6 @@ static int lvchange_resync(struct cmd_context *cmd, struct logical_volume *lv)
return 0;
}
- if (sigint_caught())
- return_0;
-
active = 1;
if (lv_is_active_exclusive_locally(lv))
exclusive = 1;
8 years, 9 months
master - test: Clean-up pvmove-basic for atomic pvmove test
by Jonathan Brassow
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=57faf97e6fe9a8...
Commit: 57faf97e6fe9a8d7be859db2edb1ba2ad855113d
Parent: e96a4856e678d84054e6c11532628e55830f2fc4
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Wed Jun 18 15:40:06 2014 -0500
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Wed Jun 18 15:40:06 2014 -0500
test: Clean-up pvmove-basic for atomic pvmove test
The way I was testing for the existence of pvmove mimages was
incorrect for rhel5. This patch makes it more generic/universal.
---
test/shell/pvmove-basic.sh | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/test/shell/pvmove-basic.sh b/test/shell/pvmove-basic.sh
index bdfb79a..c326dc3 100644
--- a/test/shell/pvmove-basic.sh
+++ b/test/shell/pvmove-basic.sh
@@ -71,7 +71,7 @@ check_and_cleanup_lvs_() {
vgchange -an $vg
lvremove -ff $vg
(dm_table | not grep $vg) || \
- die "ERROR: lvremove did leave some some mappings in DM behind!"
+ die "ERROR: lvremove did leave some mappings in DM behind!"
}
# ---------------------------------------------------------------------
@@ -346,16 +346,13 @@ pvmove $mode "$dev1"
#COMM "pvmove fails activating mirror, properly restores state before pvmove"
dmsetup create $vg-pvmove0 --notable
not pvmove $mode -i 1 "$dev2"
-echo BARF
-dmsetup ls
dmsetup info --noheadings -c -o suspended $vg-$lv1
test $(dmsetup info --noheadings -c -o suspended $vg-$lv1) = "Active"
-if [ -e /dev/mapper/$vg-pvmove0_mimage_0 ]; then
- dmsetup remove $vg-pvmove0 /dev/mapper/$vg-pvmove0_mimage*
+if dmsetup info $vg-pvmove0_mimage_0 > /dev/null; then
+ dmsetup remove $vg-pvmove0 $vg-pvmove0_mimage_0 $vg-pvmove0_mimage_1
else
dmsetup remove $vg-pvmove0
fi
-dmsetup ls
lvremove -ff $vg
done
\ No newline at end of file
8 years, 9 months
master - man: lvmthin
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e96a4856e678d8...
Commit: e96a4856e678d84054e6c11532628e55830f2fc4
Parent: 597de5c807c4d5bdd7070359cb62222f454ec1f0
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Jun 18 14:28:50 2014 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Jun 18 14:30:57 2014 -0500
man: lvmthin
Clean up inconsistencies in the last change.
Improve some bad formatting.
---
man/lvmthin.7.in | 333 +++++++++++++++++++++++++++---------------------------
1 files changed, 169 insertions(+), 164 deletions(-)
diff --git a/man/lvmthin.7.in b/man/lvmthin.7.in
index 7d2ef45..fbd7a91 100644
--- a/man/lvmthin.7.in
+++ b/man/lvmthin.7.in
@@ -103,7 +103,7 @@ Create an LV that will hold thin pool data.
.I Example
.br
-.B # lvcreate \-n pool0 \-L 10G vg
+# lvcreate \-n pool0 \-L 10G vg
.SS 2. create ThinMetaLV
@@ -113,7 +113,7 @@ Create an LV that will hold thin pool metadata.
.I Example
.br
-.B # lvcreate \-n pool0meta \-L 1G vg
+# lvcreate \-n pool0meta \-L 1G vg
# lvs
LV VG Attr LSize
@@ -122,16 +122,18 @@ Create an LV that will hold thin pool metadata.
.SS 3. create ThinPoolLV
+.nf
Combine the data and metadata LVs into a thin pool LV.
ThinDataLV is renamed to hidden ThinPoolLV_tdata.
ThinMetaLV is renamed to hidden ThinPoolLV_tmeta.
The new ThinPoolLV takes the previous name of ThinDataLV.
+.fi
.B lvconvert \-\-thinpool VG/ThinDataLV \-\-poolmetadata VG/ThinMetaLV
.I Example
.br
-.B # lvconvert \-\-thinpool vg/pool0 \-\-poolmetadata vg/pool0meta
+# lvconvert \-\-thinpool vg/pool0 \-\-poolmetadata vg/pool0meta
# lvs vg/pool0
LV VG Attr LSize Pool Origin Data% Meta%
@@ -145,26 +147,26 @@ The new ThinPoolLV takes the previous name of ThinDataLV.
.SS 4. create ThinLV
+.nf
Create a new thin LV from the thin pool LV.
The thin LV is created with a virtual size.
Multiple new thin LVs may be created in the thin pool.
Thin LV names must be unique in the VG.
The thinpool argument specifies which thin pool will
contain the ThinLV.
+.fi
.B lvcreate \-n ThinLV \-V VirtualSize \-\-thinpool VG/ThinPoolLV
-.br
-.B lvcreate \-T \-n ThinLV \-V VirtualSize VG/ThinPoolLV
.I Example
.br
Create a thin LV in a thin pool:
.br
-.B # lvcreate \-T \-n thin1 \-V 1T vg/pool0
+# lvcreate \-n thin1 \-V 1T \-\-thinpool vg/pool0
Create another thin LV in the same thin pool:
.br
-.B # lvcreate \-n thin2 \-V 1T \-\-thinpool vg/pool0
+# lvcreate \-n thin2 \-V 1T \-\-thinpool vg/pool0
# lvs vg/thin1 vg/thin2
LV VG Attr LSize Pool Origin Data%
@@ -174,9 +176,12 @@ Create another thin LV in the same thin pool:
.SS 5. create SnapLV
Create snapshots of an existing ThinLV or SnapLV.
-Do not \fBNOT\fP specify
+.br
+Do not specify
.BR \-L ", " \-\-size
-since this would not create thin snapshot, but old COW volume.
+when creating a thin snapshot.
+.br
+A size argument will cause an old COW snapshot to be created.
.B lvcreate \-n SnapLV \-s VG/ThinLV
.br
@@ -186,15 +191,15 @@ since this would not create thin snapshot, but old COW volume.
.br
Create first snapshot of an existing ThinLV:
.br
-.B # lvcreate \-n thin1s1 \-s vg/thin1
+# lvcreate \-n thin1s1 \-s vg/thin1
Create second snapshot of the same ThinLV:
.br
-.B # lvcreate \-n thin1s2 \-s vg/thin1
+# lvcreate \-n thin1s2 \-s vg/thin1
Create a snapshot of the first snapshot:
.br
-.B # lvcreate \-n thin1s1s1 \-s vg/thin1s1
+# lvcreate \-n thin1s1s1 \-s vg/thin1s1
# lvs vg/thin1s1 vg/thin1s2 vg/thin1s1s1
LV VG Attr LSize Pool Origin
@@ -202,7 +207,6 @@ Create a snapshot of the first snapshot:
thin1s2 vg Vwi---tz-k 1.00t pool0 thin1
thin1s1s1 vg Vwi---tz-k 1.00t pool0 thin1s1
-
.SS 6. activate SnapLV
Thin snapshots are created with the persistent "activation skip"
@@ -213,7 +217,7 @@ or vgchange to activate thin snapshots with the "k" attribute.
.I Example
.br
-.B # lvchange \-ay \-K vg/thin1s1
+# lvchange \-ay \-K vg/thin1s1
# lvs vg/thin1s1
LV VG Attr LSize Pool Origin
@@ -286,11 +290,11 @@ to use fast devices for the metadata LV.
.I Example
.br
-.B # lvcreate \-n pool0 \-L 10G vg /dev/sdA
-.br
-.B # lvcreate \-n pool0meta \-L 1G vg /dev/sdB
-.br
-.B # lvconvert \-\-thinpool vg/pool0 \-\-poolmetadata vg/pool0meta
+.nf
+# lvcreate \-n pool0 \-L 10G vg /dev/sdA
+# lvcreate \-n pool0meta \-L 1G vg /dev/sdB
+# lvconvert \-\-thinpool vg/pool0 \-\-poolmetadata vg/pool0meta
+.fi
.BR lvm.conf (5)
.B thin_pool_metadata_require_separate_pvs
@@ -314,11 +318,11 @@ pool metadata LV. This is especially recommended for pool metadata LVs.
.I Example
.br
-.B # lvcreate \-\-type raid1 \-m 1 \-n pool0 \-L 10G vg /dev/sdA /dev/sdB
-.br
-.B # lvcreate \-\-type raid1 \-m 1 \-n pool0meta \-L 1G vg /dev/sdC /dev/sdD
-.br
-.B # lvconvert \-\-thinpool vg/pool0 \-\-poolmetadata vg/pool0meta
+.nf
+# lvcreate \-\-type raid1 \-m 1 \-n pool0 \-L 10G vg /dev/sdA /dev/sdB
+# lvcreate \-\-type raid1 \-m 1 \-n pool0meta \-L 1G vg /dev/sdC /dev/sdD
+# lvconvert \-\-thinpool vg/pool0 \-\-poolmetadata vg/pool0meta
+.fi
.SS Spare metadata LV
@@ -339,17 +343,18 @@ One pmspare LV is kept in a VG to be used for any thin pool.
The pmspare LV cannot be created explicitly, but may be removed
explicitly.
+.I Example
+.br
.nf
-Example
# lvcreate \-n pool0 \-L 10G vg
-# lvcreate \-n pool0meta \-L 10G vg
+# lvcreate \-n pool0meta \-L 1G vg
# lvconvert \-\-thinpool vg/pool0 \-\-poolmetadata vg/pool0meta
# lvs \-a
-[lvol0_pmspare] vg ewi------- 10.00g
-pool0 vg twi---tz-- 10.00g
-[pool0_tdata] vg Twi------- 10.00g
-[pool0_tmeta] vg ewi------- 1.00g
+ [lvol0_pmspare] vg ewi------- 10.00g
+ pool0 vg twi---tz-- 10.00g
+ [pool0_tdata] vg Twi------- 10.00g
+ [pool0_tmeta] vg ewi------- 1.00g
.fi
The "Metadata check and repair" section describes the use of
@@ -383,9 +388,8 @@ the thin pool LV is not activated, and the thin pool metadata should
be repaired.
Command to repair a thin pool:
-.nf
-lvconvert \-\-repair VG/ThinPoolLV
-.fi
+.br
+.B lvconvert \-\-repair VG/ThinPoolLV
Repair performs the following steps:
@@ -413,9 +417,7 @@ If metadata is manually restored with thin_repair directly,
the pool metadata LV can be manually swapped with another LV
containing new metadata:
-.nf
-lvconvert \-\-thinpool VG/ThinPoolLV \-\-poolmetadata VG/NewThinMetaLV
-.fi
+.B lvconvert \-\-thinpool VG/ThinPoolLV \-\-poolmetadata VG/NewThinMetaLV
.SS Automatic pool metadata LV
@@ -426,18 +428,20 @@ A thin data LV can be converted to a thin pool LV without
specifying a thin pool metadata LV. LVM will automatically
create a metadata LV from the same VG.
-.nf
-lvcreate \-n ThinDataLV \-L LargeSize VG
-lvconvert \-\-thinpool VG/ThinDataLV
+.B lvcreate \-n ThinDataLV \-L LargeSize VG
+.br
+.B lvconvert \-\-thinpool VG/ThinDataLV
-Example
+.I Example
+.br
+.nf
# lvcreate \-n pool0 \-L 10G vg
# lvconvert \-\-thinpool vg/pool0
# lvs \-a
-pool0 vg twi-a-tz-- 10.00g
-[pool0_tdata] vg Twi-ao---- 10.00g
-[pool0_tmeta] vg ewi-ao---- 16.00m
+ pool0 vg twi-a-tz-- 10.00g
+ [pool0_tdata] vg Twi-ao---- 10.00g
+ [pool0_tmeta] vg ewi-ao---- 16.00m
.fi
@@ -451,8 +455,8 @@ displayed by lvs:
.nf
# lvs vg/thin1s1
-LV VG Attr LSize Pool Origin
-thin1s1 vg Vwi---tz-k 1.00t pool0 thin1
+ LV VG Attr LSize Pool Origin
+ thin1s1 vg Vwi---tz-k 1.00t pool0 thin1
.fi
This flag causes the snapshot LV to be skipped, i.e. not activated,
@@ -464,9 +468,8 @@ the \-K (or \-\-ignoreactivationskip) option in addition to the
standard \-ay (or \-\-activate y) option.
Command to activate a thin snapshot LV:
-.nf
-lvchange \-ay \-K VG/SnapLV
-.fi
+.br
+.B lvchange \-ay \-K VG/SnapLV
The persistent "activation skip" flag can be turned off during
lvcreate, or later with lvchange using the \-kn
@@ -478,14 +481,12 @@ commands will activate the LV, and the \-K activation option is
not needed.
Command to create snapshot LV without the activation skip flag:
-.nf
-lvcreate \-\-type thin \-n SnapLV \-kn \-s ThinLV \-\-thinpool VG/ThinPoolLV
-.fi
+.br
+.B lvcreate \-kn \-n SnapLV \-s VG/ThinLV
Command to remove the activation skip flag from a snapshot LV:
-.nf
-lvchange \-kn VG/SnapLV
-.fi
+.br
+.B lvchange \-kn VG/SnapLV
.BR lvm.conf (5)
.B auto_set_activation_skip
@@ -518,24 +519,25 @@ The available free space in a thin pool LV can be displayed
with the lvs command. Free space can be added by extending
the thin pool LV.
-.nf
Command to extend thin pool data space:
-lvextend \-L Size VG/ThinPoolLV
-
-Example
+.br
+.B lvextend \-L Size VG/ThinPoolLV
+.I Example
+.br
+.nf
1. A thin pool LV is using 26.96% of its data blocks.
# lvs
-LV VG Attr LSize Pool Origin Data%
-pool0 vg twi-a-tz-- 10.00g 26.96
+ LV VG Attr LSize Pool Origin Data%
+ pool0 vg twi-a-tz-- 10.00g 26.96
2. Double the amount of physical space in the thin pool LV.
# lvextend \-L+10G vg/pool0
3. The percentage of used data blocks is half the previous value.
# lvs
-LV VG Attr LSize Pool Origin Data%
-pool0 vg twi-a-tz-- 20.00g 13.48
+ LV VG Attr LSize Pool Origin Data%
+ pool0 vg twi-a-tz-- 20.00g 13.48
.fi
Other methods of increasing free data space in a thin pool LV
@@ -551,26 +553,25 @@ The available metadata space in a thin pool LV can be displayed
with the lvs \-o+metadata_percent command.
Command to extend thin pool metadata space:
-.nf
-lvextend \-L Size VG/ThinPoolLV_tmeta
-.fi
-
-Example
+.br
+.B lvextend \-L Size VG/ThinPoolLV_tmeta
+.I Example
+.br
1. A thin pool LV is using 12.40% of its metadata blocks.
.nf
# lvs \-oname,size,data_percent,metadata_percent vg/pool0
-LV LSize Data% Meta%
-pool0 20.00g 13.48 12.40
+ LV LSize Data% Meta%
+ pool0 20.00g 13.48 12.40
.fi
2. Display a thin pool LV with its component thin data LV and thin metadata LV.
.nf
# lvs \-a \-oname,attr,size vg
-LV Attr LSize
-pool0 twi-a-tz-- 20.00g
-[pool0_tdata] Twi-ao---- 20.00g
-[pool0_tmeta] ewi-ao---- 12.00m
+ LV Attr LSize
+ pool0 twi-a-tz-- 20.00g
+ [pool0_tdata] Twi-ao---- 20.00g
+ [pool0_tmeta] ewi-ao---- 12.00m
.fi
3. Double the amount of physical space in the thin metadata LV.
@@ -581,10 +582,10 @@ pool0 twi-a-tz-- 20.00g
4. The percentage of used metadata blocks is half the previous value.
.nf
# lvs \-a \-oname,size,data_percent,metadata_percent vg
-LV LSize Data% Meta%
-pool0 20.00g 13.48 6.20
-[pool0_tdata] 20.00g
-[pool0_tmeta] 24.00m
+ LV LSize Data% Meta%
+ pool0 20.00g 13.48 6.20
+ [pool0_tdata] 20.00g
+ [pool0_tmeta] 24.00m
.fi
@@ -598,8 +599,8 @@ the fstrim command can return space back to the thin pool that had
been used by removed files. fstrim uses discards and will not work
if the thin pool LV has discards mode set to ignore.
-Example
-
+.I Example
+.br
A thin pool has 10G of physical data space, and a thin LV has a virtual
size of 100G. Writing a 1G file to the file system reduces the
free space in the thin pool by 10% and increases the virtual usage
@@ -658,9 +659,7 @@ LVs.
Command to enable or disable the monitoring and automatic extension
of an existing thin pool LV:
-.nf
-lvchange \-\-monitor {y|n} VG/ThinPoolLV
-.fi
+.B lvchange \-\-monitor {y|n} VG/ThinPoolLV
.BR lvm.conf (5)
.B thin_pool_autoextend_threshold thin_pool_autoextend_percent
@@ -679,8 +678,8 @@ be added to the thin pool, in percent of its current size.
Warnings are emitted through syslog when the use of a pool reaches 80%,
85%, 90% and 95%.
-Example
-
+.I Example
+.br
If thin_pool_autoextend_threshold is 70 and thin_pool_autoextend_percent is 20,
whenever a pool exceeds 70% usage, it will be extended by another 20%.
For a 1G pool, using 700M will trigger a resize to 1.2G. When the usage exceeds
@@ -699,8 +698,8 @@ the thin pool LV:
.nf
# lvs vg/pool0
-LV VG Attr LSize Pool Origin Data%
-pool0 vg twi-a-tz-- 512.00m 100.00
+ LV VG Attr LSize Pool Origin Data%
+ pool0 vg twi-a-tz-- 512.00m 100.00
.fi
A thin pool can run out of data blocks for any of the following reasons:
@@ -735,8 +734,8 @@ for the thin pool LV:
.nf
# lvs \-o lv_name,size,data_percent,metadata_percent vg/pool0
-LV LSize Data% Meta%
-pool0 100.00
+ LV LSize Data% Meta%
+ pool0 100.00
.fi
The same reasons for thin pool data space exhaustion apply to thin pool
@@ -769,14 +768,12 @@ indicated by the "z" attribute displayed by lvs. The option \-Z
(or \-\-zero) can be added to commands to specify the zeroing mode.
Command to set the zeroing mode when creating a thin pool LV:
-.nf
-lvconvert \-Z{y|n} \-\-thinpool VG/ThinDataLV \-\-poolmetadata VG/ThinMetaLV
-.fi
+.br
+.B lvconvert \-Z{y|n} \-\-thinpool VG/ThinDataLV \-\-poolmetadata VG/ThinMetaLV
Command to change the zeroing mode of an existing thin pool LV:
-.nf
-lvchange \-Z{y|n} VG/ThinPoolLV
-.fi
+.br
+.B lvchange \-Z{y|n} VG/ThinPoolLV
If zeroing mode is changed from "n" to "y", previously provisioned
blocks are not zeroed.
@@ -808,23 +805,22 @@ pass the discards down the the underlying device. This is the default
mode.
Command to display the current discard mode of a thin pool LV:
-.nf
-lvs \-o+discards VG/ThinPoolLV
-.fi
+.br
+.B lvs \-o+discards VG/ThinPoolLV
Command to set the discard mode when creating a thin pool LV:
-.nf
-lvconvert \-\-discards {ignore|nopassdown|passdown}
- \-\-thinpool VG/ThinDataLV \-\-poolmetadata VG/ThinMetaLV
-.fi
+.br
+.B lvconvert \-\-discards {ignore|nopassdown|passdown}
+.br
+.B " " \-\-thinpool VG/ThinDataLV \-\-poolmetadata VG/ThinMetaLV
Command to change the discard mode of an existing thin pool LV:
-.nf
-lvchange \-\-discards {ignore|nopassdown|passdown} VG/ThinPoolLV
-.fi
+.br
+.B lvchange \-\-discards {ignore|nopassdown|passdown} VG/ThinPoolLV
+.I Example
+.br
.nf
-Example
# lvs \-o name,discards vg/pool0
pool0 passdown
@@ -851,12 +847,14 @@ a larger value is optimal. To optimize for a lot of snapshotting,
a smaller value reduces copying time and consumes less space.
Command to display the thin pool LV chunk size:
-.nf
-lvs \-o+chunksize VG/ThinPoolLV
+.br
+.B lvs \-o+chunksize VG/ThinPoolLV
-Example
+.I Example
+.br
+.nf
# lvs \-o name,chunksize
-pool0 64.00k
+ pool0 64.00k
.fi
.BR lvm.conf (5)
@@ -895,19 +893,19 @@ to take thin snapshots of external, read only LVs. Writes to the
snapshot are stored in the thin pool, and the external LV is used
to read unwritten parts of the thin snapshot.
-.nf
-lvcreate \-\-type thin \-n SnapLV \-s VG/ExternalOriginLV
- \-\-thinpool VG/ThinPoolLV
+.B lvcreate \-n SnapLV \-s VG/ExternalOriginLV \-\-thinpool VG/ThinPoolLV
-Example
+.I Example
+.br
+.nf
# lvchange \-an vg/lve
# lvchange \-\-permission r vg/lve
-# lvcreate \-\-type thin \-n snaplve \-s vg/lve \-\-thinpool vg/pool0
+# lvcreate \-n snaplve \-s vg/lve \-\-thinpool vg/pool0
# lvs vg/lve vg/snaplve
-LV VG Attr LSize Pool Origin Data%
-lve vg ori------- 10.00g
-snaplve vg Vwi-a-tz-- 10.00g pool0 lve 0.00
+ LV VG Attr LSize Pool Origin Data%
+ lve vg ori------- 10.00g
+ snaplve vg Vwi-a-tz-- 10.00g pool0 lve 0.00
.fi
@@ -927,23 +925,25 @@ Convert ExampleLV into a read only external LV with the new name
NewExternalOriginLV, and create a new thin LV that is given the previous
name of ExampleLV.
-.nf
-lvconvert \-\-type thin \-\-thinpool VG/ThinPoolLV
- \-\-originname NewExternalOriginLV \-\-thin VG/ExampleLV
+.B lvconvert \-\-type thin \-\-thinpool VG/ThinPoolLV
+.br
+.B " " \-\-originname NewExternalOriginLV \-\-thin VG/ExampleLV
-Example
+.I Example
+.br
+.nf
# lvcreate \-n lv_example \-L 10G vg
# lvs
-lv_example vg -wi-a----- 10.00g
+ lv_example vg -wi-a----- 10.00g
# lvconvert \-\-type thin \-\-thinpool vg/pool0
\-\-originname lv_external \-\-thin vg/lv_example
# lvs
-LV VG Attr LSize Pool Origin
-lv_example vg Vwi-a-tz-- 10.00g pool0 lv_external
-lv_external vg ori------- 10.00g
+ LV VG Attr LSize Pool Origin
+ lv_example vg Vwi-a-tz-- 10.00g pool0 lv_external
+ lv_external vg ori------- 10.00g
.fi
@@ -956,20 +956,21 @@ rather than using lvconvert on existing LVs.
This one command creates a thin data LV, a thin metadata LV,
and combines the two into a thin pool LV.
-.nf
-lvcreate \-L LargeSize \-\-thinpool VG/ThinPoolLV
+.B lvcreate \-L LargeSize \-\-thinpool VG/ThinPoolLV
-Example
+.I Example
+.br
+.nf
# lvcreate \-L8M \-\-thinpool vg/pool0
# lvs vg/pool0
-LV VG Attr LSize Pool Origin Data%
-pool0 vg twi-a-tz-- 8.00m 0.00
+ LV VG Attr LSize Pool Origin Data%
+ pool0 vg twi-a-tz-- 8.00m 0.00
# lvs \-a
-pool0 vg twi-a-tz-- 8.00m
-[pool0_tdata] vg Twi-ao---- 8.00m
-[pool0_tmeta] vg ewi-ao---- 8.00m
+ pool0 vg twi-a-tz-- 8.00m
+ [pool0_tdata] vg Twi-ao---- 8.00m
+ [pool0_tmeta] vg ewi-ao---- 8.00m
.fi
@@ -986,21 +987,24 @@ and creates a thin LV in the new pool.
.br
\-V VirtualSize specifies the virtual size of the thin LV.
-.nf
-lvcreate \-L LargeSize \-V VirtualSize \-n ThinLV \-\-thinpool VG/ThinPoolLV
+.B lvcreate \-L LargeSize \-V VirtualSize \-n ThinLV \-\-thinpool VG/ThinPoolLV
Equivalent to:
-lvcreate \-L LargeSize \-\-thinpool VG/ThinPoolLV
-lvcreate \-\-type thin \-n ThinLV \-V VirtualSize \-\-thinpool VG/ThinPoolLV
+.br
+.B lvcreate \-L LargeSize \-\-thinpool VG/ThinPoolLV
+.br
+.B lvcreate \-n ThinLV \-V VirtualSize \-\-thinpool VG/ThinPoolLV
-Example
+.I Example
+.br
+.nf
# lvcreate \-L8M \-V2G \-n thin1 \-\-thinpool vg/pool0
# lvs \-a
-pool0 vg twi-a-tz-- 8.00m
-[pool0_tdata] vg Twi-ao---- 8.00m
-[pool0_tmeta] vg ewi-ao---- 8.00m
-thin1 vg Vwi-a-tz-- 2.00g pool0
+ pool0 vg twi-a-tz-- 8.00m
+ [pool0_tdata] vg Twi-ao---- 8.00m
+ [pool0_tmeta] vg ewi-ao---- 8.00m
+ thin1 vg Vwi-a-tz-- 2.00g pool0
.fi
@@ -1018,34 +1022,35 @@ LVs are open, e.g. mounted. If a merge is initiated while the LVs are open,
the effect of the merge is delayed until the origin thin LV is next
activated.
-.nf
-lvconvert \-\-merge VG/SnapLV
+.B lvconvert \-\-merge VG/SnapLV
-Example
+.I Example
+.br
+.nf
# lvs vg
-LV VG Attr LSize Pool Origin
-pool0 vg twi-a-tz-- 10.00g
-thin1 vg Vwi-a-tz-- 100.00g pool0
-thin1s1 vg Vwi-a-tz-k 100.00g pool0 thin1
+ LV VG Attr LSize Pool Origin
+ pool0 vg twi-a-tz-- 10.00g
+ thin1 vg Vwi-a-tz-- 100.00g pool0
+ thin1s1 vg Vwi-a-tz-k 100.00g pool0 thin1
# lvconvert \-\-merge vg/thin1s1
# lvs vg
-LV VG Attr LSize Pool Origin
-pool0 vg twi-a-tz-- 10.00g
-thin1 vg Vwi-a-tz-- 100.00g pool0
+ LV VG Attr LSize Pool Origin
+ pool0 vg twi-a-tz-- 10.00g
+ thin1 vg Vwi-a-tz-- 100.00g pool0
.fi
+.I Example
+.br
.nf
-Example
-
Delayed merging of open LVs.
# lvs vg
-LV VG Attr LSize Pool Origin
-pool0 vg twi-a-tz-- 10.00g
-thin1 vg Vwi-aotz-- 100.00g pool0
-thin1s1 vg Vwi-aotz-k 100.00g pool0 thin1
+ LV VG Attr LSize Pool Origin
+ pool0 vg twi-a-tz-- 10.00g
+ thin1 vg Vwi-aotz-- 100.00g pool0
+ thin1s1 vg Vwi-aotz-k 100.00g pool0 thin1
# df
/dev/mapper/vg-thin1 100G 33M 100G 1% /mnt/X
@@ -1065,12 +1070,12 @@ Merging of thin snapshot thin1s1 will occur on next activation.
# umount /mnt/Xs
# lvs \-a vg
-LV VG Attr LSize Pool Origin
-pool0 vg twi-a-tz-- 10.00g
-[pool0_tdata] vg Twi-ao---- 10.00g
-[pool0_tmeta] vg ewi-ao---- 1.00g
-thin1 vg Owi-a-tz-- 100.00g pool0
-[thin1s1] vg Swi-a-tz-k 100.00g pool0 thin1
+ LV VG Attr LSize Pool Origin
+ pool0 vg twi-a-tz-- 10.00g
+ [pool0_tdata] vg Twi-ao---- 10.00g
+ [pool0_tmeta] vg ewi-ao---- 1.00g
+ thin1 vg Owi-a-tz-- 100.00g pool0
+ [thin1s1] vg Swi-a-tz-k 100.00g pool0 thin1
# lvchange \-an vg/thin1
# lvchange \-ay vg/thin1
8 years, 9 months
master - cleanup: use insert_layer_for_lv implicit rename
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=597de5c807c4d5...
Commit: 597de5c807c4d5bdd7070359cb62222f454ec1f0
Parent: e6a4cc9c316ce7c86e664c4dea2192433ff9bab4
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jun 18 14:58:09 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Jun 18 15:00:18 2014 +0200
cleanup: use insert_layer_for_lv implicit rename
There is implicit rename for certain layered device.
Do it now for _tdata, _cdata and _corig.
TODO: use better API here...
---
lib/metadata/cache_manip.c | 17 -----------------
lib/metadata/lv_manip.c | 15 +++++++++------
2 files changed, 9 insertions(+), 23 deletions(-)
diff --git a/lib/metadata/cache_manip.c b/lib/metadata/cache_manip.c
index 456bc86..6a0f0f6 100644
--- a/lib/metadata/cache_manip.c
+++ b/lib/metadata/cache_manip.c
@@ -91,8 +91,6 @@ struct logical_volume *lv_cache_create(struct logical_volume *pool,
struct cmd_context *cmd = pool->vg->cmd;
struct logical_volume *cache_lv;
struct lv_segment *seg;
- int origin_name_len = strlen(origin->name);
- char origin_name[origin_name_len + 7]; /* + "_corig" and NULL */
if (!lv_is_cache_pool(pool)) {
log_error(INTERNAL_ERROR
@@ -124,21 +122,6 @@ struct logical_volume *lv_cache_create(struct logical_volume *pool,
if (!(segtype = get_segtype_from_string(cmd, "cache")))
return_NULL;
- /*
- * insert_layer_for_lv does not rename the sub-LVs when adding
- * the suffix. So, we rename everything here and then change
- * only the top-level LV back before adding the layer.
- */
- sprintf(origin_name, "%s_corig", origin->name);
- if (!lv_rename_update(cmd, origin, origin_name, 0)) {
- log_error("Failed to rename origin LV, %s", origin->name);
- return NULL;
- }
-
- origin_name[origin_name_len] = '\0';
- if (!(origin->name = dm_pool_strdup(origin->vg->vgmem, origin_name)))
- return_0;
-
cache_lv = origin;
if (!(origin = insert_layer_for_lv(cmd, cache_lv, CACHE, "_corig")))
return_NULL;
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index b05f6cc..44f94f4 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -5384,6 +5384,7 @@ struct logical_volume *insert_layer_for_lv(struct cmd_context *cmd,
uint64_t status,
const char *layer_suffix)
{
+ static char _suffixes[][8] = { "_tdata", "_cdata", "_corig" };
int r;
char *name;
size_t len;
@@ -5493,12 +5494,14 @@ struct logical_volume *insert_layer_for_lv(struct cmd_context *cmd,
* currently supported only for thin data layer
* FIXME: without strcmp it breaks mirrors....
*/
- if (strcmp(layer_suffix, "_tdata") == 0) {
- lv_names.old = lv_where->name;
- lv_names.new = layer_lv->name;
- if (!for_each_sub_lv(layer_lv, _rename_cb, (void *) &lv_names))
- return 0;
- }
+ for (r = 0; r < DM_ARRAY_SIZE(_suffixes); ++r)
+ if (strcmp(layer_suffix, _suffixes[r]) == 0) {
+ lv_names.old = lv_where->name;
+ lv_names.new = layer_lv->name;
+ if (!for_each_sub_lv(layer_lv, _rename_cb, (void *) &lv_names))
+ return 0;
+ break;
+ }
return layer_lv;
}
8 years, 9 months
master - lvconvert: print warning when not convert thinpool
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e6a4cc9c316ce7...
Commit: e6a4cc9c316ce7c86e664c4dea2192433ff9bab4
Parent: 21964f47d5e30d925cd8e80b6402f1a2c69ad673
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jun 18 14:18:13 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Jun 18 15:00:18 2014 +0200
lvconvert: print warning when not convert thinpool
Warning about destruction should not be printed,
When we are converting already existing pool
(improving original in-release commit bbf4b2c1c9d)
---
tools/lvconvert.c | 32 +++++++++++++++++---------------
1 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index e857a70..a2e02d4 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -2708,22 +2708,24 @@ static int _lvconvert_to_pool(struct cmd_context *cmd,
return 0;
}
- if (lv_is_thin_pool(pool_lv) && pool_is_active(pool_lv)) {
+ if (lv_is_thin_pool(pool_lv)) {
+ if (pool_is_active(pool_lv)) {
/* If any thin volume is also active - abort here */
- log_error("Cannot convert pool %s/%s with active thin volumes.",
- pool_lv->vg->name, pool_lv->name);
- return 0;
- }
-
- log_warn("WARNING: Converting \"%s/%s\" logical volume to pool's data volume.",
- pool_lv->vg->name, pool_lv->name);
- log_warn("THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)");
+ log_error("Cannot convert pool %s/%s with active thin volumes.",
+ pool_lv->vg->name, pool_lv->name);
+ return 0;
+ }
+ } else {
+ log_warn("WARNING: Converting \"%s/%s\" logical volume to pool's data volume.",
+ pool_lv->vg->name, pool_lv->name);
+ log_warn("THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)");
- if (!lp->yes &&
- yes_no_prompt("Do you really want to convert \"%s/%s\"? [y/n]: ",
- pool_lv->vg->name, pool_lv->name) == 'n') {
- log_error("Conversion aborted.");
- return 0;
+ if (!lp->yes &&
+ yes_no_prompt("Do you really want to convert \"%s/%s\"? [y/n]: ",
+ pool_lv->vg->name, pool_lv->name) == 'n') {
+ log_error("Conversion aborted.");
+ return 0;
+ }
}
if ((dm_snprintf(metadata_name, sizeof(metadata_name), "%s%s",
8 years, 9 months
master - compilation: fix warnings: build_dm_uuid now accepts whole struct logical_volume, not lvid
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=21964f47d5e30d...
Commit: 21964f47d5e30d925cd8e80b6402f1a2c69ad673
Parent: fc6e2a703b604ea5c69f7ea2e00a871c70514b73
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Jun 18 14:43:13 2014 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Jun 18 14:43:13 2014 +0200
compilation: fix warnings: build_dm_uuid now accepts whole struct logical_volume, not lvid
replicator/replicator.c:338:2: warning: passing argument 2 of 'build_dm_uuid' from incompatible pointer type [enabled by default]
replicator/replicator.c:629:3: warning: passing argument 2 of 'build_dm_uuid' from incompatible pointer type [enabled by default]
replicator/replicator.c:644:6: warning: passing argument 2 of 'build_dm_uuid' from incompatible pointer type [enabled by default]
replicator/replicator.c:668:7: warning: passing argument 2 of 'build_dm_uuid' from incompatible pointer type [enabled by default]
replicator/replicator.c:677:4: warning: passing argument 2 of 'build_dm_uuid' from incompatible pointer type [enabled by default]
---
lib/replicator/replicator.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/replicator/replicator.c b/lib/replicator/replicator.c
index 6a116d2..2e3632a 100644
--- a/lib/replicator/replicator.c
+++ b/lib/replicator/replicator.c
@@ -335,7 +335,7 @@ static int _replicator_add_target_line(struct dev_manager *dm,
if (!seg->rlog_lv)
return_0;
- if (!(rlog_dlid = build_dm_uuid(mem, seg->rlog_lv->lvid.s, NULL)))
+ if (!(rlog_dlid = build_dm_uuid(mem, seg->rlog_lv, NULL)))
return_0;
dm_list_iterate_items(rsite, &seg->lv->rsites) {
@@ -626,7 +626,7 @@ static int _replicator_dev_add_target_line(struct dev_manager *dm,
cmd->use_linear_target,
seg->lv->vg->name, seg->lv->name))
return_0;
- if (!(rdev_dlid = build_dm_uuid(mem, seg->lv->rdevice->lv->lvid.s, NULL)))
+ if (!(rdev_dlid = build_dm_uuid(mem, seg->lv->rdevice->lv, NULL)))
return_0;
return dm_tree_node_add_target_area(node, NULL, rdev_dlid, 0);
} else if (seg->lv->rdevice->rsite->site_index) {
@@ -641,7 +641,7 @@ static int _replicator_dev_add_target_line(struct dev_manager *dm,
* must be present in dm_tree
*/
if (!seg_is_replicator_dev(seg) ||
- !(replicator_dlid = build_dm_uuid(mem, seg->replicator->lvid.s, NULL)))
+ !(replicator_dlid = build_dm_uuid(mem, seg->replicator, NULL)))
return_0;
/* Select remote devices with the same device index */
@@ -665,7 +665,7 @@ static int _replicator_dev_add_target_line(struct dev_manager *dm,
}
if (!rdev->lv ||
- !(rdev_dlid = build_dm_uuid(mem, rdev->lv->lvid.s, NULL)))
+ !(rdev_dlid = build_dm_uuid(mem, rdev->lv, NULL)))
return_0;
slog_dlid = NULL;
@@ -674,7 +674,7 @@ static int _replicator_dev_add_target_line(struct dev_manager *dm,
if (rdev->slog) {
slog_flags = DM_NOSYNC;
slog_size = (uint32_t) rdev->slog->size;
- if (!(slog_dlid = build_dm_uuid(mem, rdev->slog->lvid.s, NULL)))
+ if (!(slog_dlid = build_dm_uuid(mem, rdev->slog, NULL)))
return_0;
} else if (rdev->slog_name &&
sscanf(rdev->slog_name, "%" PRIu32, &slog_size) == 1) {
8 years, 9 months
master - man: add man page entry for dmsetup info -c -S/--select + minor cleanups
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=fc6e2a703b604e...
Commit: fc6e2a703b604ea5c69f7ea2e00a871c70514b73
Parent: 0548a82e630dc0bf24943ec49a15b86834268b57
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Jun 18 13:48:27 2014 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Jun 18 13:48:27 2014 +0200
man: add man page entry for dmsetup info -c -S/--select + minor cleanups
---
man/dmsetup.8.in | 12 ++++++++++++
man/lvs.8.in | 8 ++++----
man/pvs.8.in | 8 ++++----
man/vgs.8.in | 8 ++++----
4 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/man/dmsetup.8.in b/man/dmsetup.8.in
index 10c63ab..b545dcf 100644
--- a/man/dmsetup.8.in
+++ b/man/dmsetup.8.in
@@ -40,6 +40,8 @@ dmsetup \(em low level logical volume management
.IR fields ]
.RB [ \-O | \-\-sort
.IR sort_fields ]
+.RB [ \-S | \-\-select
+.IR Selection ]
.RI [ device_name ]
.RE
.br
@@ -244,6 +246,16 @@ The value \fInone\fP is equivalent to specifying zero.
.BR \-r | \-\-readonly
Set the table being loaded read-only.
.TP
+.BR \-S | \-\-select \ \fISelection
+Display only rows that match Selection criteria. All rows are displayed
+with the additional "selected" column (-o selected) showing 1 if the row
+matches the Selection and 0 otherwise. The Selection criteria are defined
+by specifying column names and their valid values while making use of
+supported comparison operators. As a quick help and to see full list of
+column names that can be used in Selection and the set of supported
+selection operators, check the output of \fBdmsetup info -c -S help\fP
+command.
+.TP
.IR \fB\-\-table \ < table >
Specify a one-line table directly on the command line.
.TP
diff --git a/man/lvs.8.in b/man/lvs.8.in
index 371aaf6..1afd63d 100644
--- a/man/lvs.8.in
+++ b/man/lvs.8.in
@@ -198,14 +198,14 @@ selection. Precede any column with '\fI\-\fP' for a reverse sort on that column.
Output columns as rows.
.TP
.BR \-S ", " \-\-select " " \fISelection
-Display only rows that match selection criteria. All rows are displayed with
+Display only rows that match Selection criteria. All rows are displayed with
the additional "selected" column (\fB-o selected\fP) showing 1 if the row
-matches the Selection and 0 otherwise. The selection criteria are defined
+matches the Selection and 0 otherwise. The Selection criteria are defined
by specifying column names and their valid values (that can include reserved
values) while making use of supported comparison operators. See \fBlvm\fP(8)
and \fB\-S\fP, \fB\-\-select\fP description for more detailed information
-about constructing the selection criteria. As a quick help and to see full
-list of columns names that can be used in selection including the list of
+about constructing the Selection criteria. As a quick help and to see full
+list of column names that can be used in Selection including the list of
reserved values and the set of supported selection operators, check the
output of \fBlvs -S help\fP command.
.TP
diff --git a/man/pvs.8.in b/man/pvs.8.in
index ea32d78..ccd84a5 100644
--- a/man/pvs.8.in
+++ b/man/pvs.8.in
@@ -82,14 +82,14 @@ Physical Volume, showing the start (pvseg_start) and length (pvseg_size) in
units of physical extents.
.TP
.BR \-S ", " \-\-select " " \fISelection
-Display only rows that match selection criteria. All rows are displayed with
+Display only rows that match Selection criteria. All rows are displayed with
the additional "selected" column (\fB-o selected\fP) showing 1 if the row
-matches the Selection and 0 otherwise. The selection criteria are defined
+matches the Selection and 0 otherwise. The Selection criteria are defined
by specifying column names and their valid values (that can include reserved
values) while making use of supported comparison operators. See \fBlvm\fP(8)
and \fB\-S\fP, \fB\-\-select\fP description for more detailed information
-about constructing the selection criteria. As a quick help and to see full
-list of columns names that can be used in selection including the list of
+about constructing the Selection criteria. As a quick help and to see full
+list of column names that can be used in Selection including the list of
reserved values and the set of supported selection operators, check the
output of \fBpvs -S help\fP command.
.TP
diff --git a/man/vgs.8.in b/man/vgs.8.in
index 2f71d26..2d4946f 100644
--- a/man/vgs.8.in
+++ b/man/vgs.8.in
@@ -99,14 +99,14 @@ column.
Output columns as rows.
.TP
.BR \-S ", " \-\-select " " \fISelection
-Display only rows that match selection criteria. All rows are displayed with
+Display only rows that match Selection criteria. All rows are displayed with
the additional "selected" column (\fB-o selected\fP) showing 1 if the row
-matches the Selection and 0 otherwise. The selection criteria are defined
+matches the Selection and 0 otherwise. The Selection criteria are defined
by specifying column names and their valid values (that can include reserved
values) while making use of supported comparison operators. See \fBlvm\fP(8)
and \fB\-S\fP, \fB\-\-select\fP description for more detailed information
-about constructing the selection criteria. As a quick help and to see full
-list of columns names that can be used in selection including the list of
+about constructing the Selection criteria. As a quick help and to see full
+list of column names that can be used in Selection including the list of
reserved values and the set of supported selection operators, check the
output of \fBvgs -S help\fP command.
.TP
8 years, 9 months
master - cleanup: gcc warnings and report-select test vs snap_percent 0%
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0548a82e630dc0...
Commit: 0548a82e630dc0bf24943ec49a15b86834268b57
Parent: ca1abe70ff6f6efc6bd49c648aa3e6b8fab184fd
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Jun 18 13:26:47 2014 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Jun 18 13:26:47 2014 +0200
cleanup: gcc warnings and report-select test vs snap_percent 0%
Fix gcc warnings:
libdm-report.c:1952:5: warning: "end_op_flag_hit" may be used uninitialized in this function [-Wmaybe-uninitialized]
libdm-report.c:2232:28: warning: "custom" may be used uninitialized in this function [-Wmaybe-uninitialized]
And snap_percent is not 0% in dm < 1.10.0 so
don't test comparison with 0% here.
---
libdm/libdm-report.c | 4 ++--
test/shell/report-select.sh | 6 +++++-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/libdm/libdm-report.c b/libdm/libdm-report.c
index 79b3687..867bf44 100644
--- a/libdm/libdm-report.c
+++ b/libdm/libdm-report.c
@@ -1879,7 +1879,7 @@ static const char *_tok_value_string_list(const struct dm_report_field_type *ft,
struct selection_str_list *ssl = NULL;
struct dm_str_list *item;
const char *begin_item, *end_item, *tmp;
- uint32_t end_op_flags, end_op_flag_hit;
+ uint32_t end_op_flags, end_op_flag_hit = 0;
struct dm_str_list **arr;
size_t list_size;
unsigned int i;
@@ -2400,7 +2400,7 @@ static struct selection_node *_parse_selection(struct dm_report *rh,
struct selection_str_list *str_list;
const struct dm_report_reserved_value *reserved;
uint64_t factor;
- void *custom;
+ void *custom = NULL;
char *tmp;
char c;
diff --git a/test/shell/report-select.sh b/test/shell/report-select.sh
index 8df1d27..8181cd2 100644
--- a/test/shell/report-select.sh
+++ b/test/shell/report-select.sh
@@ -150,7 +150,11 @@ lvs_sel 'size<=8m' "vol2 xyz vol1 orig snap"
###########################
# PERCENT FIELD SELECTION #
###########################
-lvs_sel 'snap_percent=0' "snap"
+if aux target_at_least dm-snapshot 1 10 0; then
+ # Test zero percent only if snapshot can be zero.
+ # Before 1.10.0, the snap percent included metadata size.
+ lvs_sel 'snap_percent=0' "snap"
+fi
dd if=/dev/zero of=$DM_DEV_DIR/$vg3/snap bs=1M count=1
lvs_sel 'snap_percent<50' "snap"
lvs_sel 'snap_percent>50'
8 years, 9 months