master - cleanup: quite gcc warn
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9534c21ead16da...
Commit: 9534c21ead16dae8975fdaf1959b5534dc175f84
Parent: ff33d215ba488bc3abf7bb33f1c25ee1fc0e65c4
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Aug 15 14:08:06 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Aug 15 15:06:45 2014 +0200
cleanup: quite gcc warn
gcc can't see dev_get_primary_dev returns only 0,1,2
so ensure 'name' is always defined in valid path.
---
lib/filters/filter-mpath.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/lib/filters/filter-mpath.c b/lib/filters/filter-mpath.c
index 52c9341..a933ba1 100644
--- a/lib/filters/filter-mpath.c
+++ b/lib/filters/filter-mpath.c
@@ -158,6 +158,7 @@ static int dev_is_mpath(struct dev_filter *f, struct device *dev)
return 0;
switch (dev_get_primary_dev(dt, dev, &primary_dev)) {
+ default:
case 0:
/* Error. */
log_error("Failed to get primary device for %d:%d.", major, minor);
9 years, 8 months
master - cleanup: drop extra braces
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ff33d215ba488b...
Commit: ff33d215ba488bc3abf7bb33f1c25ee1fc0e65c4
Parent: f183995f8ead0bf63aea6ce7983871015dc3efff
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Aug 15 13:52:21 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Aug 15 15:06:45 2014 +0200
cleanup: drop extra braces
---
tools/lvchange.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/lvchange.c b/tools/lvchange.c
index f3bef8b..91c8087 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -993,7 +993,7 @@ static int _lvchange_single(struct cmd_context *cmd, struct logical_volume *lv,
!arg_count(cmd, setactivationskip_ARG))
/* Rest can be changed for stacked thin pool meta/data volumes */
;
- else if (!(lv_is_visible(lv)) && !lv_is_virtual_origin(lv)) {
+ else if (!lv_is_visible(lv) && !lv_is_virtual_origin(lv)) {
log_error("Unable to change internal LV %s directly",
lv->name);
return ECMD_FAILED;
9 years, 8 months
master - cleanup: just easier word wrapping
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f183995f8ead0b...
Commit: f183995f8ead0bf63aea6ce7983871015dc3efff
Parent: 1bde4c19e65a823c9dc3a34606f2aefb76e41230
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Aug 14 11:11:14 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Aug 15 15:06:44 2014 +0200
cleanup: just easier word wrapping
---
man/lvconvert.8.in | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/man/lvconvert.8.in b/man/lvconvert.8.in
index 93fb9a9..b8951e2 100644
--- a/man/lvconvert.8.in
+++ b/man/lvconvert.8.in
@@ -100,7 +100,8 @@ lvconvert \(em convert a logical volume from linear to mirror or snapshot
.RI [ PhysicalVolume [ Path ]...]
.sp
.B lvconvert
-.RB [{ \-\-type \ \fIthin [ \fI\-pool ]| \-T | \-\-thin }
+.RB [{ \-\-type
+.BR \fIthin [ \fI\-pool ]| \-T | \-\-thin }
.RB [ \-\-originname
.IR NewExternalOriginVolumeName ]]
.RB [ \-\-thinpool
@@ -131,7 +132,8 @@ lvconvert \(em convert a logical volume from linear to mirror or snapshot
.RB [ \-\-version ]
.sp
.B lvconvert
-.RB [ \-\-type \ \fIcache [ \fI\-pool ]| \-\-cache ]
+.RB [ \-\-type
+.BR \fIcache [ \fI\-pool ]| \-\-cache ]
.RB [ \-\-cachepool
.IR CachePoolLV { Name | Path }]
.RB [ \-c | \-\-chunksize
9 years, 8 months
master - cleanup: drop unneeded inits
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1bde4c19e65a82...
Commit: 1bde4c19e65a823c9dc3a34606f2aefb76e41230
Parent: 5095a6517da9b57b0d2540b961e9841ad02fa8cc
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Aug 13 14:20:41 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Aug 15 15:06:44 2014 +0200
cleanup: drop unneeded inits
---
tools/lvconvert.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index d9fc749..7330c73 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -3218,7 +3218,7 @@ static int _poll_logical_volume(struct cmd_context *cmd, struct logical_volume *
static int lvconvert_single(struct cmd_context *cmd, struct lvconvert_params *lp)
{
- struct logical_volume *lv = NULL;
+ struct logical_volume *lv;
int ret = ECMD_FAILED;
int saved_ignore_suspended_devices = ignore_suspended_devices();
@@ -3265,8 +3265,8 @@ static int _lvconvert_merge_single(struct cmd_context *cmd, struct logical_volum
void *handle)
{
struct lvconvert_params *lp = handle;
- const char *vg_name = NULL;
- struct logical_volume *refreshed_lv = NULL;
+ const char *vg_name;
+ struct logical_volume *refreshed_lv;
int ret;
/*
9 years, 8 months
master - cleanup: simplier struct initilization
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5095a6517da9b5...
Commit: 5095a6517da9b57b0d2540b961e9841ad02fa8cc
Parent: 338b991e4072734a4c37573d1bb541ecadee93b8
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Aug 13 14:20:10 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Aug 15 15:06:44 2014 +0200
cleanup: simplier struct initilization
---
tools/lvconvert.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 9c25bd9..d9fc749 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -348,9 +348,6 @@ static int _read_params(struct lvconvert_params *lp, struct cmd_context *cmd,
int pagesize = lvm_getpagesize();
const char *type_str = arg_str_value(cmd, type_ARG, "");
- memset(lp, 0, sizeof(*lp));
- lp->target_attr = ~0;
-
if (!_check_conversion_type(cmd, type_str))
return_0;
@@ -3315,7 +3312,9 @@ static int _lvconvert_merge_single(struct cmd_context *cmd, struct logical_volum
int lvconvert(struct cmd_context * cmd, int argc, char **argv)
{
- struct lvconvert_params lp;
+ struct lvconvert_params lp = {
+ .target_attr = ~0,
+ };
if (!_read_params(&lp, cmd, argc, argv)) {
stack;
9 years, 8 months
master - cleanup: move test for free arg
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=338b991e407273...
Commit: 338b991e4072734a4c37573d1bb541ecadee93b8
Parent: 6872adc0ff7e6c72cc94fd15ed5dd910b958386e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Aug 13 14:19:13 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Aug 15 15:06:44 2014 +0200
cleanup: move test for free arg
Move test for list of volumes into common place.
---
tools/lvconvert.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index e369def..9c25bd9 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -110,8 +110,13 @@ static int _lvconvert_name_params(struct lvconvert_params *lp,
char *ptr;
const char *vg_name = NULL;
- if (lp->merge)
+ if (lp->merge) {
+ if (!*pargc) {
+ log_error("Please specify a logical volume path.");
+ return 0;
+ }
return 1;
+ }
if (!*pargc) {
if (lp->cache) {
@@ -3317,14 +3322,9 @@ int lvconvert(struct cmd_context * cmd, int argc, char **argv)
return EINVALID_CMD_LINE;
}
- if (lp.merge) {
- if (!argc) {
- log_error("Please provide logical volume path");
- return EINVALID_CMD_LINE;
- }
+ if (lp.merge)
return process_each_lv(cmd, argc, argv, READ_FOR_UPDATE, &lp,
&_lvconvert_merge_single);
- }
return lvconvert_single(cmd, &lp);
}
9 years, 8 months
master - cleanup: postpone confirmation prompt for snapshot
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6872adc0ff7e6c...
Commit: 6872adc0ff7e6c72cc94fd15ed5dd910b958386e
Parent: ba7796e0550dcc8fcc114bc8eadc6815c34c3f4f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Aug 15 13:31:53 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Aug 15 15:06:44 2014 +0200
cleanup: postpone confirmation prompt for snapshot
Prompt user for confimation after more checks are done.
(So we avoid case prompting and failing after prompt)
---
tools/lvchange.c | 39 +++++++++++++++++++--------------------
1 files changed, 19 insertions(+), 20 deletions(-)
diff --git a/tools/lvchange.c b/tools/lvchange.c
index 992efde..f3bef8b 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -964,26 +964,6 @@ static int _lvchange_single(struct cmd_context *cmd, struct logical_volume *lv,
return ECMD_FAILED;
}
- if (lv_is_cow(lv) && !lv_is_virtual_origin(origin = origin_from_cow(lv)) &&
- arg_count(cmd, activate_ARG)) {
- if (origin->origin_count < 2)
- snaps_msg[0] = '\0';
- else if (dm_snprintf(snaps_msg, sizeof(snaps_msg),
- " and %u other snapshot(s)",
- origin->origin_count - 1) < 0) {
- log_error("Failed to prepare message.");
- return ECMD_FAILED;
- }
-
- if (!arg_count(cmd, yes_ARG) &&
- (yes_no_prompt("Change of snapshot %s will also change its"
- " origin %s%s. Proceed? [y/n]: ", lv->name,
- origin->name, snaps_msg) == 'n')) {
- log_error("Logical volume %s not changed.", lv->name);
- return ECMD_FAILED;
- }
- }
-
if (lv->status & PVMOVE) {
log_error("Unable to change pvmove LV %s", lv->name);
if (arg_count(cmd, activate_ARG))
@@ -1019,6 +999,25 @@ static int _lvchange_single(struct cmd_context *cmd, struct logical_volume *lv,
return ECMD_FAILED;
}
+ if (lv_is_cow(lv) && arg_count(cmd, activate_ARG)) {
+ if (origin->origin_count < 2)
+ snaps_msg[0] = '\0';
+ else if (dm_snprintf(snaps_msg, sizeof(snaps_msg),
+ " and %u other snapshot(s)",
+ origin->origin_count - 1) < 0) {
+ log_error("Failed to prepare message.");
+ return ECMD_FAILED;
+ }
+
+ if (!arg_count(cmd, yes_ARG) &&
+ (yes_no_prompt("Change of snapshot %s will also change its "
+ "origin %s%s. Proceed? [y/n]: ", lv->name,
+ origin->name, snaps_msg) == 'n')) {
+ log_error("Logical volume %s not changed.", lv->name);
+ return ECMD_FAILED;
+ }
+ }
+
/*
* FIXME: DEFAULT_BACKGROUND_POLLING should be "unspecified".
* If --poll is explicitly provided use it; otherwise polling
9 years, 8 months
master - man: add some more reserved names
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ba7796e0550dcc...
Commit: ba7796e0550dcc8fcc114bc8eadc6815c34c3f4f
Parent: 630fcab420ce791612bbeed3e30db4c5371803e5
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Aug 14 11:10:36 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Aug 15 15:06:44 2014 +0200
man: add some more reserved names
---
man/lvm.8.in | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/man/lvm.8.in b/man/lvm.8.in
index 76d1237..069194c 100644
--- a/man/lvm.8.in
+++ b/man/lvm.8.in
@@ -339,14 +339,15 @@ Path for the lvmetad pid file.
.B LVM_LVMETAD_SOCKET
Path for the lvmetad socket file.
.SH VALID NAMES
-The following characters are valid for VG and LV names:
+The valid characters for VG and LV names are:
.B a-z A-Z 0-9 + _ . -
.LP
VG and LV names cannot begin with a hyphen.
There are also various reserved names that are used internally by lvm that can not be used as LV or VG names.
A VG cannot be called anything that exists in /dev/ at the time of creation, nor can it be called '.' or '..'.
A LV cannot be called '.' '..' 'snapshot' or 'pvmove'. The LV name may also not contain
-the strings '_mlog', '_mimage', '_rimage', '_tdata', '_tmeta'.
+the strings '_cdata', '_cmeta', '_mlog', '_mimage', '_pmspare',
+'_rimage', '_rlog', '_tdata', '_tmeta'.
A directory bearing the name of each Volume Group is created under /dev when any of its Logical Volumes are activated.
Each active Logical Volume is accessible from this directory as a symbolic link leading to a device node.
Links or nodes in /dev/mapper are intended only for internal use and the precise format and escaping might change between releases and distributions.
9 years, 8 months
master - man: show lv name for lvs
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=630fcab420ce79...
Commit: 630fcab420ce791612bbeed3e30db4c5371803e5
Parent: 7f4b1e7411d7ff59abe2063db7273fd600e2bf72
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Aug 14 11:09:30 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Aug 15 15:06:44 2014 +0200
man: show lv name for lvs
Make it more obvious that either just vg name or lv name or path could
be passed as an argument.
---
man/lvdisplay.8.in | 12 ++++++------
man/lvs.8.in | 4 ++--
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/man/lvdisplay.8.in b/man/lvdisplay.8.in
index ed113dd..3232853 100644
--- a/man/lvdisplay.8.in
+++ b/man/lvdisplay.8.in
@@ -18,8 +18,8 @@ lvdisplay \(em display attributes of a logical volume
.IR hHbBsSkKmMgGtTpPeE ]
.RB [ \-v | \-\-verbose ]
.RB [ \-\-version ]
-.RI [ LogicalVolumePath
-.RI [ LogicalVolumePath ...]]
+.RI [ VolumeGroupName | LogicalVolume { Name | Path }
+.RI [ VolumeGroupName | LogicalVolume { Name | Path }\ ...]]
.br
.B lvdisplay
@@ -50,8 +50,8 @@ lvdisplay \(em display attributes of a logical volume
.IR hHbBsSkKmMgGtTpPeE ]
.RB [ \-v | \-\-verbose ]
.RB [ \-\-version ]
-.RI [ LogicalVolumePath
-.RI [ LogicalVolumePath ...]]
+.RI [ VolumeGroupName | LogicalVolume { Name | Path }
+.RI [ VolumeGroupName | LogicalVolume { Name | Path }\ ...]]
.SH DESCRIPTION
lvdisplay allows you to see the attributes of a logical volume
like size, read/write status, snapshot information etc.
@@ -111,12 +111,12 @@ logical volumes have been created for this original logical volume,
this command shows a list of all snapshot logical volumes and their
status (active or inactive) as well:
.sp
-.B lvdisplay \-v /dev/vg00/lvol2
+.B lvdisplay \-v vg00/lvol2
Shows the attributes of this snapshot logical volume and also which
original logical volume it is associated with:
.sp
-.B lvdisplay /dev/vg00/snapshot
+.B lvdisplay vg00/snapshot
.SH SEE ALSO
.BR lvm (8),
diff --git a/man/lvs.8.in b/man/lvs.8.in
index b7e3ecc..3ab4120 100644
--- a/man/lvs.8.in
+++ b/man/lvs.8.in
@@ -32,8 +32,8 @@ lvs \(em report information about logical volumes
.RB [ \-\-unquoted ]
.RB [ \-v | \-\-verbose ]
.RB [ \-\-version ]
-.RI [ VolumeGroupName
-.RI [ VolumeGroupName ...]]
+.RI [ VolumeGroupName | LogicalVolume { Name | Path }
+.RI [ VolumeGroupName | LogicalVolume { Name | Path }\ ...]]
.SH DESCRIPTION
lvs produces formatted output about logical volumes.
9 years, 8 months
master - toollib: print ignoring vorigin
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7f4b1e7411d7ff...
Commit: 7f4b1e7411d7ff59abe2063db7273fd600e2bf72
Parent: 10e3715564e80e08daf04f0ae51067a04dfaa7b8
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Aug 15 13:53:04 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Aug 15 15:06:44 2014 +0200
toollib: print ignoring vorigin
When ignoring 'listed' volume, print info message.
(So the final command error message is a bit less confusing,
i.e. when user tries to deactive virtual origin:
> lvchange -an vg/lvol2_vorigin
Ignoring virtual origin logical volume vg/lvol2_vorigin.
One or more specified logical volume(s) not found.
---
tools/toollib.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/tools/toollib.c b/tools/toollib.c
index d6ef845..25ff21d 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -230,8 +230,13 @@ int process_each_lv_in_vg(struct cmd_context *cmd,
lv_is_cow(lvl->lv) && !lv_is_virtual_origin(origin_from_cow(lvl->lv)))
continue;
- if (lv_is_virtual_origin(lvl->lv) && !arg_count(cmd, all_ARG))
+ if (lv_is_virtual_origin(lvl->lv) && !arg_count(cmd, all_ARG)) {
+ if (lvargs_supplied &&
+ str_list_match_item(arg_lvnames, lvl->lv->name))
+ log_print_unless_silent("Ignoring virtual origin logical volume %s.",
+ display_lvname(lvl->lv));
continue;
+ }
/*
* Only let hidden LVs through it --all was used or the LVs
9 years, 8 months