master - cleanup: simplify pv name size estimation
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0499e87ace3999...
Commit: 0499e87ace39997c64b33d27a65011b1b3c6cecc
Parent: 3fda296da6b992dbafeaeabeacd47fe41f78221e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 26 14:00:51 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 26 14:11:37 2014 +0100
cleanup: simplify pv name size estimation
Reuse buffer with size of 2 * PATH_MAX to handle worst case escape
and avoid extra calculation of espaced len.
---
lib/format_text/export.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/lib/format_text/export.c b/lib/format_text/export.c
index 883e076..319e5ea 100644
--- a/lib/format_text/export.c
+++ b/lib/format_text/export.c
@@ -450,8 +450,7 @@ static int _print_pvs(struct formatter *f, struct volume_group *vg)
{
struct pv_list *pvl;
struct physical_volume *pv;
- char buffer[4096];
- char *buf;
+ char buffer[PATH_MAX * 2];
const char *name;
outf(f, "physical_volumes {");
@@ -472,14 +471,13 @@ static int _print_pvs(struct formatter *f, struct volume_group *vg)
outf(f, "id = \"%s\"", buffer);
- if (!(buf = alloca(dm_escaped_len(pv_dev_name(pv))))) {
- log_error("temporary stack allocation for device name"
- "string failed");
+ if (strlen(pv_dev_name(pv)) >= PATH_MAX) {
+ log_error("pv device name size is out of bounds.");
return 0;
}
outhint(f, "device = \"%s\"",
- dm_escape_double_quotes(buf, pv_dev_name(pv)));
+ dm_escape_double_quotes(buffer, pv_dev_name(pv)));
outnl(f);
if (!_print_flag_config(f, pv->status, PV_FLAGS))
9 years
master - cleanup: lvmetad use dm_hash_iterator
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3fda296da6b992...
Commit: 3fda296da6b992dbafeaeabeacd47fe41f78221e
Parent: dae455f806dfba878e9cfb766f7415ad038d72fe
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 26 13:59:13 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 26 14:11:37 2014 +0100
cleanup: lvmetad use dm_hash_iterator
Simplify code with the use of dm_hash_iterator
---
daemons/lvmetad/lvmetad-core.c | 42 ++++++++++++---------------------------
1 files changed, 13 insertions(+), 29 deletions(-)
diff --git a/daemons/lvmetad/lvmetad-core.c b/daemons/lvmetad/lvmetad-core.c
index 1858ee2..5b23a56 100644
--- a/daemons/lvmetad/lvmetad-core.c
+++ b/daemons/lvmetad/lvmetad-core.c
@@ -57,27 +57,19 @@ static void destroy_metadata_hashes(lvmetad_state *s)
{
struct dm_hash_node *n = NULL;
- n = dm_hash_get_first(s->vgid_to_metadata);
- while (n) {
+ dm_hash_iterate(n, s->vgid_to_metadata)
dm_config_destroy(dm_hash_get_data(s->vgid_to_metadata, n));
- n = dm_hash_get_next(s->vgid_to_metadata, n);
- }
- n = dm_hash_get_first(s->pvid_to_pvmeta);
- while (n) {
+ dm_hash_iterate(n, s->pvid_to_pvmeta)
dm_config_destroy(dm_hash_get_data(s->pvid_to_pvmeta, n));
- n = dm_hash_get_next(s->pvid_to_pvmeta, n);
- }
+
dm_hash_destroy(s->pvid_to_pvmeta);
dm_hash_destroy(s->vgid_to_metadata);
dm_hash_destroy(s->vgid_to_vgname);
dm_hash_destroy(s->vgname_to_vgid);
- n = dm_hash_get_first(s->device_to_pvid);
- while (n) {
+ dm_hash_iterate(n, s->device_to_pvid)
dm_free(dm_hash_get_data(s->device_to_pvid, n));
- n = dm_hash_get_next(s->device_to_pvid, n);
- }
dm_hash_destroy(s->device_to_pvid);
dm_hash_destroy(s->pvid_to_vgid);
@@ -310,8 +302,7 @@ static response pv_list(lvmetad_state *s, request r)
lock_pvid_to_pvmeta(s);
- for (n = dm_hash_get_first(s->pvid_to_pvmeta); n;
- n = dm_hash_get_next(s->pvid_to_pvmeta, n)) {
+ dm_hash_iterate(n, s->pvid_to_pvmeta) {
id = dm_hash_get_key(s->pvid_to_pvmeta, n);
cn = make_pv_node(s, id, res.cft, cn_pvs, cn);
}
@@ -397,8 +388,7 @@ static response vg_list(lvmetad_state *s, request r)
lock_vgid_to_metadata(s);
- n = dm_hash_get_first(s->vgid_to_vgname);
- while (n) {
+ dm_hash_iterate(n, s->vgid_to_vgname) {
id = dm_hash_get_key(s->vgid_to_vgname, n),
name = dm_hash_get_data(s->vgid_to_vgname, n);
@@ -426,8 +416,6 @@ static response vg_list(lvmetad_state *s, request r)
if (!cn_vgs->child)
cn_vgs->child = cn;
cn_last = cn;
-
- n = dm_hash_get_next(s->vgid_to_vgname, n);
}
unlock_vgid_to_metadata(s);
@@ -597,8 +585,7 @@ static int update_pvid_to_vgid(lvmetad_state *s, struct dm_config_tree *vg,
DEBUGLOG(s, "moving PV %s to VG %s", pvid, vgid);
}
- for (n = dm_hash_get_first(to_check); n;
- n = dm_hash_get_next(to_check, n)) {
+ dm_hash_iterate(n, to_check) {
check_vgid = dm_hash_get_key(to_check, n);
lock_vg(s, check_vgid);
vg_remove_if_missing(s, check_vgid, 0);
@@ -1024,26 +1011,26 @@ static response vg_remove(lvmetad_state *s, request r)
static void _dump_cft(struct buffer *buf, struct dm_hash_table *ht, const char *key_addr)
{
- struct dm_hash_node *n = dm_hash_get_first(ht);
- while (n) {
+ struct dm_hash_node *n;
+
+ dm_hash_iterate(n, ht) {
struct dm_config_tree *cft = dm_hash_get_data(ht, n);
const char *key_backup = cft->root->key;
cft->root->key = dm_config_find_str(cft->root, key_addr, "unknown");
(void) dm_config_write_node(cft->root, buffer_line, buf);
cft->root->key = key_backup;
- n = dm_hash_get_next(ht, n);
}
}
static void _dump_pairs(struct buffer *buf, struct dm_hash_table *ht, const char *name, int int_key)
{
char *append;
- struct dm_hash_node *n = dm_hash_get_first(ht);
+ struct dm_hash_node *n;
buffer_append(buf, name);
buffer_append(buf, " {\n");
- while (n) {
+ dm_hash_iterate(n, ht) {
const char *key = dm_hash_get_key(ht, n),
*val = dm_hash_get_data(ht, n);
buffer_append(buf, " ");
@@ -1055,7 +1042,6 @@ static void _dump_pairs(struct buffer *buf, struct dm_hash_table *ht, const char
buffer_append(buf, append);
buffer_append(buf, "\n");
dm_free(append);
- n = dm_hash_get_next(ht, n);
}
buffer_append(buf, "}\n");
}
@@ -1201,11 +1187,9 @@ static int fini(daemon_state *s)
destroy_metadata_hashes(ls);
/* Destroy the lock hashes now. */
- n = dm_hash_get_first(ls->lock.vg);
- while (n) {
+ dm_hash_iterate(n, ls->lock.vg) {
pthread_mutex_destroy(dm_hash_get_data(ls->lock.vg, n));
free(dm_hash_get_data(ls->lock.vg, n));
- n = dm_hash_get_next(ls->lock.vg, n);
}
dm_hash_destroy(ls->lock.vg);
9 years
master - man: colorization fixes
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=dae455f806dfba...
Commit: dae455f806dfba878e9cfb766f7415ad038d72fe
Parent: bda0fe95ad66b864429ce18bb9dc6277259ba348
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 26 14:04:44 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 26 14:11:37 2014 +0100
man: colorization fixes
Fix style
---
man/lvchange.8.in | 6 +++---
man/lvconvert.8.in | 22 +++++++++++-----------
man/lvcreate.8.in | 8 ++++----
man/lvmetad.8.in | 11 ++++-------
4 files changed, 22 insertions(+), 25 deletions(-)
diff --git a/man/lvchange.8.in b/man/lvchange.8.in
index 64231c8..5de75e0 100644
--- a/man/lvchange.8.in
+++ b/man/lvchange.8.in
@@ -41,7 +41,7 @@ lvchange \- change attributes of a logical volume
.RB [ \-\-[raid]writebehind
.IR IOCount ]
.RB [ \-\-[raid]writemostly
-.IR PhysicalVolume[:{t|n|y}] ]
+.IR PhysicalVolume [ : { t | n | y }]]
.RB [ \-\-sysinit ]
.RB [ \-\-noudevsync ]
.RB [ \-M | \-\-persistent
@@ -166,7 +166,7 @@ If \fIrepair\fP is used, the discrepancies will be corrected as they are
encountered. The 'lvs' command can be used to show the number of
discrepancies found or repaired.
.TP
-.BR \-\-[raid]writebehind " IOCount"
+.BR \-\-[raid]writebehind " " \fIIOCount
Specify the maximum number of outstanding writes that are allowed to
devices in a RAID1 logical volume that are marked as \fIwrite-mostly\fP.
Once this value is exceeded, writes become synchronous (i.e. all writes
@@ -174,7 +174,7 @@ to the constituent devices must complete before the array signals the
write has completed). Setting the value to zero clears the preference
and allows the system to choose the value arbitrarily.
.TP
-.BR \-\-[raid]writemostly " PhysicalVolume[:{t|y|n}]"
+.IR \fB\-\-[raid]writemostly " " PhysicalVolume [ : { t | y | n }]
Mark a device in a RAID1 logical volume as \fIwrite-mostly\fP. All reads
to these drives will be avoided unless absolutely necessary. This keeps
the number of I/Os to the drive to a minimum. The default behavior is to
diff --git a/man/lvconvert.8.in b/man/lvconvert.8.in
index ade106d..fe6525b 100644
--- a/man/lvconvert.8.in
+++ b/man/lvconvert.8.in
@@ -91,11 +91,11 @@ lvconvert \- convert a logical volume from linear to mirror or snapshot
.IR ChunkSize [ bBsSkKmMgG ]]
.RB [ \-\-discards
.RI { ignore | nopassdown | passdown }]
-.RB [[ \-\-poolmetadata
-.IR ThinPoolMetadataLogicalVolume { Name | Path }]
+.RB [{ \-\-poolmetadata
+.IR ThinPoolMetadataLogicalVolume { Name | Path }
|
-.RB [ \-\-poolmetadatasize
-.IR ThinPoolMetadataSize [ bBsSkKmMgG ]]
+.B \-\-poolmetadatasize
+.IR ThinPoolMetadataSize [ bBsSkKmMgG ]}]
.RB [ \-r | \-\-readahead
.RI { ReadAheadSectors | auto | none }]
.RB [ \-\-stripes
@@ -113,24 +113,24 @@ lvconvert \- convert a logical volume from linear to mirror or snapshot
.RB [ \-v | \-\-verbose ]
.RB [ \-\-version ]
.sp
-.B lvconvert \-\-type cache-pool
+.B lvconvert \-\-type \fIcache-pool
.RB [ \-c | \-\-chunksize
.IR ChunkSize [ bBsSkKmMgG ]]
.RB [ \-\-cachemode
.RI { writeback | writethrough }]
-.RB [[ \-\-poolmetadata
-.IR CachePoolMetadataLogicalVolume { Name | Path }]
+.RB [{ \-\-poolmetadata
+.IR CachePoolMetadataLogicalVolume { Name | Path }
|
-.RB [ \-\-poolmetadatasize
-.IR CachePoolMetadataSize [ bBsSkKmMgG ]]
+.B \-\-poolmetadatasize
+.IR CachePoolMetadataSize [ bBsSkKmMgG ]}]
.IR LogicalVolume [ Path ]
.RI [ PhysicalVolume [ Path ][ :PE [ -PE ]]...]
.RB [ \-h | \-? | \-\-help ]
.RB [ \-v | \-\-verbose ]
.RB [ \-\-version ]
.sp
-.B lvconvert \-\-type cache
-.RB \-\-cachepool
+.B lvconvert \-\-type \fIcache
+.B \-\-cachepool
.IR CachePoolLV { Name | Path }
.IR LogicalVolume [ Path ]
.RB [ \-h | \-? | \-\-help ]
diff --git a/man/lvcreate.8.in b/man/lvcreate.8.in
index 325baad..445af80 100644
--- a/man/lvcreate.8.in
+++ b/man/lvcreate.8.in
@@ -60,7 +60,7 @@ lvcreate \- create a logical volume in an existing volume group
.RB [ \-t | \-\-test ]
.RB [ \-T | \-\-thin
.RB [ \-\-cachemode
-.IR { writeback | writethrough }
+.RI { writeback | writethrough }
.RB [ \-c | \-\-chunksize
.IR ChunkSize [ bBsSkKmMgG ]]
.RB [ \-\-discards
@@ -145,7 +145,7 @@ be overridden. If the clustered locking is enabled,
.IR \fB\-a { a | l } y
will activate only on the local node.
.TP
-.IR \fB\-k ", " \fB\-\-setactivationskip " " { y | n }
+.IR \fB\-k ", " \fB\-\-setactivationskip " {" y | n }
Controls whether Logical Volumes are persistently flagged to be skipped during
activation. By default, thin snapshot volumes are flagged for activation skip.
To activate such volumes, an extra \fB\-K/\-\-ignoreactivationskip\fP option must
@@ -155,11 +155,11 @@ detach the flag for existing volumes. To see whether the flag is attached,
use \fBlvs\fP command where the state of the flag is reported within
\fBlv_attr\fP bits.
.TP
-.IR \fB\-K ", " \fB\-\-ignoreactivationskip
+.BR \-K ", " \-\-ignoreactivationskip
Ignore the flag to skip Logical Volumes during activation.
.TP
-.BR \-\-cachemode " " { writeback | writethrough }
+.IR \fB\-\-cachemode " " { writeback | writethrough }
Specifying a cache mode determines when the writes to a cache LV
are considered complete. When \fIwriteback\fP is specified, a write is
considered complete as soon as it is stored in the cache pool LV.
diff --git a/man/lvmetad.8.in b/man/lvmetad.8.in
index 4956a3f..444c7c0 100644
--- a/man/lvmetad.8.in
+++ b/man/lvmetad.8.in
@@ -4,14 +4,11 @@ lvmetad \- LVM metadata cache daemon
.SH SYNOPSIS
.B lvmetad
.RB [ \-l
-.RI {all|wire|debug}
-.RB ]
+.RI { all | wire | debug }]
.RB [ \-p
-.RI pidfile_path
-.RB ]
+.IR pidfile_path ]
.RB [ \-s
-.RI socket_path
-.RB ]
+.IR socket_path ]
.RB [ \-f ]
.RB [ \-h ]
.RB [ \-V ]
@@ -34,7 +31,7 @@ Don't fork, but run in the foreground.
.BR \-h ", " \-?
Show help information.
.TP
-.BR \-l " {" \fIall | \fIwire | \fIdebug }
+.IR \fB\-l " {" all | wire | debug }
Select the type of log messages to generate.
Messages are logged by syslog.
Additionally, when -f is given they are also sent to standard error.
9 years
master - man: add repair info for thin pools
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=bda0fe95ad66b8...
Commit: bda0fe95ad66b864429ce18bb9dc6277259ba348
Parent: a3615f314993f4f898fb3bdc4e53f1548069698f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 26 14:04:14 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 26 14:11:36 2014 +0100
man: add repair info for thin pools
Document lvconvert --repair for thin pools.
---
man/lvconvert.8.in | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/man/lvconvert.8.in b/man/lvconvert.8.in
index 190e221..ade106d 100644
--- a/man/lvconvert.8.in
+++ b/man/lvconvert.8.in
@@ -333,14 +333,23 @@ a suitable value automatically.
"None" is equivalent to specifying zero.
.TP
.B \-\-repair
-Repair a mirror after suffering a disk failure. The mirror will be brought back
-into a consistent state. By default, the original number of mirrors will be
+Repair a mirror after suffering a disk failure or try to fix thin pool metadata.
+
+The mirror will be brought back into a consistent state.
+By default, the original number of mirrors will be
restored if possible. Specify \fB\-y\fP on the command line to skip
the prompts. Use \fB\-f\fP if you do not want any replacement.
Additionally, you may use \fB\-\-use\-policies\fP to use the device
replacement policy specified in \fBlvm.conf\fP(5),
viz. activation/mirror_log_fault_policy or
activation/mirror_device_fault_policy.
+
+Thin pool repair automates the use of \fBthin_repair\fP(8) tool.
+Only inactive thin pool volumes can be repaired.
+There is no validation of metadata between kernel and lvm2.
+This requires further manual work.
+After successfull repair the old unmodified metadata are still
+available in \fB<pool>_tmeta<n>\fP LV.
.TP
.B \-\-replace \fIPhysicalVolume
Remove the specified device (\fIPhysicalVolume\fP) and replace it with one
@@ -498,4 +507,5 @@ cache pool LV.
.BR lvscan (8),
.BR vgcreate (8),
.BR thin_dump (8),
+.BR thin_repair (8)
.BR thin_restore (8)
9 years
master - lvmetad: Fix an endless wait loop introduced in c13f5dbb.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a3615f314993f4...
Commit: a3615f314993f4f898fb3bdc4e53f1548069698f
Parent: a2614c686670559b75b01ad9893fbd9338690d9f
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Wed Mar 26 11:42:42 2014 +0100
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Wed Mar 26 11:45:28 2014 +0100
lvmetad: Fix an endless wait loop introduced in c13f5dbb.
---
lib/cache/lvmetad.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c
index 3ee850c..697660f 100644
--- a/lib/cache/lvmetad.c
+++ b/lib/cache/lvmetad.c
@@ -142,7 +142,7 @@ static daemon_reply _lvmetad_send(const char *id, ...)
daemon_reply repl;
daemon_request req;
int try = 0;
- int time = 0, wait;
+ int time = 0, wait, sleep = 1;
retry:
req = daemon_request_make(id);
@@ -172,14 +172,16 @@ retry:
* the update, we back off for a short while (0.2-2 seconds) and
* try again.
*/
- if (!strcmp(daemon_reply_str(repl, "expected", ""), "update in progress") || try % 5) {
+ if (!strcmp(daemon_reply_str(repl, "expected", ""), "update in progress") || sleep) {
wait = 50000 + random() % 450000; /* 0.05 - 0.5s */
time += wait;
usleep( wait );
+ -- sleep;
} else {
/* If the re-scan fails here, we try again later. */
lvmetad_pvscan_all_devs(_lvmetad_cmd, NULL);
++ try;
+ sleep = 5;
}
daemon_reply_destroy(repl);
goto retry;
9 years
master - tests: missed exclusive activation
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a2614c68667055...
Commit: a2614c686670559b75b01ad9893fbd9338690d9f
Parent: 5b900dbef53d18dcc9bfcf939ffe991e5ec9fbb1
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 26 00:22:23 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 26 00:22:23 2014 +0100
tests: missed exclusive activation
---
test/shell/covercmd.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/shell/covercmd.sh b/test/shell/covercmd.sh
index 54fe192..06a9082 100644
--- a/test/shell/covercmd.sh
+++ b/test/shell/covercmd.sh
@@ -27,7 +27,7 @@ pvcreate --norestorefile -u $TEST_UUID --metadatacopies 0 "$dev5"
vgcreate $vg $(cat DEVICES)
lvcreate -l 5 -i5 -I256 -n $lv $vg
-lvcreate -l 5 -n $lv1 $vg
+lvcreate -aey -l 5 -n $lv1 $vg
lvcreate -s -l 5 -n $lv2 $vg/$lv1
if aux have_readline; then
9 years
master - tests: pass list devs to allocate from
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5b900dbef53d18...
Commit: 5b900dbef53d18dcc9bfcf939ffe991e5ec9fbb1
Parent: 1259ae59540b3e9c5ef582a6e472e17258ee36dc
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Mar 25 23:56:15 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 26 00:05:46 2014 +0100
tests: pass list devs to allocate from
---
test/shell/lvconvert-repair-policy.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/shell/lvconvert-repair-policy.sh b/test/shell/lvconvert-repair-policy.sh
index cefb0ea..9d71b66 100644
--- a/test/shell/lvconvert-repair-policy.sh
+++ b/test/shell/lvconvert-repair-policy.sh
@@ -30,7 +30,7 @@ repair_() {
lvconvert --repair --use-policies --config "$1" $vg/mirror
}
-lvcreate -aey --type mirror -m 1 -L 1 -n mirror $vg
+lvcreate -aey --type mirror -m 1 --ignoremonitoring -l 2 -n mirror $vg "$dev1" "$dev2" "$dev3:0"
lvchange -a n $vg/mirror
# Fail a leg of a mirror.
9 years
master - tests: cover code from more commands
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1259ae59540b3e...
Commit: 1259ae59540b3e9c5ef582a6e472e17258ee36dc
Parent: 4b30863e857aa5a671485227c9b7a7e3a6d1e277
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Mar 25 23:55:45 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 26 00:05:46 2014 +0100
tests: cover code from more commands
---
test/shell/covercmd.sh | 36 +++++++++++++++++++++++++++++++++---
1 files changed, 33 insertions(+), 3 deletions(-)
diff --git a/test/shell/covercmd.sh b/test/shell/covercmd.sh
index ad7f480..54fe192 100644
--- a/test/shell/covercmd.sh
+++ b/test/shell/covercmd.sh
@@ -27,11 +27,14 @@ pvcreate --norestorefile -u $TEST_UUID --metadatacopies 0 "$dev5"
vgcreate $vg $(cat DEVICES)
lvcreate -l 5 -i5 -I256 -n $lv $vg
+lvcreate -l 5 -n $lv1 $vg
+lvcreate -s -l 5 -n $lv2 $vg/$lv1
+
if aux have_readline; then
# test *scan and *display tools
cat <<EOF | lvm
pvscan --uuid
-vgscan
+vgscan --mknodes
lvscan
lvmdiskscan
vgdisplay --units k $vg
@@ -39,8 +42,11 @@ lvdisplay --units g $vg
pvdisplay -c "$dev1"
pvdisplay -s "$dev1"
vgdisplay -c $vg
+vgdisplay -C $vg
vgdisplay -s $vg
lvdisplay -c $vg
+lvdisplay -C $vg
+lvdisplay -m $vg
EOF
for i in h b s k m g t p e H B S K M G T P E; do
@@ -48,7 +54,7 @@ for i in h b s k m g t p e H B S K M G T P E; do
done | lvm
else
pvscan --uuid
-vgscan
+vgscan --mknodes
lvscan
lvmdiskscan
vgdisplay --units k $vg
@@ -56,18 +62,36 @@ lvdisplay --units g $vg
pvdisplay -c "$dev1"
pvdisplay -s "$dev1"
vgdisplay -c $vg
+vgdisplay -C $vg
vgdisplay -s $vg
lvdisplay -c $vg
+lvdisplay -C $vg
+lvdisplay -m $vg
for i in h b s k m g t p e H B S K M G T P E; do
pvdisplay --units $i "$dev1"
done
fi
+not lvdisplay -C -m $vg
+not lvdisplay -c -v $vg
+not lvdisplay --aligned $vg
+not lvdisplay --noheadings $vg
+not lvdisplay --options lv_name $vg
+not lvdisplay --separator : $vg
+not lvdisplay --sort size $vg
+not lvdisplay --unbuffered $vg
+
+not vgdisplay -C -A
+not vgdisplay -C -c
+not vgdisplay -C -s
+not vgdisplay -c -s
+not vgdisplay -A $vg1
+
# "-persistent y --major 254 --minor 20"
# "-persistent n"
# test various lvm utils
-for i in dumpconfig formats segtypes; do
+for i in dumpconfig devtypes formats segtypes tags; do
lvm $i
done
@@ -88,8 +112,12 @@ pvcreate -u $TEST_UUID --restorefile backup.$$ "$dev5"
vgremove -f $vg
# test pvresize functionality
+# missing params
not pvresize
+# negative size
not pvresize --setphysicalvolumesize -10M "$dev1"
+# not existing device
+not pvresize --setphysicalvolumesize 10M "$dev7"
pvresize --setphysicalvolumesize 10M "$dev1"
pvresize "$dev1"
@@ -98,6 +126,8 @@ not lvmchange
not lvrename $vg
not lvrename $vg-xxx
not lvrename $vg $vg/$lv-rename $vg/$lv
+not lvscan $vg
+not vgscan $vg
#test vgdisplay -A to select only active VGs
# all LVs active - VG considered active
9 years
master - tests: check forced backup
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4b30863e857aa5...
Commit: 4b30863e857aa5a671485227c9b7a7e3a6d1e277
Parent: 4adbb85c372b1030b67749f7f208132a2cc06a7f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Mar 25 23:55:04 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 26 00:05:46 2014 +0100
tests: check forced backup
---
test/shell/vgcfgbackup-usage.sh | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/test/shell/vgcfgbackup-usage.sh b/test/shell/vgcfgbackup-usage.sh
index 314ecdd..3d955b5 100644
--- a/test/shell/vgcfgbackup-usage.sh
+++ b/test/shell/vgcfgbackup-usage.sh
@@ -13,11 +13,22 @@
aux prepare_pvs 4
+# No automatic backup
+aux lvmconf "backup/backup = 0"
+
# vgcfgbackup handles similar VG names (bz458941)
vg1=${PREFIX}vg00
vg2=${PREFIX}vg01
vgcreate $vg1 "$dev1"
vgcreate $vg2 "$dev2"
+
+# Enforces system backup
+test ! -e etc/backup/$vg1
+test ! -e etc/backup/$vg2
+vgcfgbackup
+test -e etc/backup/$vg1
+test -e etc/backup/$vg2
+
vgcfgbackup -f bak-%s >out
grep "Volume group \"$vg1\" successfully backed up." out
grep "Volume group \"$vg2\" successfully backed up." out
9 years
master - tests: disable test for broken kernel raid targe
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4adbb85c372b10...
Commit: 4adbb85c372b1030b67749f7f208132a2cc06a7f
Parent: fb471a372dd8b5e750e8001304657eefa355ce6e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Mar 25 23:56:46 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 26 00:04:59 2014 +0100
tests: disable test for broken kernel raid targe
Since using raid5 - validate it's usable on the system
---
test/shell/lvconvert-repair-raid.sh | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvconvert-repair-raid.sh b/test/shell/lvconvert-repair-raid.sh
index 71c84c1..bc5483b 100644
--- a/test/shell/lvconvert-repair-raid.sh
+++ b/test/shell/lvconvert-repair-raid.sh
@@ -11,6 +11,7 @@
. lib/test
+aux raid456_replace_works || skip
aux target_at_least dm-raid 1 1 0 || skip
aux lvmconf 'allocation/maximise_cling = 0'
9 years