master - toollib: fix ignored_mdas process_each_pv rescan
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1d0a2b919fe173...
Commit: 1d0a2b919fe173e3a25e5f19d535588bb5b214e2
Parent: d84e1ae5f2de569db06293aac371ce7dde1cfd62
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Fri Jun 29 21:22:09 2012 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Fri Jun 29 21:22:09 2012 +0100
toollib: fix ignored_mdas process_each_pv rescan
In process_each_pv() if we haven't yet scanned and the PV appears
to be an orphan, we must scan the other PVs looking for mdas that
reference it to find out what VG it is in.
1. If the PV has no mdas, we must scan.
2. If the PV has an mda that is not ignored we do not need to scan.
3. If the PV has an mda that is ignored, we do need to scan.
This patch fixes case 3.
> pvs -o +mda_count,vg_mda_count /dev/loop[0123]
PV VG Fmt Attr PSize PFree #PMda #VMda
/dev/loop0 vg3 lvm2 a- 96.00m 96.00m 0 1
/dev/loop1 vg3 lvm2 a- 96.00m 96.00m 1 1
/dev/loop2 vg2 lvm2 a- 96.00m 96.00m 1 2
/dev/loop3 vg2 lvm2 a- 28.00m 28.00m 1 2
Before:
> pvs /dev/loop2 /dev/loop3 /dev/loop0 /dev/loop1 --unbuffered
PV VG Fmt Attr PSize PFree
/dev/loop2 lvm2 a-- 100.00m 100.00m
/dev/loop3 vg2 lvm2 a-- 28.00m 28.00m
/dev/loop0 lvm2 a-- 100.00m 100.00m
/dev/loop1 vg3 lvm2 a-- 96.00m 96.00m
After:
> pvs /dev/loop2 /dev/loop3 /dev/loop0 /dev/loop1 --unbuffered
PV VG Fmt Attr PSize PFree
/dev/loop2 vg2 lvm2 a-- 96.00m 96.00m
/dev/loop3 vg2 lvm2 a-- 28.00m 28.00m
/dev/loop0 vg3 lvm2 a-- 96.00m 96.00m
/dev/loop1 vg3 lvm2 a-- 96.00m 96.00m
---
WHATS_NEW | 1 +
tools/toollib.c | 3 +--
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index d19df2d..2e649b1 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.97 -
===============================
+ Fix test for PV with unknown VG in process_each_pv to ignore ignored mdas.
Update man pages with --activate ay option and auto_activation_volume_list.
Fix _alloc_parallel_area to avoid picking already-full areas for raid devices.
Use vgchange -aay instead of vgchange -ay in clmvd init script.
diff --git a/tools/toollib.c b/tools/toollib.c
index 142de55..0f6810b 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -770,8 +770,7 @@ int process_each_pv(struct cmd_context *cmd, int argc, char **argv,
* PV on the system.
*/
if (!scanned && is_orphan(pv) &&
- !dm_list_size(&pv->fid->metadata_areas_in_use) &&
- !dm_list_size(&pv->fid->metadata_areas_ignored)) {
+ !dm_list_size(&pv->fid->metadata_areas_in_use)) {
if (!scan_label_only &&
!scan_vgs_for_pvs(cmd, 1)) {
stack;
11 years, 2 months
master - systemd: add doc reference in dm-event.socket
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d84e1ae5f2de56...
Commit: d84e1ae5f2de569db06293aac371ce7dde1cfd62
Parent: a54285a715b5e34808632b4973942db354fd089a
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Jun 29 13:54:35 2012 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Jun 29 13:54:35 2012 +0200
systemd: add doc reference in dm-event.socket
---
scripts/dm_event_systemd_red_hat.socket.in | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/scripts/dm_event_systemd_red_hat.socket.in b/scripts/dm_event_systemd_red_hat.socket.in
index c6c480c..b27c68d 100644
--- a/scripts/dm_event_systemd_red_hat.socket.in
+++ b/scripts/dm_event_systemd_red_hat.socket.in
@@ -1,5 +1,6 @@
[Unit]
Description=Device-mapper event daemon FIFOs
+Documentation=man:dmeventd(8)
DefaultDependencies=no
[Socket]
11 years, 2 months
master - man: --activate ay and auto_activation_volume_list
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a54285a715b5e3...
Commit: a54285a715b5e34808632b4973942db354fd089a
Parent: ec8f377748f4922d6a18ff0136e9a93f1d0b3f86
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Jun 29 12:40:26 2012 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Jun 29 12:40:26 2012 +0200
man: --activate ay and auto_activation_volume_list
---
WHATS_NEW | 1 +
man/lvchange.8.in | 10 +++++++---
man/lvcreate.8.in | 14 +++++++++-----
man/lvm.conf.5.in | 11 +++++++++++
man/pvscan.8.in | 8 ++++++++
man/vgchange.8.in | 9 +++++++--
6 files changed, 43 insertions(+), 10 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 4be4c90..d19df2d 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.97 -
===============================
+ Update man pages with --activate ay option and auto_activation_volume_list.
Fix _alloc_parallel_area to avoid picking already-full areas for raid devices.
Use vgchange -aay instead of vgchange -ay in clmvd init script.
Add activation/auto_activation_volume_list to lvm.conf.
diff --git a/man/lvchange.8.in b/man/lvchange.8.in
index 9494ba7..c7507d4 100644
--- a/man/lvchange.8.in
+++ b/man/lvchange.8.in
@@ -8,7 +8,7 @@ lvchange \- change attributes of a logical volume
.RB [ \-A | \-\-autobackup
.RI { y | n }]
.RB [ \-a | \-\-activate
-.RI [ e | l ]{ y | n }]
+.RI [ a | e | l ]{ y | n }]
.RB [ \-\-alloc
.IR AllocationPolicy ]
.RB [ \-C | \-\-contiguous
@@ -46,11 +46,15 @@ including making them known to the kernel ready for use.
.SH OPTIONS
See \fBlvm\fP(8) for common options.
.TP
-.BR \-a ", " \-\-activate " [" \fIe | \fIl ]{ \fIy | \fIn }
+.BR \-a ", " \-\-activate " [" \fIa | \fIe | \fIl ]{ \fIy | \fIn }
Controls the availability of the logical volumes for use.
Communicates with the kernel device-mapper driver via
libdevmapper to activate (\-ay) or deactivate (\-an) the
-logical volumes.
+logical volumes. If autoactivation option is used (\-aay),
+the logical volume is activated only if it matches an item in
+the activation/auto_activation_volume_list set in lvm.conf.
+Autoactivation is not yet supported for logical volumes that
+are part of partial or clustered volume groups.
.IP
If clustered locking is enabled, -aey will activate exclusively
on one node and -aly will activate only on the local node.
diff --git a/man/lvcreate.8.in b/man/lvcreate.8.in
index 4b393e1..2917775 100644
--- a/man/lvcreate.8.in
+++ b/man/lvcreate.8.in
@@ -8,7 +8,7 @@ lvcreate \- create a logical volume in an existing volume group
.RB [ \-\-alloc
.IR AllocationPolicy ]
.RB [ \-a | \-\-activate
-.RI [ e | l ]{ y | n }]
+.RI [ a | e | l ]{ y | n }]
.RB [ \-A | \-\-autobackup
.RI { y | n }]
.RB [ \-C | \-\-contiguous
@@ -107,17 +107,21 @@ See
.BR lvm (8)
for common options.
.TP
-.IR \fB\-a ", " \fB\-\-activate " {" y | n | ey | en | ly | ln }
+.IR \fB\-a ", " \fB\-\-activate " {" y | ay | n | ey | en | ly | ln }
Controls the availability of the Logical Volumes for immediate use after
the command finishes running.
-By default, new Logical Volumes are activated automatically (\fB-a\fIy\fR).
+By default, new Logical Volumes are activated (\fB-a\fIy\fR).
If it is possible technically, \fB-a\fIn\fR will leave the new Logical
Volume inactive. But for example, snapshots can only be created
in the active state so \fB\-a\fIn\fR cannot be used with \fB\-\-snapshot\fP.
Normally the \fB\-\-zero n\fP argument has to be supplied too because
zeroing (the default behaviour) also requires activation.
-If clustered locking is enabled, \fB\-a\fIey\fR will activate exclusively
-on one node and \fB\-a\fIly\fR will activate only on the local node.
+If autoactivation option is used (\fB\-a\fIay\fR), the logical volume is
+activated only if it matches an item in the activation/auto_activation_volume_list
+set in lvm.conf. For autoactivated logical volumes, \fB\-\-zero n\fP is
+always assumed and it can't be overridden. If clustered locking is enabled,
+\fB\-a\fIey\fR will activate exclusively on one node and \fB\-a\fIly\fR will
+activate only on the local node.
.TP
.BR \-c ", " \-\-chunksize " " \fIChunkSize
Gives the size of chunk for snapshot and thin pool logical volumes.
diff --git a/man/lvm.conf.5.in b/man/lvm.conf.5.in
index 6de7419..47ee9f1 100644
--- a/man/lvm.conf.5.in
+++ b/man/lvm.conf.5.in
@@ -424,6 +424,17 @@ metadata for a match.
Logical volume and volume groups can also be included in the list
by name e.g. vg00, vg00/lvol1.
.IP
+\fBauto_activation_volume_list\fP \(em This acts as a filter through
+which all requests to autoactivate a logical volume on this machine
+are passed. A logical volume is autoactivated if it matches
+an item in the list. Volumes must also pass the \fBvolume_list\fP
+filter, if present. Tags must be preceded by @ and are checked against
+all tags defined in the logical volume and volume group metadata for
+a match. @* is short-hand to check every tag set on the host machine
+(see \fBtags\fP above).
+Logical volume and volume groups can also be included in the list
+by name e.g. vg00, vg00/lvol1.
+.IP
\fBread_only_volume_list\fP \(em This acts as a filter through
which all requests to activate a logical volume on this machine
are passed. A logical volume is activated in read-only mode (instead
diff --git a/man/pvscan.8.in b/man/pvscan.8.in
index b75773b..1be3109 100644
--- a/man/pvscan.8.in
+++ b/man/pvscan.8.in
@@ -18,6 +18,7 @@ pvscan \- scan all disks for physical volumes
.RB [ \-d | \-\-debug ]
.RB [ \-h | \-\-help ]
.B \-\-cache
+.RB [ \-a | \-\-activate " " \fIay ]
.RB [ \-\-major
.I major
.B \-\-minor
@@ -42,6 +43,13 @@ Short listing format.
.BR \-u ", " \-\-uuid
Show UUIDs (Uniform Unique Identifiers) in addition to device special names.
.TP
+.BR \-a ", " \-\-activate " " \fIay
+Together with the information already cached in lvmetad, automatically activate
+any logical volumes that become activatable after the scan done on one or more devices.
+The logical volume to autoactivate is matched against the
+activation/auto_activation_volume_list set in lvm.conf. Autoactivation is not yet
+supported on logical volumes that are part of partial or clustered volume groups.
+.TP
.BR \-\-cache " [" \-\-major " " \fImajor " " \-\-minor " " \fIminor " | " \fIDevicePath " ]..."
Scan one or more devices and instruct the lvmetad daemon to update its cached
state accordingly. Called internally by udev rules.
diff --git a/man/vgchange.8.in b/man/vgchange.8.in
index 056acb4..28e2623 100644
--- a/man/vgchange.8.in
+++ b/man/vgchange.8.in
@@ -10,7 +10,7 @@ vgchange \- change attributes of a volume group
.RB [ \-A | \-\-autobackup
.RI { y | n }]
.RB [ \-a | \-\-activate
-.RI [ e | l ]
+.RI [ a | e | l ]
.RI { y | n }]
.RB [ \-\-monitor
.RI { y | n }]
@@ -64,10 +64,15 @@ Controls automatic backup of metadata after the change. See
.BR vgcfgbackup (8).
Default is yes.
.TP
-.BR \-a ", " \-\-activate " [" \fIe | \fIl ]{ \fIy | \fIn }
+.BR \-a ", " \-\-activate " [" \fIa | \fIe | \fIl ]{ \fIy | \fIn }
Controls the availability of the logical volumes in the volume
group for input/output.
In other words, makes the logical volumes known/unknown to the kernel.
+If autoactivation option is used (\-aay), each logical volume in
+the volume group is activated only if it matches an item in the
+activation/auto_activation_volume_list set in lvm.conf.
+Autoactivation is not yet supported for partial or clustered
+volume groups.
.IP
If clustered locking is enabled, add 'e' to activate/deactivate
exclusively on one node or 'l' to activate/deactivate only
11 years, 2 months
master - cleanup: static volume filter fn, lvm.conf comment
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ec8f377748f492...
Commit: ec8f377748f4922d6a18ff0136e9a93f1d0b3f86
Parent: 2cec4b4a7748cefe4e2b8adcd1c287af354e21fb
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Jun 29 10:28:53 2012 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Jun 29 10:28:53 2012 +0200
cleanup: static volume filter fn, lvm.conf comment
Change 'lv_passes_volumes_filter' fn back to static as it's not
actually needed in the other code (a remnant from devel version).
Fix lvm.conf comment referencing '--autoactivate' which was finally
decided to be '--activate ay'.
---
doc/example.conf.in | 6 +++---
lib/activate/activate.c | 10 +++++-----
lib/activate/activate.h | 3 ---
3 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/doc/example.conf.in b/doc/example.conf.in
index 4864b81..fbb9271 100644
--- a/doc/example.conf.in
+++ b/doc/example.conf.in
@@ -550,9 +550,9 @@ activation {
#
# volume_list = [ "vg1", "vg2/lvol1", "@tag1", "@*" ]
- # If auto_activation_volume_list is defined, each LV that is to be activated
- # is checked against the list while using the --autoactivate option, and if
- # it matches, it is activated.
+ # If auto_activation_volume_list is defined, each LV that is to be
+ # activated is checked against the list while using the autoactivation
+ # option (--activate ay/-a ay), and if it matches, it is activated.
# "vgname" and "vgname/lvname" are matched exactly.
# "@tag" matches any tag set in the LV or VG.
# "@*" matches if any tag defined on the host is also set in the LV or VG
diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index 939de6c..3156f01 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -328,8 +328,8 @@ int activation(void)
return _activation;
}
-int lv_passes_volumes_filter(struct cmd_context *cmd, struct logical_volume *lv,
- const struct dm_config_node *cn, const char *config_path)
+static int _lv_passes_volumes_filter(struct cmd_context *cmd, struct logical_volume *lv,
+ const struct dm_config_node *cn, const char *config_path)
{
const struct dm_config_value *cv;
const char *str;
@@ -427,7 +427,7 @@ static int _passes_activation_filter(struct cmd_context *cmd,
return 0;
}
- return lv_passes_volumes_filter(cmd, lv, cn, "activation/volume_list");
+ return _lv_passes_volumes_filter(cmd, lv, cn, "activation/volume_list");
}
static int _passes_readonly_filter(struct cmd_context *cmd,
@@ -438,7 +438,7 @@ static int _passes_readonly_filter(struct cmd_context *cmd,
if (!(cn = find_config_tree_node(cmd, "activation/read_only_volume_list")))
return 0;
- return lv_passes_volumes_filter(cmd, lv, cn, "activation/read_only_volume_list");
+ return _lv_passes_volumes_filter(cmd, lv, cn, "activation/read_only_volume_list");
}
@@ -452,7 +452,7 @@ int lv_passes_auto_activation_filter(struct cmd_context *cmd, struct logical_vol
return 1;
}
- return lv_passes_volumes_filter(cmd, lv, cn, "activation/auto_activation_volume_list");
+ return _lv_passes_volumes_filter(cmd, lv, cn, "activation/auto_activation_volume_list");
}
int library_version(char *version, size_t size)
diff --git a/lib/activate/activate.h b/lib/activate/activate.h
index f698fc9..f473a11 100644
--- a/lib/activate/activate.h
+++ b/lib/activate/activate.h
@@ -93,9 +93,6 @@ int lv_check_not_in_use(struct cmd_context *cmd, struct logical_volume *lv,
*/
int lv_activation_filter(struct cmd_context *cmd, const char *lvid_s,
int *activate_lv);
-int lv_passes_volumes_filter(struct cmd_context *cmd, struct logical_volume *lv,
- const struct dm_config_node *cn, const char *config_path);
-
/*
* Checks against the auto_activation_volume_list and
* returns 1 if the LV should be activated, 0 otherwise.
11 years, 2 months
master - alloc: fix raid --alloc anywhere double allocs
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2cec4b4a7748ce...
Commit: 2cec4b4a7748cefe4e2b8adcd1c287af354e21fb
Parent: 2f201d0e5e2149455709efa8bb977bd612694a5e
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Thu Jun 28 23:26:42 2012 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Thu Jun 28 23:26:42 2012 +0100
alloc: fix raid --alloc anywhere double allocs
If _alloc_parallel_area for raid devices chooses an area already used
up, it doesn't notice that it has no space left in it and leaves
later code trying to place a zero-length area into the LV.
https://bugzilla.redhat.com/832596
---
WHATS_NEW | 1 +
lib/metadata/lv_manip.c | 6 +++++-
2 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 71c8219..4be4c90 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.97 -
===============================
+ Fix _alloc_parallel_area to avoid picking already-full areas for raid devices.
Use vgchange -aay instead of vgchange -ay in clmvd init script.
Add activation/auto_activation_volume_list to lvm.conf.
Add --activate ay to lvcreate, lvchange, pvscan and vgchange.
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 0666a51..21508fd 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -1132,9 +1132,13 @@ static int _alloc_parallel_area(struct alloc_handle *ah, uint32_t max_to_allocat
dm_list_add(&ah->alloced_areas[s], &aa[s].list);
s -= ah->area_count + ah->parity_count;
}
+ aa[s].len = (ah->alloc_and_split_meta) ? len - ah->log_len : len;
+ /* Skip empty allocations */
+ if (!aa[s].len)
+ continue;
+
aa[s].pv = pva->map->pv;
aa[s].pe = pva->start;
- aa[s].len = (ah->alloc_and_split_meta) ? len - ah->log_len : len;
log_debug("Allocating parallel area %" PRIu32
" on %s start PE %" PRIu32 " length %" PRIu32 ".",
11 years, 2 months
master - WHATS_NEW: update
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2f201d0e5e2149...
Commit: 2f201d0e5e2149455709efa8bb977bd612694a5e
Parent: 2d5adc5823353cba2bd3e585bb75a4a298f4cbfd
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Thu Jun 28 23:14:27 2012 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Thu Jun 28 23:14:27 2012 +0100
WHATS_NEW: update
Update WHATS_NEW.
---
WHATS_NEW | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 4a6df08..71c8219 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -2,10 +2,7 @@ Version 2.02.97 -
===============================
Use vgchange -aay instead of vgchange -ay in clmvd init script.
Add activation/auto_activation_volume_list to lvm.conf.
- Add --activate ay to lvcreate.
- Add --activate ay to lvchange.
- Add --activate ay to pvscan.
- Add --activate ay to vgchange.
+ Add --activate ay to lvcreate, lvchange, pvscan and vgchange.
Add support for volume autoactivation using lvmetad.
Add --activate synonym for --available arg and prefer --activate.
Never issue discards when LV extents are being reconfigured, not deleted.
11 years, 2 months
master - initscript: call vgchange -aay instead of -aly
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2d5adc5823353c...
Commit: 2d5adc5823353cba2bd3e585bb75a4a298f4cbfd
Parent: f6a3ef4490ebcb2318fd98e79add2c910cf482c5
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Jun 28 12:49:33 2012 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Jun 28 09:44:07 2012 -0400
initscript: call vgchange -aay instead of -aly
The clmvd init script called "vgchange -aly" before to activate
all VGs in cluster environment. This activated all VGs, no matter
if it was clustered or not.
Auto activation for clustered VGs is not supported yet so the behaviour
of -aay is still the same as before for clustered VGs. However, for
non-clustered VGs, we need to check with the activation/auto_activation_volume_list
whether the VG/LV should be activated on boot or not.
---
WHATS_NEW | 1 +
scripts/clvmd_init_red_hat.in | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 842a188..4a6df08 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.97 -
===============================
+ Use vgchange -aay instead of vgchange -ay in clmvd init script.
Add activation/auto_activation_volume_list to lvm.conf.
Add --activate ay to lvcreate.
Add --activate ay to lvchange.
diff --git a/scripts/clvmd_init_red_hat.in b/scripts/clvmd_init_red_hat.in
index 3fc90c5..4170094 100644
--- a/scripts/clvmd_init_red_hat.in
+++ b/scripts/clvmd_init_red_hat.in
@@ -87,7 +87,7 @@ start()
${lvm_vgscan} > /dev/null 2>&1
- action "Activating VG(s):" ${lvm_vgchange} -ayl $LVM_VGS || return $?
+ action "Activating VG(s):" ${lvm_vgchange} -aay $LVM_VGS || return $?
touch $LOCK_FILE
11 years, 2 months
master - conf: add activation/auto_activation_volume_list
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f6a3ef4490ebcb...
Commit: f6a3ef4490ebcb2318fd98e79add2c910cf482c5
Parent: a2f4ccd83907590d16e6d06e1aea7e70efcf1fe5
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Tue Jun 26 06:17:23 2012 -0400
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Jun 28 09:44:07 2012 -0400
conf: add activation/auto_activation_volume_list
---
WHATS_NEW | 1 +
doc/example.conf.in | 9 +++++++++
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 152ec08..842a188 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.97 -
===============================
+ Add activation/auto_activation_volume_list to lvm.conf.
Add --activate ay to lvcreate.
Add --activate ay to lvchange.
Add --activate ay to pvscan.
diff --git a/doc/example.conf.in b/doc/example.conf.in
index 9092e32..4864b81 100644
--- a/doc/example.conf.in
+++ b/doc/example.conf.in
@@ -550,6 +550,15 @@ activation {
#
# volume_list = [ "vg1", "vg2/lvol1", "@tag1", "@*" ]
+ # If auto_activation_volume_list is defined, each LV that is to be activated
+ # is checked against the list while using the --autoactivate option, and if
+ # it matches, it is activated.
+ # "vgname" and "vgname/lvname" are matched exactly.
+ # "@tag" matches any tag set in the LV or VG.
+ # "@*" matches if any tag defined on the host is also set in the LV or VG
+ #
+ # auto_activation_volume_list = [ "vg1", "vg2/lvol1", "@tag1", "@*" ]
+
# If read_only_volume_list is defined, each LV that is to be activated
# is checked against the list, and if it matches, it as activated
# in read-only mode. (This overrides '--permission rw' stored in the
11 years, 2 months
master - lvcreate: add --activate ay (autoactivate)
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a2f4ccd8390759...
Commit: a2f4ccd83907590d16e6d06e1aea7e70efcf1fe5
Parent: c9b9077b44119db0bfd926730cb79ebf0990c980
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Jun 28 04:15:07 2012 -0400
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Jun 28 09:44:07 2012 -0400
lvcreate: add --activate ay (autoactivate)
One can use "lvcreate --aay" to have the newly created volume
activated or not activated based on the activation/auto_activation_volume_list
this way.
Note: -Z/--zero is not compatible with -aay, zeroing is not used in this case!
When using lvcreate -aay, a default warning message is also issued that zeroing
is not done.
---
WHATS_NEW | 1 +
lib/metadata/lv_manip.c | 9 +++++++++
tools/commands.h | 2 +-
tools/lvcreate.c | 6 ++++++
4 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index ec554bf..152ec08 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.97 -
===============================
+ Add --activate ay to lvcreate.
Add --activate ay to lvchange.
Add --activate ay to pvscan.
Add --activate ay to vgchange.
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index a0be887..0666a51 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -4433,6 +4433,15 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg, struct l
backup(vg);
+ /*
+ * Check for autoactivation.
+ * If the LV passes the auto activation filter, activate
+ * it just as if CHANGE_AY was used, CHANGE_AN otherwise.
+ */
+ if (lp->activate == CHANGE_AAY)
+ lp->activate = lv_passes_auto_activation_filter(cmd, lv) ?
+ CHANGE_ALY : CHANGE_ALN;
+
if (test_mode()) {
log_verbose("Test mode: Skipping activation and zeroing.");
goto out;
diff --git a/tools/commands.h b/tools/commands.h
index b863c66..3454951 100644
--- a/tools/commands.h
+++ b/tools/commands.h
@@ -159,7 +159,7 @@ xx(lvcreate,
0,
"lvcreate " "\n"
"\t[-A|--autobackup {y|n}]\n"
- "\t[-a|--activate [e|l]y|n]\n"
+ "\t[-a|--activate [a|e|l]{y|n}]\n"
"\t[--addtag Tag]\n"
"\t[--alloc AllocationPolicy]\n"
"\t[-C|--contiguous {y|n}]\n"
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index a81e39d..ab217cf 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -567,6 +567,12 @@ static int _read_activation_params(struct lvcreate_params *lp, struct cmd_contex
log_error("--activate n requires --zero n");
return 0;
}
+ } else if (lp->activate == CHANGE_AAY) {
+ if (arg_count(cmd, zero_ARG)) {
+ log_error("-Z is incompatible with --activate a");
+ return 0;
+ }
+ lp->zero = 0;
}
/*
11 years, 2 months
master - lvchange: add --activate ay (autoactivate)
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c9b9077b44119d...
Commit: c9b9077b44119db0bfd926730cb79ebf0990c980
Parent: d2df8dddc8c04973a3e23b7a19e9bfbf8c45f79e
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Jun 27 10:43:20 2012 -0400
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Jun 28 09:44:07 2012 -0400
lvchange: add --activate ay (autoactivate)
The same as for vgchange...
---
WHATS_NEW | 1 +
tools/commands.h | 2 +-
tools/lvchange.c | 6 ++++++
3 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 481e8e3..ec554bf 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.97 -
===============================
+ Add --activate ay to lvchange.
Add --activate ay to pvscan.
Add --activate ay to vgchange.
Add support for volume autoactivation using lvmetad.
diff --git a/tools/commands.h b/tools/commands.h
index 21791f7..b863c66 100644
--- a/tools/commands.h
+++ b/tools/commands.h
@@ -61,7 +61,7 @@ xx(lvchange,
CACHE_VGMETADATA | PERMITTED_READ_ONLY,
"lvchange\n"
"\t[-A|--autobackup y|n]\n"
- "\t[-a|--activate [e|l]y|n]\n"
+ "\t[-a|--activate [a|e|l]{y|n}]\n"
"\t[--addtag Tag]\n"
"\t[--alloc AllocationPolicy]\n"
"\t[-C|--contiguous y|n]\n"
diff --git a/tools/lvchange.c b/tools/lvchange.c
index 4d040be..9876847 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -136,6 +136,12 @@ static int _lvchange_activate(struct cmd_context *cmd, struct logical_volume *lv
if (lv_is_cow(lv) && !lv_is_virtual_origin(origin_from_cow(lv)))
lv = origin_from_cow(lv);
+ if (activate == CHANGE_AAY) {
+ if (!lv_passes_auto_activation_filter(cmd, lv))
+ return 1;
+ activate = CHANGE_ALY;
+ }
+
if (activate == CHANGE_ALN) {
log_verbose("Deactivating logical volume \"%s\" locally",
lv->name);
11 years, 2 months