master - lvs: add 's(k)ip activatoin' lv_attr field
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=283c93a85878cf...
Commit: 283c93a85878cfb67e1c9f0045065dbc0d63bca6
Parent: ab789c1bcfce3e9ad5032ad85b2f8a3171a6dbfb
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Jul 11 14:05:05 2013 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Jul 12 20:54:17 2013 +0200
lvs: add 's(k)ip activatoin' lv_attr field
A new 10-th bit in lvs lv_attr field to indicate whether an LV
has the ACTIVATION_SKIP flag attached (stored in metadata).
---
lib/metadata/lv.c | 7 ++++++-
man/lvs.8.in | 2 ++
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/lib/metadata/lv.c b/lib/metadata/lv.c
index 0742562..4d3a259 100644
--- a/lib/metadata/lv.c
+++ b/lib/metadata/lv.c
@@ -530,7 +530,7 @@ char *lv_attr_dup(struct dm_pool *mem, const struct logical_volume *lv)
struct lv_segment *seg;
char *repstr;
- if (!(repstr = dm_pool_zalloc(mem, 10))) {
+ if (!(repstr = dm_pool_zalloc(mem, 11))) {
log_error("dm_pool_alloc failed");
return 0;
}
@@ -664,6 +664,11 @@ char *lv_attr_dup(struct dm_pool *mem, const struct logical_volume *lv)
repstr[8] = 'w'; /* sub-LV has 'w'ritemostly */
}
+ if (lv->status & LV_ACTIVATION_SKIP)
+ repstr[9] = 'k';
+ else
+ repstr[9] = '-';
+
out:
return repstr;
}
diff --git a/man/lvs.8.in b/man/lvs.8.in
index 013740f..a020bf7 100644
--- a/man/lvs.8.in
+++ b/man/lvs.8.in
@@ -176,6 +176,8 @@ of a RAID logical volume will clear this flag if no additional discrepancies
are found. ("check" and "repair" of a RAID Logical Volume can be done via
the 'lvchange' command.) (w)ritemostly signifies the devices in a RAID 1
logical volume that have been marked write-mostly.
+.IP 10 3
+(n)o activation: this volume is flagged to be skipped during activation.
.RE
.TP
.BR \-O ", " \-\-sort
10 years, 11 months
master - tools: add --setactivationskip and --ignoreactivationskip to vgchange/lvchange
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ab789c1bcfce3e...
Commit: ab789c1bcfce3e9ad5032ad85b2f8a3171a6dbfb
Parent: 7dc8c84b18cbd71f01ce6350759adbca28df5f9b
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Jul 11 12:44:36 2013 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Jul 12 20:49:57 2013 +0200
tools: add --setactivationskip and --ignoreactivationskip to vgchange/lvchange
The lvchange has both -k/--setactivationskip and
-K/--ignoreactivationskip option available for use.
The vgchange has only -K/--ignoreactivationskip, but
not the -k/--setactivationskip as the ACTIVATION_SKIP
flag is an LV property, not a VG one and so we change it
only by using the lvchange...
---
man/lvchange.8.in | 14 ++++++++++++++
man/vgchange.8.in | 4 ++++
tools/commands.h | 15 ++++++++++-----
tools/lvchange.c | 33 ++++++++++++++++++++++++++++++++-
tools/vgchange.c | 6 ++++++
5 files changed, 66 insertions(+), 6 deletions(-)
diff --git a/man/lvchange.8.in b/man/lvchange.8.in
index 44426ef..3b6c574 100644
--- a/man/lvchange.8.in
+++ b/man/lvchange.8.in
@@ -9,6 +9,8 @@ lvchange \- change attributes of a logical volume
.RI { y | n }]
.RB [ \-a | \-\-activate
.RI [ a | e | l ]{ y | n }]
+.RB [ \-k | \-\-setactivationskip { y | n } ]
+.RB [ \-K | \-\-ignoreactivationskip ]
.RB [ \-\-alloc
.IR AllocationPolicy ]
.RB [ \-C | \-\-contiguous
@@ -78,6 +80,18 @@ To deactivate only on the local node use -aln.
Logical volumes with single-host snapshots are always activated
exclusively because they can only be used on one node at once.
.TP
+.BR \-k ", " \-\-setactivationskip " {" \fIy | \fIn }
+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 be used.
+The flag is not applied during deactivation. 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
+.BR \-K ", " \-\-ignoreactivationskip
+Ignore the flag to skip Logical Volumes during activation.
+.TP
.BR \-C ", " \-\-contiguous " {" \fIy | \fIn }
Tries to set or reset the contiguous allocation policy for
logical volumes. It's only possible to change a non-contiguous
diff --git a/man/vgchange.8.in b/man/vgchange.8.in
index ab76ed0..97042b1 100644
--- a/man/vgchange.8.in
+++ b/man/vgchange.8.in
@@ -12,6 +12,7 @@ vgchange \- change attributes of a volume group
.RB [ \-a | \-\-activate
.RI [ a | e | l ]
.RI { y | n }]
+.RB [ \-K | \-\-ignoreactivationskip ]
.RB [ \-\-monitor
.RI { y | n }]
.RB [ \-\-poll
@@ -84,6 +85,9 @@ on the local node.
Logical volumes with single-host snapshots are always activated
exclusively because they can only be used on one node at once.
.TP
+.BR \-K ", " \-\-ignoreactivationskip
+Ignore the flag to skip Logical Volumes during activation.
+.TP
.BR \-c ", " \-\-clustered " {" \fIy | \fIn }
If clustered locking is enabled, this indicates whether this
Volume Group is shared with other nodes in the cluster or whether
diff --git a/tools/commands.h b/tools/commands.h
index 3d076c9..f4fdb0b 100644
--- a/tools/commands.h
+++ b/tools/commands.h
@@ -83,6 +83,8 @@ xx(lvchange,
"\t[--discards {ignore|nopassdown|passdown}]\n"
"\t[--ignorelockingfailure]\n"
"\t[--ignoremonitoring]\n"
+ "\t[-k|--setactivationskip {y|n}]\n"
+ "\t[-K|--ignoreactivationskip] \n"
"\t[--monitor {y|n}]\n"
"\t[--poll {y|n}]\n"
"\t[--noudevsync]\n"
@@ -109,7 +111,8 @@ xx(lvchange,
discards_ARG, detachprofile_ARG, force_ARG, ignorelockingfailure_ARG,
ignoremonitoring_ARG, major_ARG, minor_ARG, monitor_ARG, minrecoveryrate_ARG,
maxrecoveryrate_ARG, noudevsync_ARG, partial_ARG, permission_ARG,
- persistent_ARG, poll_ARG, readahead_ARG, resync_ARG, refresh_ARG, addtag_ARG,
+ persistent_ARG, poll_ARG, readahead_ARG, resync_ARG, refresh_ARG,
+ setactivationskip_ARG, ignoreactivationskip_ARG, addtag_ARG,
deltag_ARG, syncaction_ARG, sysinit_ARG, test_ARG, writebehind_ARG,
writemostly_ARG, zero_ARG)
@@ -781,6 +784,7 @@ xx(vgchange,
"\t[-h|--help] " "\n"
"\t[--ignorelockingfailure]\n"
"\t[--ignoremonitoring]\n"
+ "\t[-K|--ignoreactivationskip] \n"
"\t[--monitor {y|n}]\n"
"\t[--[vg]metadatacopies #copies] " "\n"
"\t[--poll {y|n}]\n"
@@ -803,10 +807,11 @@ xx(vgchange,
addtag_ARG, alloc_ARG, allocation_ARG, autobackup_ARG, activate_ARG,
available_ARG, clustered_ARG, deltag_ARG, detachprofile_ARG,
- ignorelockingfailure_ARG, ignoremonitoring_ARG, logicalvolume_ARG,
- maxphysicalvolumes_ARG, monitor_ARG, noudevsync_ARG, metadatacopies_ARG,
- vgmetadatacopies_ARG, partial_ARG, physicalextentsize_ARG, poll_ARG,
- refresh_ARG, resizeable_ARG, resizable_ARG, sysinit_ARG, test_ARG, uuid_ARG)
+ ignoreactivationskip_ARG, ignorelockingfailure_ARG, ignoremonitoring_ARG,
+ logicalvolume_ARG, maxphysicalvolumes_ARG, monitor_ARG, noudevsync_ARG,
+ metadatacopies_ARG, vgmetadatacopies_ARG, partial_ARG,
+ physicalextentsize_ARG, poll_ARG, refresh_ARG, resizeable_ARG,
+ resizable_ARG, sysinit_ARG, test_ARG, uuid_ARG)
xx(vgck,
"Check the consistency of volume group(s)",
diff --git a/tools/lvchange.c b/tools/lvchange.c
index f4b5d07..b3207d0 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -216,6 +216,12 @@ static int _lvchange_activate(struct cmd_context *cmd, struct logical_volume *lv
activate = (activation_change_t) arg_uint_value(cmd, activate_ARG, CHANGE_AY);
+ if (lv_activation_skip(lv, activate, arg_count(cmd, ignoreactivationskip_ARG), 0)) {
+ log_verbose("ACTIVATON_SKIP flag set for LV %s/%s, skipping activation.",
+ lv->vg->name, lv->name);
+ return 1;
+ }
+
if (lv_is_cow(lv) && !lv_is_virtual_origin(origin_from_cow(lv)))
lv = origin_from_cow(lv);
@@ -887,6 +893,23 @@ static int lvchange_profile(struct logical_volume *lv)
return 1;
}
+static int lvchange_activation_skip(struct logical_volume *lv)
+{
+ int skip = arg_int_value(lv->vg->cmd, setactivationskip_ARG, 0);
+
+ lv_set_activation_skip(lv, 1, skip);
+
+ log_verbose("Changing activation skip flag to %s for LV %s.",
+ lv->name, skip ? "enabled" : "disabled");
+
+ if (!vg_write(lv->vg) || !vg_commit(lv->vg))
+ return_0;
+
+ backup(lv->vg);
+
+ return 1;
+}
+
static int lvchange_single(struct cmd_context *cmd, struct logical_volume *lv,
void *handle __attribute__((unused)))
@@ -1059,6 +1082,13 @@ static int lvchange_single(struct cmd_context *cmd, struct logical_volume *lv,
docmds++;
}
+ if (arg_count(cmd, setactivationskip_ARG)) {
+ if (!archive(lv->vg))
+ return_ECMD_FAILED;
+ doit += lvchange_activation_skip(lv);
+ docmds++;
+ }
+
if (doit)
log_print_unless_silent("Logical volume \"%s\" changed.", lv->name);
@@ -1108,7 +1138,8 @@ int lvchange(struct cmd_context *cmd, int argc, char **argv)
arg_count(cmd, addtag_ARG) ||
arg_count(cmd, deltag_ARG) ||
arg_count(cmd, profile_ARG) ||
- arg_count(cmd, detachprofile_ARG);
+ arg_count(cmd, detachprofile_ARG) ||
+ arg_count(cmd, setactivationskip_ARG);
int update_partial_unsafe =
arg_count(cmd, resync_ARG) ||
arg_count(cmd, alloc_ARG) ||
diff --git a/tools/vgchange.c b/tools/vgchange.c
index d3e93f2..d41ef49 100644
--- a/tools/vgchange.c
+++ b/tools/vgchange.c
@@ -131,6 +131,12 @@ static int _activate_lvs_in_vg(struct cmd_context *cmd, struct volume_group *vg,
continue;
}
+ if (lv_activation_skip(lv, activate, arg_count(cmd, ignoreactivationskip_ARG), 0)) {
+ log_verbose("ACTIVATION_SKIP flag set for LV %s/%s, skipping activation.",
+ lv->vg->name, lv->name);
+ continue;
+ }
+
if ((activate == CHANGE_AAY) &&
!lv_passes_auto_activation_filter(cmd, lv))
continue;
10 years, 11 months
master - activation: add support for skipping activation of selected LVs
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7dc8c84b18cbd7...
Commit: 7dc8c84b18cbd71f01ce6350759adbca28df5f9b
Parent: 4d19fa9582a44a71a53647d6a7c6026955e805c7
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Jul 10 14:06:50 2013 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Jul 12 20:39:07 2013 +0200
activation: add support for skipping activation of selected LVs
Also add -k/--setactivationskip y/n and -K/--ignoreactivationskip
options to lvcreate.
The --setactivationskip y sets the flag in metadata for an LV to
skip the LV during activation. Also, the newly created LV is not
activated.
Thin snapsots have this flag set automatically if not specified
directly by the --setactivationskip y/n option.
The --ignoreactivationskip overrides the activation skip flag set
in metadata for an LV (just for the run of the command - the flag
is not changed in metadata!)
A few examples for the lvcreate with the new options:
(non-thin snap LV => skip flag not set in MDA + LV activated)
raw/~ $ lvcreate -l1 vg
Logical volume "lvol0" created
raw/~ $ lvs -o lv_name,attr vg/lvol0
LV Attr
lvol0 -wi-a----
(non-thin snap LV + -ky => skip flag set in MDA + LV not activated)
raw/~ $ lvcreate -l1 -ky vg
Logical volume "lvol1" created
raw/~ $ lvs -o lv_name,attr vg/lvol1
LV Attr
lvol1 -wi------
(non-thin snap LV + -ky + -K => skip flag set in MDA + LV activated)
raw/~ $ lvcreate -l1 -ky -K vg
Logical volume "lvol2" created
raw/~ $ lvs -o lv_name,attr vg/lvol2
LV Attr
lvol2 -wi-a----
(thin snap LV => skip flag set in MDA (default behaviour) + LV not activated)
raw/~ $ lvcreate -L100M -T vg/pool -V 1T -n thin_lv
Logical volume "thin_lv" created
raw/~ $ lvcreate -s vg/thin_lv -n thin_snap
Logical volume "thin_snap" created
raw/~ $ lvs -o name,attr vg
LV Attr
pool twi-a-tz-
thin_lv Vwi-a-tz-
thin_snap Vwi---tz-
(thin snap LV + -K => skip flag set in MDA (default behaviour) + LV activated)
raw/~ $ lvcreate -s vg/thin_lv -n thin_snap -K
Logical volume "thin_snap" created
raw/~ $ lvs -o name,attr vg/thin_lv
LV Attr
thin_lv Vwi-a-tz-
(thins snap LV + -kn => no skip flag in MDA (default behaviour overridden) + LV activated)
[0] raw/~ # lvcreate -s vg/thin_lv -n thin_snap -kn
Logical volume "thin_snap" created
[0] raw/~ # lvs -o name,attr vg/thin_snap
LV Attr
thin_snap Vwi-a-tz-
---
lib/format_text/flags.c | 1 +
lib/metadata/lv_manip.c | 54 ++++++++++++++++++++++++++++++++++++++
lib/metadata/metadata-exported.h | 17 ++++++++++++
man/lvcreate.8.in | 16 +++++++++++
tools/args.h | 2 +
tools/commands.h | 13 ++++++---
tools/lvcreate.c | 17 ++++++++++++
7 files changed, 116 insertions(+), 4 deletions(-)
diff --git a/lib/format_text/flags.c b/lib/format_text/flags.c
index cbccdfd..66dd86b 100644
--- a/lib/format_text/flags.c
+++ b/lib/format_text/flags.c
@@ -60,6 +60,7 @@ static const struct flag _lv_flags[] = {
{LV_NOTSYNCED, "NOTSYNCED", STATUS_FLAG},
{LV_REBUILD, "REBUILD", STATUS_FLAG},
{LV_WRITEMOSTLY, "WRITEMOSTLY", STATUS_FLAG},
+ {LV_ACTIVATION_SKIP, "ACTIVATION_SKIP", COMPATIBLE_FLAG},
{RAID, NULL, 0},
{RAID_META, NULL, 0},
{RAID_IMAGE, NULL, 0},
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 0941964..1dc1529 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -5277,6 +5277,51 @@ static struct logical_volume *_create_virtual_origin(struct cmd_context *cmd,
return lv;
}
+/*
+ * Automatically set ACTIVATION_SKIP flag for the LV supplied - this
+ * is default behaviour. If override_default is set, then override
+ * the default behaviour and add/clear the flag based on 'add_skip' arg
+ * supplied instead.
+ */
+void lv_set_activation_skip(struct logical_volume *lv, int override_default,
+ int add_skip)
+{
+ int skip;
+
+ /* override default behaviour */
+ if (override_default)
+ skip = add_skip;
+ /* default behaviour */
+ else if (lv_is_thin_volume(lv) && first_seg(lv)->origin)
+ skip = 1; /* skip activation for thin snapshots by default */
+ else
+ skip = 0;
+
+ if (skip)
+ lv->status |= LV_ACTIVATION_SKIP;
+ else
+ lv->status &= ~LV_ACTIVATION_SKIP;
+}
+
+/*
+ * Get indication whether the LV should be skipped during activation
+ * based on the ACTIVATION_SKIP flag (deactivation is never skipped!).
+ * If 'override_lv_skip_flag' is set, then override it based on the value
+ * of the 'skip' arg supplied instead.
+ */
+int lv_activation_skip(struct logical_volume *lv, activation_change_t activate,
+ int override_lv_skip_flag, int skip)
+{
+ /* Do not skip deactivation! */
+ if ((activate == CHANGE_AN) || (activate == CHANGE_ALN))
+ return 0;
+
+ if (override_lv_skip_flag)
+ return skip;
+
+ return (lv->status & LV_ACTIVATION_SKIP) ? 1 : 0;
+}
+
/* Thin notes:
* If lp->thin OR lp->activate is AY*, activate the pool if not already active.
* If lp->thin, create thin LV within the pool - as a snapshot if lp->snapshot.
@@ -5638,6 +5683,9 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg, struct l
}
}
+ lv_set_activation_skip(lv, lp->activation_skip & ACTIVATION_SKIP_SET,
+ lp->activation_skip & ACTIVATION_SKIP_SET_ENABLED);
+
/* store vg on disk(s) */
if (!vg_write(vg) || !vg_commit(vg))
return_NULL;
@@ -5658,6 +5706,12 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg, struct l
goto out;
}
+ if (lv_activation_skip(lv, lp->activate, lp->activation_skip & ACTIVATION_SKIP_IGNORE, 0)) {
+ log_verbose("ACTIVATION_SKIP flag set for LV %s/%s, skipping activation.",
+ lv->vg->name, lv->name);
+ lp->activate = CHANGE_AN;
+ }
+
if (seg_is_thin(lp)) {
/* For snapshot, suspend active thin origin first */
if (org && lv_is_active(org) && lv_is_thin_volume(org)) {
diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h
index a8e1a29..b571847 100644
--- a/lib/metadata/metadata-exported.h
+++ b/lib/metadata/metadata-exported.h
@@ -100,6 +100,8 @@
#define LV_WRITEMOSTLY UINT64_C(0x0000010000000000) /* LV (RAID1) */
+#define LV_ACTIVATION_SKIP UINT64_C(0x0000020000000000) /* LV */
+
/* Format features flags */
#define FMT_SEGMENTS 0x00000001U /* Arbitrary segment params? */
#define FMT_MDAS 0x00000002U /* Proper metadata areas? */
@@ -698,6 +700,10 @@ struct lvcreate_params {
int minor; /* all */
int log_count; /* mirror */
int nosync; /* mirror */
+#define ACTIVATION_SKIP_SET 0x01 /* request to set LV activation skip flag state */
+#define ACTIVATION_SKIP_SET_ENABLED 0x02 /* set the LV activation skip flag state to 'enabled' */
+#define ACTIVATION_SKIP_IGNORE 0x04 /* request to ignore LV activation skip flag (if any) */
+ int activation_skip; /* activation skip flags */
activation_change_t activate; /* non-snapshot, non-mirror */
thin_discards_t discards; /* thin */
@@ -746,6 +752,17 @@ struct logical_volume *lv_create_single(struct volume_group *vg,
struct lvcreate_params *lp);
/*
+ * The activation can be skipped for selected LVs. Some LVs are skipped
+ * by default (e.g. thin snapshots), others can be skipped on demand by
+ * overriding the default behaviour. The flag that causes the activation
+ * skip on next activations is stored directly in metadata for each LV
+ * as ACTIVATION_SKIP flag.
+ */
+void lv_set_activation_skip(struct logical_volume *lv, int override_default, int add_skip_flag);
+int lv_activation_skip(struct logical_volume *lv, activation_change_t activate,
+ int override_lv_skip_flag, int skip);
+
+/*
* Functions for layer manipulation
*/
int insert_layer_for_segments_on_pv(struct cmd_context *cmd,
diff --git a/man/lvcreate.8.in b/man/lvcreate.8.in
index ac5cf65..fd36e90 100644
--- a/man/lvcreate.8.in
+++ b/man/lvcreate.8.in
@@ -9,6 +9,9 @@ lvcreate \- create a logical volume in an existing volume group
.IR AllocationPolicy ]
.RB [ \-a | \-\-activate
.RI [ a | e | l ]{ y | n }]
+.RB [ \-k | \-\-setactivationskip
+.RI { y | n }]
+.RB [ \-K | \-\-ignoreactivationskip ]
.RB [ \-A | \-\-autobackup
.RI { y | n }]
.RB [ \-C | \-\-contiguous
@@ -136,6 +139,19 @@ and it can't 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 }
+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
+be used. The flag is not applied during deactivation.
+Use \fBlvchange \-k/\-\-setactivationskip {y | n}\fP command to attach or
+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
+Ignore the flag to skip Logical Volumes during activation.
+.TP
.BR \-c ", " \-\-chunksize " " \fIChunkSize [ \fIbBsSkKmMgG ]
Gives the size of chunk for snapshot and thin pool logical volumes.
Default unit is in kilobytes.
diff --git a/tools/args.h b/tools/args.h
index ee95ad8..cde0f91 100644
--- a/tools/args.h
+++ b/tools/args.h
@@ -136,6 +136,8 @@ arg(logicalextent_ARG, 'L', "logicalextent", int_arg_with_sign, 0)
arg(persistent_ARG, 'M', "persistent", yes_no_arg, 0)
arg(merge_ARG, '\0', "merge", NULL, 0)
arg(major_ARG, 'j', "major", int_arg, ARG_GROUPABLE)
+arg(setactivationskip_ARG, 'k', "setactivationskip", yes_no_arg, 0)
+arg(ignoreactivationskip_ARG, 'K', "ignoreactivationskip", NULL, 0)
arg(mirrors_ARG, 'm', "mirrors", int_arg_with_sign, 0)
arg(metadatatype_ARG, 'M', "metadatatype", metadatatype_arg, 0)
arg(maps_ARG, 'm', "maps", NULL, 0)
diff --git a/tools/commands.h b/tools/commands.h
index 98746b0..3d076c9 100644
--- a/tools/commands.h
+++ b/tools/commands.h
@@ -195,6 +195,8 @@ xx(lvcreate,
"\t[--ignoremonitoring]\n"
"\t[--monitor {y|n}]\n"
"\t[-i|--stripes Stripes [-I|--stripesize StripeSize]]\n"
+ "\t[-k|--setactivationskip {y|n}]\n"
+ "\t[-K|--ignoreactivationskip] \n"
"\t{-l|--extents LogicalExtentsNumber[%{VG|PVS|FREE}] |\n"
"\t -L|--size LogicalVolumeSize[bBsSkKmMgGtTpPeE]}\n"
"\t[-M|--persistent {y|n}] [--major major] [--minor minor]\n"
@@ -233,6 +235,8 @@ xx(lvcreate,
"\t[--ignoremonitoring]\n"
"\t[--monitor {y|n}]\n"
"\t[-i|--stripes Stripes [-I|--stripesize StripeSize]]\n"
+ "\t[-k|--activationskip {y|n}]\n"
+ "\t[-K|--ignoreactivationskip] \n"
"\t{-l|--extents LogicalExtentsNumber[%{VG|FREE|ORIGIN}] |\n"
"\t -L|--size LogicalVolumeSize[bBsSkKmMgGtTpPeE]}\n"
"\t[--poolmetadatasize MetadataVolumeSize[bBsSkKmMgG]]\n"
@@ -252,10 +256,11 @@ xx(lvcreate,
chunksize_ARG, contiguous_ARG, corelog_ARG, discards_ARG, extents_ARG,
ignoremonitoring_ARG, major_ARG, minor_ARG, mirrorlog_ARG, mirrors_ARG,
monitor_ARG, minrecoveryrate_ARG, maxrecoveryrate_ARG, name_ARG, nosync_ARG,
- noudevsync_ARG, permission_ARG,
- persistent_ARG, readahead_ARG, regionsize_ARG, size_ARG, snapshot_ARG,
- stripes_ARG, stripesize_ARG, test_ARG, thin_ARG, thinpool_ARG, type_ARG,
- virtualoriginsize_ARG, poolmetadatasize_ARG, virtualsize_ARG, zero_ARG)
+ noudevsync_ARG, ignoreactivationskip_ARG, setactivationskip_ARG,
+ permission_ARG, persistent_ARG, readahead_ARG, regionsize_ARG, size_ARG,
+ snapshot_ARG, stripes_ARG, stripesize_ARG, test_ARG, thin_ARG, thinpool_ARG,
+ type_ARG, virtualoriginsize_ARG, poolmetadatasize_ARG, virtualsize_ARG,
+ zero_ARG)
xx(lvdisplay,
"Display information about a logical volume",
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index 698d72f..f69c084 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -691,6 +691,23 @@ static int _read_activation_params(struct lvcreate_params *lp, struct cmd_contex
return 0;
}
+ if (arg_count(cmd, setactivationskip_ARG)) {
+ lp->activation_skip |= ACTIVATION_SKIP_SET;
+ if (arg_int_value(cmd, setactivationskip_ARG, 0))
+ lp->activation_skip |= ACTIVATION_SKIP_SET_ENABLED;
+ }
+
+ if (arg_count(cmd, ignoreactivationskip_ARG))
+ lp->activation_skip |= ACTIVATION_SKIP_IGNORE;
+
+ if (lp->zero && (lp->activation_skip & ACTIVATION_SKIP_SET_ENABLED)
+ && !(lp->activation_skip & ACTIVATION_SKIP_IGNORE)) {
+ log_error("--setactivationskip y requires either --zero n "
+ "or --ignoreactivationskip");
+ return 0;
+ }
+
+
return 1;
}
10 years, 11 months
master - lvchange: backup VG after changing profile
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4d19fa9582a44a...
Commit: 4d19fa9582a44a71a53647d6a7c6026955e805c7
Parent: 8e4a3dd9cb73e71df5f782f844da4cf461d76de6
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Jul 11 12:25:10 2013 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Jul 11 12:25:10 2013 +0200
lvchange: backup VG after changing profile
---
tools/lvchange.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/tools/lvchange.c b/tools/lvchange.c
index f7ce7fd..f4b5d07 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -882,6 +882,8 @@ static int lvchange_profile(struct logical_volume *lv)
if (!vg_write(lv->vg) || !vg_commit(lv->vg))
return_0;
+ backup(lv->vg);
+
return 1;
}
10 years, 11 months
master - lvm2api: Make the vg_list_* functions work with lvmetad (+ test).
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8e4a3dd9cb73e7...
Commit: 8e4a3dd9cb73e71df5f782f844da4cf461d76de6
Parent: 618d13705c233b8ab7290653228b17ee111479f4
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Thu Jul 11 08:01:04 2013 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Thu Jul 11 09:38:46 2013 +0200
lvm2api: Make the vg_list_* functions work with lvmetad (+ test).
---
liblvm/lvm_vg.c | 3 ++
test/api/Makefile.in | 2 +
test/api/vglist.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++
test/api/vglist.sh | 15 ++++++++++
4 files changed, 94 insertions(+), 0 deletions(-)
diff --git a/liblvm/lvm_vg.c b/liblvm/lvm_vg.c
index 4a5fdf5..35c7eea 100644
--- a/liblvm/lvm_vg.c
+++ b/liblvm/lvm_vg.c
@@ -18,6 +18,7 @@
#include "archiver.h"
#include "locking.h"
#include "lvmcache.h"
+#include "lvmetad.h"
#include "lvm_misc.h"
#include "lvm2app.h"
@@ -361,11 +362,13 @@ int lvm_vg_set_property(const vg_t vg, const char *name,
struct dm_list *lvm_list_vg_names(lvm_t libh)
{
+ lvmetad_vg_list_to_lvmcache((struct cmd_context *)libh);
return get_vgnames((struct cmd_context *)libh, 0);
}
struct dm_list *lvm_list_vg_uuids(lvm_t libh)
{
+ lvmetad_vg_list_to_lvmcache((struct cmd_context *)libh);
return get_vgids((struct cmd_context *)libh, 0);
}
diff --git a/test/api/Makefile.in b/test/api/Makefile.in
index 7ad6743..9a43548 100644
--- a/test/api/Makefile.in
+++ b/test/api/Makefile.in
@@ -22,6 +22,7 @@ SOURCES = test.c
TARGETS += \
lvtest.t \
+ vglist.t \
percent.t \
pe_start.t \
thin_percent.t \
@@ -29,6 +30,7 @@ TARGETS += \
SOURCES2 = \
lvtest.c \
+ vglist.c \
percent.c \
pe_start.c \
thin_percent.c \
diff --git a/test/api/vglist.c b/test/api/vglist.c
new file mode 100644
index 0000000..5939340
--- /dev/null
+++ b/test/api/vglist.c
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2009 Red Hat, Inc. All rights reserved.
+ *
+ * This file is part of LVM2.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License v.2.1.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <stdio.h>
+#include <unistd.h>
+#include <inttypes.h>
+#include <assert.h>
+
+#include "lvm2app.h"
+
+lvm_t handle;
+vg_t vg;
+
+static void start() {
+ handle = lvm_init(NULL);
+ if (!handle) {
+ fprintf(stderr, "Unable to lvm_init\n");
+ abort();
+ }
+}
+
+static void done(int ok) {
+ if (handle && lvm_errno(handle)) {
+ fprintf(stderr, "LVM Error: %s\n", lvm_errmsg(handle));
+ ok = 0;
+ }
+ if (handle)
+ lvm_quit(handle);
+ if (!ok)
+ abort();
+}
+
+int main(int argc, char *argv[])
+{
+ int status;
+
+ if (argc != 3)
+ abort();
+
+ lvm_str_list_t *str;
+
+ int i = 0;
+
+ start();
+ struct dm_list *vgnames = lvm_list_vg_names(handle);
+ dm_list_iterate_items(str, vgnames) {
+ assert(++i <= 1);
+ assert(!strcmp(str->str, argv[1]));
+ }
+ assert(i == 1);
+ done(1);
+
+ i = 0;
+ start();
+ struct dm_list *vgids = lvm_list_vg_uuids(handle);
+ dm_list_iterate_items(str, vgids) {
+ assert(++i <= 1);
+ assert(!strcmp(str->str, argv[2]));
+ }
+ assert(i == 1);
+ done(1);
+ return 0;
+}
diff --git a/test/api/vglist.sh b/test/api/vglist.sh
new file mode 100644
index 0000000..275c9d2
--- /dev/null
+++ b/test/api/vglist.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+# Copyright (C) 2013 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+. lib/test
+
+aux prepare_vg 2
+aux apitest vglist $vg `get vg_field $vg vg_uuid | sed -e s,-,,g`
10 years, 11 months
master - config: fix unterminated strings in arrays
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=618d13705c233b...
Commit: 618d13705c233b8ab7290653228b17ee111479f4
Parent: aaa9a68b2fc8a25377f4649b89b59a9893179633
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Tue Jul 9 13:41:44 2013 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Jul 9 13:49:58 2013 +0200
config: fix unterminated strings in arrays
...when creating config trees while calling config_def_create_tree fn
that constructs a tree out of config_settings.h definition
(CFG_DEF_TREE_NEW/MISSING/DEFAULT/PROFILABLE).
---
lib/config/config.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/lib/config/config.c b/lib/config/config.c
index e18e623..7e79dd7 100644
--- a/lib/config/config.c
+++ b/lib/config/config.c
@@ -1251,13 +1251,12 @@ static struct dm_config_value *_get_def_array_values(struct dm_config_tree *cft,
v->type = DM_CFG_FLOAT;
break;
case 'S':
- if (!(r = dm_pool_alloc(cft->mem, strlen(token + 1)))) {
+ if (!(r = dm_pool_strdup(cft->mem, token + 1))) {
dm_free(enc_value);
log_error("Failed to duplicate token for default "
"array value of %s.", def->name);
return NULL;
}
- memcpy(r, token + 1, strlen(token + 1));
v->v.str = r;
v->type = DM_CFG_STRING;
break;
10 years, 11 months
master - metadata: cleanup comments and formatting
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=aaa9a68b2fc8a2...
Commit: aaa9a68b2fc8a25377f4649b89b59a9893179633
Parent: 934616d4c759cd1dfe2b359fc83632999daf1ce8
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue Jul 9 12:34:48 2013 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Jul 9 12:34:48 2013 +0100
metadata: cleanup comments and formatting
---
lib/metadata/lv_manip.c | 5 ++-
lib/metadata/metadata.c | 65 +++++++++++++++++++++++++--------------------
lib/metadata/thin_manip.c | 6 ++--
liblvm/lvm_base.c | 4 +-
4 files changed, 44 insertions(+), 36 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 9d67e71..0941964 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -340,8 +340,9 @@ percent_t copy_percent(const struct logical_volume *lv)
dm_list_iterate_items(seg, &lv->segments) {
denominator += seg->area_len;
- if ((seg_is_raid(seg) || seg_is_mirrored(seg))
- && (seg->area_count > 1))
+ /* FIXME Generalise name of 'extents_copied' field */
+ if ((seg_is_raid(seg) || seg_is_mirrored(seg)) &&
+ (seg->area_count > 1))
numerator += seg->extents_copied;
else
numerator += seg->area_len;
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index ca6da86..96e1355 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -3727,12 +3727,13 @@ static int _get_pvs(struct cmd_context *cmd, int warnings,
continue;
}
- /* When we are retrieving a list to return toliblvm we need
+ /*
+ * When we are retrieving a list to return toliblvm we need
* that list to contain VGs that are modifiable as we are using
* the vgmem pool in the vg to provide allocation for liblvm.
* This is a hack to prevent the vg from getting cached as the
- * vgid will be NULL. There is most definitely a better way
- * to do this.
+ * vgid will be NULL.
+ * FIXME Remove this hack.
*/
if (!(vg = vg_read_internal(cmd, vgname, (!vgslist) ? vgid : NULL, warnings, &consistent))) {
stack;
@@ -3750,28 +3751,33 @@ static int _get_pvs(struct cmd_context *cmd, int warnings,
release_vg(vg);
return 0;
}
- /* If we are going to release the vg, don't store a pointer to
- * it in the pv structure.
+ /* If we are going to release the VG, don't
+ * store a pointer to it in the PV structure.
*/
- if (!vgslist) {
+ if (!vgslist)
pvl_copy->pv->vg = NULL;
- } else {
- /* Make sure the vg mode indicates writeable */
- /* We should rework this function to take a parameter */
- /* so that we could control this ... */
+ else
+ /*
+ * Make sure the vg mode indicates
+ * writeable.
+ * FIXME Rework function to take a
+ * parameter to control this
+ */
pvl_copy->pv->vg->open_mode = 'w';
- }
have_pv = 1;
dm_list_add(pvslist, &pvl_copy->list);
}
- /* In the case of the library we want to preserve the embedded volume
- * group as subsequent calls to retrieve data about the pv require it.
+ /*
+ * In the case of the library we want to preserve the embedded
+ * volume group as subsequent calls to retrieve data about the
+ * PV require it.
*/
- if (!vgslist || have_pv == 0) {
+ if (!vgslist || !have_pv)
release_vg(vg);
- } else {
- /* Add vg to list of vg objects that will be returned
+ else {
+ /*
+ * Add VG to list of VG objects that will be returned
*/
vgl_item = dm_pool_alloc(cmd->mem, sizeof(*vgl_item));
if (!vgl_item) {
@@ -3786,23 +3792,25 @@ static int _get_pvs(struct cmd_context *cmd, int warnings,
}
init_pvmove(old_pvmove);
- if (!pvslist) {
+ if (!pvslist)
dm_pool_free(cmd->mem, vgids);
- }
+
return 1;
}
-/* Retrieve a list of all physical volumes.
- * @param cmd Command context
- * @param pvslist Set to NULL if you want memory for list created,
- * else valid memory
- * @param vgslist Set to NULL if you need the pv structures to contain
- * valid vg pointer. This is the list of VGs
- * @returns NULL on errors, else pvslist which will equal passes in value if
- * supplied.
+/*
+ * Retrieve a list of all physical volumes.
+ * @param cmd Command context
+ * @param pvslist Set to NULL if you want memory for list created,
+ * else valid memory
+ * @param vgslist Set to NULL if you need the pv structures to contain
+ * valid vg pointer. This is the list of VGs
+ * @returns NULL on errors, else pvslist which will equal passed-in value if
+ * supplied.
*/
struct dm_list *get_pvs_internal(struct cmd_context *cmd,
- struct dm_list *pvslist, struct dm_list *vgslist)
+ struct dm_list *pvslist,
+ struct dm_list *vgslist)
{
struct dm_list *results = pvslist;
@@ -3816,9 +3824,8 @@ struct dm_list *get_pvs_internal(struct cmd_context *cmd,
}
if (!_get_pvs(cmd, 1, results, vgslist)) {
- if (NULL == pvslist) {
+ if (!pvslist)
dm_pool_free(cmd->mem, results);
- }
return NULL;
}
return results;
diff --git a/lib/metadata/thin_manip.c b/lib/metadata/thin_manip.c
index f40fd74..5b1b440 100644
--- a/lib/metadata/thin_manip.c
+++ b/lib/metadata/thin_manip.c
@@ -79,7 +79,7 @@ int detach_pool_lv(struct lv_segment *seg)
int no_update = 0;
if (!seg->pool_lv || !lv_is_thin_pool(seg->pool_lv)) {
- log_error(INTERNAL_ERROR "LV %s is not a thin volume",
+ log_error(INTERNAL_ERROR "Cannot detach pool from non-thin LV %s",
seg->lv->name);
return 0;
}
@@ -154,7 +154,7 @@ int attach_pool_message(struct lv_segment *pool_seg, dm_thin_message_t type,
struct lv_thin_message *tmsg;
if (!seg_is_thin_pool(pool_seg)) {
- log_error(INTERNAL_ERROR "LV %s is not pool.", pool_seg->lv->name);
+ log_error(INTERNAL_ERROR "Cannot attach message to non-pool LV %s.", pool_seg->lv->name);
return 0;
}
@@ -289,7 +289,7 @@ int pool_is_active(const struct logical_volume *lv)
const struct seg_list *sl;
if (!lv_is_thin_pool(lv)) {
- log_error(INTERNAL_ERROR "LV %s is not pool.", lv->name);
+ log_error(INTERNAL_ERROR "pool_is_active called with non-pool LV %s.", lv->name);
return 0;
}
diff --git a/liblvm/lvm_base.c b/liblvm/lvm_base.c
index 67ed023..b7603e3 100644
--- a/liblvm/lvm_base.c
+++ b/liblvm/lvm_base.c
@@ -67,8 +67,8 @@ lvm_t lvm_init(const char *system_dir)
cmd->cmd_line = "liblvm";
/*
- * Turn off writing to stderr etc., not sure if there is a better way
- * to do this?
+ * Turn off writing to stdout/stderr.
+ * FIXME Fix lib/ to support a non-interactive mode instead.
*/
log_suppress(1);
10 years, 11 months
master - dumpconfig: honour --atversion with --type profilable
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=934616d4c759cd...
Commit: 934616d4c759cd1dfe2b359fc83632999daf1ce8
Parent: 953a438e93a1adb0df7c7931cd6271b9d32acd7d
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Tue Jul 9 10:23:46 2013 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Jul 9 10:23:46 2013 +0200
dumpconfig: honour --atversion with --type profilable
raw/~ $ lvm dumpconfig --type profilable
allocation {
thin_pool_zero=1
thin_pool_discards="passdown"
thin_pool_chunk_size=64
}
activation {
thin_pool_autoextend_threshold=100
thin_pool_autoextend_percent=20
}
raw/~ $ lvm dumpconfig --type profilable --atversion 2.2.90
activation {
thin_pool_autoextend_threshold=100
thin_pool_autoextend_percent=20
}
---
lib/config/config.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/lib/config/config.c b/lib/config/config.c
index 7c4f8ba..e18e623 100644
--- a/lib/config/config.c
+++ b/lib/config/config.c
@@ -1371,7 +1371,8 @@ static int _should_skip_def_node(struct config_def_tree_spec *spec, int section_
return 1;
break;
case CFG_DEF_TREE_PROFILABLE:
- if (!(def->flags & CFG_PROFILABLE))
+ if (!(def->flags & CFG_PROFILABLE) ||
+ (def->since_version > spec->version))
return 1;
break;
default:
10 years, 11 months
master - dumpconfig: add --type profilable
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=953a438e93a1ad...
Commit: 953a438e93a1adb0df7c7931cd6271b9d32acd7d
Parent: f56a1819e90900487d6d58485dd658944922f251
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Tue Jul 9 09:57:46 2013 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Jul 9 10:00:47 2013 +0200
dumpconfig: add --type profilable
The --type profilable shows all config settings that
are customizable by profiles:
raw/~ $ lvm dumpconfig --type profilable
allocation {
thin_pool_zero=1
thin_pool_discards="passdown"
thin_pool_chunk_size=64
}
activation {
thin_pool_autoextend_threshold=100
thin_pool_autoextend_percent=20
}
---
WHATS_NEW | 1 +
lib/config/config.c | 4 ++++
lib/config/config.h | 3 ++-
tools/commands.h | 2 +-
tools/dumpconfig.c | 4 ++++
5 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 68b3b78..b3b846c 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.99 -
===================================
+ Add --type profilable to lvm dumpconfig to show profilable config settings.
Add --mergedconfig to lvm dumpconfig for merged --config/--profile/lvm.conf.
Relase memory and unblock signals in lock_vol error path.
Define LVM2_* command errors in lvm2cmd.h and use in dmeventd plugins.
diff --git a/lib/config/config.c b/lib/config/config.c
index 4c1b415..7c4f8ba 100644
--- a/lib/config/config.c
+++ b/lib/config/config.c
@@ -1370,6 +1370,10 @@ static int _should_skip_def_node(struct config_def_tree_spec *spec, int section_
if (def->since_version != spec->version)
return 1;
break;
+ case CFG_DEF_TREE_PROFILABLE:
+ if (!(def->flags & CFG_PROFILABLE))
+ return 1;
+ break;
default:
if (def->since_version > spec->version)
return 1;
diff --git a/lib/config/config.h b/lib/config/config.h
index 94fd1d9..263da4f 100644
--- a/lib/config/config.h
+++ b/lib/config/config.h
@@ -101,7 +101,8 @@ typedef enum {
CFG_DEF_TREE_MISSING, /* tree of nodes missing in current config using default values */
CFG_DEF_TREE_COMPLETE, /* CURRENT + MISSING, the tree actually used within execution, not implemented yet */
CFG_DEF_TREE_DEFAULT, /* tree of all possible config nodes with default values */
- CFG_DEF_TREE_NEW /* tree of all new nodes that appeared in given version */
+ CFG_DEF_TREE_NEW, /* tree of all new nodes that appeared in given version */
+ CFG_DEF_TREE_PROFILABLE /* tree of all nodes that are customizable by profiles */
} cfg_def_tree_t;
/* configuration definition tree specification */
diff --git a/tools/commands.h b/tools/commands.h
index 3f43260..98746b0 100644
--- a/tools/commands.h
+++ b/tools/commands.h
@@ -33,7 +33,7 @@ xx(dumpconfig,
PERMITTED_READ_ONLY,
"dumpconfig\n"
"\t[-f|--file filename] \n"
- "\t[--type {current|default|missing|new} \n"
+ "\t[--type {current|default|missing|new|profilable} \n"
"\t[--withcomments] \n"
"\t[--withversions] \n"
"\t[--ignoreadvanced] \n"
diff --git a/tools/dumpconfig.c b/tools/dumpconfig.c
index 08f996a..da216f5 100644
--- a/tools/dumpconfig.c
+++ b/tools/dumpconfig.c
@@ -182,6 +182,10 @@ int dumpconfig(struct cmd_context *cmd, int argc, char **argv)
tree_spec.type = CFG_DEF_TREE_NEW;
/* new type does not require check status */
}
+ else if (!strcmp(type, "profilable")) {
+ tree_spec.type = CFG_DEF_TREE_PROFILABLE;
+ /* profilable type does not require check status */
+ }
else {
log_error("Incorrect type of configuration specified. "
"Expected one of: current, default, missing, new.");
10 years, 11 months
master - tools: remove metadata-exported.h
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f56a1819e90900...
Commit: f56a1819e90900487d6d58485dd658944922f251
Parent: 9d5bdc91ca51737be82c463e05e5818a833a1fea
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue Jul 9 03:07:55 2013 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Jul 9 03:07:55 2013 +0100
tools: remove metadata-exported.h
metadata-exported.h is included by tools.h
---
lib/metadata/metadata-exported.h | 1 +
lib/metadata/metadata.h | 1 -
tools/pvcreate.c | 1 -
tools/pvresize.c | 1 -
tools/vgck.c | 1 -
5 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h
index ef192d3..a8e1a29 100644
--- a/lib/metadata/metadata-exported.h
+++ b/lib/metadata/metadata-exported.h
@@ -572,6 +572,7 @@ int pv_analyze(struct cmd_context *cmd, const char *pv_name,
/* FIXME: move internal to library */
uint32_t pv_list_extents_free(const struct dm_list *pvh);
+int vg_validate(struct volume_group *vg);
struct volume_group *vg_create(struct cmd_context *cmd, const char *vg_name);
int vg_remove_mdas(struct volume_group *vg);
int vg_remove_check(struct volume_group *vg);
diff --git a/lib/metadata/metadata.h b/lib/metadata/metadata.h
index d313198..c2a20cb 100644
--- a/lib/metadata/metadata.h
+++ b/lib/metadata/metadata.h
@@ -337,7 +337,6 @@ struct format_handler {
unsigned long set_pe_align(struct physical_volume *pv, unsigned long data_alignment);
unsigned long set_pe_align_offset(struct physical_volume *pv,
unsigned long data_alignment_offset);
-int vg_validate(struct volume_group *vg);
int pv_write_orphan(struct cmd_context *cmd, struct physical_volume *pv);
diff --git a/tools/pvcreate.c b/tools/pvcreate.c
index cbd1a59..958e353 100644
--- a/tools/pvcreate.c
+++ b/tools/pvcreate.c
@@ -14,7 +14,6 @@
*/
#include "tools.h"
-#include "metadata-exported.h"
/*
* Intial sanity checking of recovery-related command-line arguments.
diff --git a/tools/pvresize.c b/tools/pvresize.c
index 8004700..faf3134 100644
--- a/tools/pvresize.c
+++ b/tools/pvresize.c
@@ -15,7 +15,6 @@
*/
#include "tools.h"
-#include "metadata-exported.h"
struct pvresize_params {
uint64_t new_size;
diff --git a/tools/vgck.c b/tools/vgck.c
index e9c26a6..eb0ecaf 100644
--- a/tools/vgck.c
+++ b/tools/vgck.c
@@ -14,7 +14,6 @@
*/
#include "tools.h"
-#include "metadata-exported.h"
static int vgck_single(struct cmd_context *cmd __attribute__((unused)),
const char *vg_name,
10 years, 11 months