master - tests: update to not run vgconvert -M with lvmetad
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c7290759b059c6...
Commit: c7290759b059c65e2dbd56e498186b4b8acc8315
Parent: f5cc96a54e9563b8aa5445a049facbe30a59fb39
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Mar 10 09:59:52 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Mar 10 09:59:52 2015 -0500
tests: update to not run vgconvert -M with lvmetad
---
test/shell/metadata.sh | 3 +++
test/shell/pvcreate-usage.sh | 12 ++++++++++++
2 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/test/shell/metadata.sh b/test/shell/metadata.sh
index 3adb684..251942f 100644
--- a/test/shell/metadata.sh
+++ b/test/shell/metadata.sh
@@ -57,6 +57,9 @@ check pv_field "$dev3" pe_start $pv_align
pvs --units k -o name,pe_start,vg_mda_size,vg_name $(cat DEVICES)
+# vgconvert -M does not work with lvmetad
+test -e LOCAL_LVMETAD && exit 0
+
# upgrade from v1 to v2 metadata
vgconvert -M2 $vg
diff --git a/test/shell/pvcreate-usage.sh b/test/shell/pvcreate-usage.sh
index 48d2ceb..5e916c3 100644
--- a/test/shell/pvcreate-usage.sh
+++ b/test/shell/pvcreate-usage.sh
@@ -131,18 +131,30 @@ check pv_field "$dev1" pv_mda_count 2
#COMM 'pv with LVM1 compatible data alignment can be convereted'
#compatible == LVM1_PE_ALIGN == 64k
+if test ! -e LOCAL_LVMETAD; then
pvcreate --dataalignment 256k "$dev1"
vgcreate -s 1m $vg "$dev1"
vgconvert -M1 $vg
vgconvert -M2 $vg
check pv_field "$dev1" pe_start 256.00k
vgremove $vg
+fi
#COMM 'pv with LVM1 incompatible data alignment cannot be convereted'
+if test ! -e LOCAL_LVMETAD; then
pvcreate --dataalignment 10k "$dev1"
vgcreate -s 1m $vg "$dev1"
not vgconvert -M1 $vg
vgremove $vg
+fi
+
+#COMM 'vgconvert -M is disallowed with lvmetad'
+if test -e LOCAL_LVMETAD; then
+pvcreate "$dev1"
+vgcreate $vg "$dev1"
+not vgconvert -M1 $vg
+vgremove $vg
+fi
#COMM 'vgcfgrestore allows pe_start=0'
#basically it produces nonsense, but it tests vgcfgrestore,
8 years, 3 months
master - WHATS_NEW vgconvert -M fix
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f5cc96a54e9563...
Commit: f5cc96a54e9563b8aa5445a049facbe30a59fb39
Parent: 321e19d9cc868ae475ea1a0a4b026bf5b84ccd5a
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Mar 10 09:38:43 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Mar 10 09:38:43 2015 -0500
WHATS_NEW vgconvert -M fix
---
WHATS_NEW | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 680879d..b4fd415 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.118 -
=================================
+ Disallow vgconvert from changing metadata format when lvmetad is used.
Don't do a full read of VG when creating a new VG with an existing name.
Reduce number of VG metadata parsing when looking for vgname on a PV.
Avoid reparsing same metadata when reading same metadata from multiple PVs.
8 years, 3 months
master - vgconvert: require lvmetad to not be used
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=321e19d9cc868a...
Commit: 321e19d9cc868ae475ea1a0a4b026bf5b84ccd5a
Parent: 5dbcbbea58508854904dafe054945ea48baa1642
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Mar 10 09:31:54 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Mar 10 09:31:54 2015 -0500
vgconvert: require lvmetad to not be used
lvmetad does not work with lvm1/format1 metadata,
and vgconvert -M converts to or from lvm1 metadata,
so disallow vgconvert -M when lvmetad is used.
---
tools/vgconvert.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/tools/vgconvert.c b/tools/vgconvert.c
index 3742237..c4bb37a 100644
--- a/tools/vgconvert.c
+++ b/tools/vgconvert.c
@@ -214,6 +214,11 @@ int vgconvert(struct cmd_context *cmd, int argc, char **argv)
return EINVALID_CMD_LINE;
}
+ if (arg_is_set(cmd, metadatatype_ARG) && lvmetad_used()) {
+ log_error("lvmetad must be disabled to change metadata types.");
+ return EINVALID_CMD_LINE;
+ }
+
if (arg_int_value(cmd, labelsector_ARG, 0) >= LABEL_SCAN_SECTORS) {
log_error("labelsector must be less than %lu",
LABEL_SCAN_SECTORS);
8 years, 3 months
master - libdaemon: map error level properly
by okozina
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5dbcbbea585088...
Commit: 5dbcbbea58508854904dafe054945ea48baa1642
Parent: 0982c5c79f3467bcff1d64ac12cb30b25d446a5a
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Tue Mar 10 14:35:29 2015 +0100
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Tue Mar 10 14:42:40 2015 +0100
libdaemon: map error level properly
internal daemon error log level was wrongly mapped to debug syslog
level causing most error messages were lost in non-debug mode.
---
libdaemon/server/daemon-log.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/libdaemon/server/daemon-log.c b/libdaemon/server/daemon-log.c
index 91900af..87ad547 100644
--- a/libdaemon/server/daemon-log.c
+++ b/libdaemon/server/daemon-log.c
@@ -20,6 +20,7 @@ static void log_syslog(log_state *s, void **state, int type, const char *message
switch (type) {
case DAEMON_LOG_INFO: prio = LOG_INFO; break;
case DAEMON_LOG_WARN: prio = LOG_WARNING; break;
+ case DAEMON_LOG_ERROR: prio = LOG_ERR; break;
case DAEMON_LOG_FATAL: prio = LOG_CRIT; break;
default: prio = LOG_DEBUG; break;
}
8 years, 3 months
master - configure: check for sync-nand
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0982c5c79f3467...
Commit: 0982c5c79f3467bcff1d64ac12cb30b25d446a5a
Parent: 47b704462eea3c93ab5f46d970e5a74a4a5d4e70
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Mar 10 13:36:55 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Mar 10 14:10:18 2015 +0100
configure: check for sync-nand
Check whether gcc support this flag.
Some older compilers (gcc version 4.3.2) miss it.
---
configure | 39 +++++++++++++++++++++++++++++++++++++++
configure.in | 2 ++
make.tmpl.in | 6 +++++-
3 files changed, 46 insertions(+), 1 deletions(-)
diff --git a/configure b/configure
index c5c3b85..d85e7c9 100755
--- a/configure
+++ b/configure
@@ -749,6 +749,7 @@ CUNIT_CFLAGS
GENPNG
GENHTML
LCOV
+HAVE_WSYNCNAND
HAVE_WCLOBBERED
HAVE_WJUMP
SACKPT_LIBS
@@ -10214,6 +10215,44 @@ $as_echo "$ac_cv_flag_HAVE_WCLOBBERED" >&6; }
+
+ ac_save_CFLAGS=$CFLAGS
+ CFLAGS=-Wsync-nand
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Wsync-nand flag" >&5
+$as_echo_n "checking whether $CC accepts -Wsync-nand flag... " >&6; }
+if ${ac_cv_flag_HAVE_WSYNCNAND+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_flag_HAVE_WSYNCNAND=yes
+else
+ ac_cv_flag_HAVE_WSYNCNAND=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_flag_HAVE_WSYNCNAND" >&5
+$as_echo "$ac_cv_flag_HAVE_WSYNCNAND" >&6; }
+ CFLAGS=$ac_save_CFLAGS
+ HAVE_WSYNCNAND=$ac_cv_flag_HAVE_WSYNCNAND
+ if test "HAVE_WSYNCNAND" = yes; then
+ :
+ else
+ :
+ fi
+
+
+
################################################################################
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C optimisation flag" >&5
$as_echo_n "checking for C optimisation flag... " >&6; }
diff --git a/configure.in b/configure.in
index 15d371b..55c13a6 100644
--- a/configure.in
+++ b/configure.in
@@ -962,6 +962,8 @@ AC_TRY_CCFLAG([-Wjump-misses-init], [HAVE_WJUMP], [], [])
AC_SUBST(HAVE_WJUMP)
AC_TRY_CCFLAG([-Wclobbered], [HAVE_WCLOBBERED], [], [])
AC_SUBST(HAVE_WCLOBBERED)
+AC_TRY_CCFLAG([-Wsync-nand], [HAVE_WSYNCNAND], [], [])
+AC_SUBST(HAVE_WSYNCNAND)
################################################################################
dnl -- Override optimisation
diff --git a/make.tmpl.in b/make.tmpl.in
index 72e2613..11721f1 100644
--- a/make.tmpl.in
+++ b/make.tmpl.in
@@ -156,7 +156,11 @@ endif
ifeq ("@HAVE_WCLOBBERED@", "yes")
WFLAGS += -Wclobbered -Wempty-body -Wignored-qualifiers \
-Wmissing-parameter-type -Wold-style-declaration -Woverride-init \
- -Wtype-limits -Wsync-nand -Wlogical-op
+ -Wtype-limits -Wlogical-op
+endif
+
+ifeq ("@HAVE_WSYNCNAND@", "yes")
+WFLAGS += -Wsync-nand
endif
ifneq ("@STATIC_LINK@", "yes")
8 years, 3 months
master - display: fix return values
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=47b704462eea3c...
Commit: 47b704462eea3c93ab5f46d970e5a74a4a5d4e70
Parent: 1d3711c0b2a1679b18e0ee3032c5d38149a6619b
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Mar 9 14:16:41 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Mar 10 14:10:18 2015 +0100
display: fix return values
Return 1 on success in pvdisplay_short() and lvdisplay_full()
so commands like vgdisplay are not printinig stracktraces
on successful passes.
As the results of fail/success have been internally ignored for those
calls, it had no other visible side effect - command's return value was
still 0 (success).
---
lib/display/display.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/lib/display/display.c b/lib/display/display.c
index cf3c7f6..2cc5d27 100644
--- a/lib/display/display.c
+++ b/lib/display/display.c
@@ -385,7 +385,7 @@ int pvdisplay_short(const struct cmd_context *cmd __attribute__((unused)),
char uuid[64] __attribute__((aligned(8)));
if (!pv)
- return 0;
+ return_0;
if (!id_write_format(&pv->id, uuid, sizeof(uuid)))
return_0;
@@ -399,7 +399,8 @@ int pvdisplay_short(const struct cmd_context *cmd __attribute__((unused)),
pv->pe_count, pv->pe_count - pv->pe_alloc_count);
log_print(" ");
- return 0;
+
+ return 1; /* ECMD_PROCESSED */
}
void lvdisplay_colons(const struct logical_volume *lv)
@@ -623,7 +624,7 @@ int lvdisplay_full(struct cmd_context *cmd,
log_print(" ");
- return 0;
+ return 1; /* ECMD_PROCESSED */
}
void display_stripe(const struct lv_segment *seg, uint32_t s, const char *pre)
8 years, 3 months
master - format_text: Set system id directly.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1d3711c0b2a167...
Commit: 1d3711c0b2a1679b18e0ee3032c5d38149a6619b
Parent: 379d9ec8ec1a07b8fd218ab155ed7f6e611d8c73
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Mon Mar 9 19:33:27 2015 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Mon Mar 9 19:33:27 2015 +0000
format_text: Set system id directly.
Rearrange _read_vg code to set the appropriate system id field directly.
---
lib/format_text/import_vsn1.c | 22 ++++++++++------------
1 files changed, 10 insertions(+), 12 deletions(-)
diff --git a/lib/format_text/import_vsn1.c b/lib/format_text/import_vsn1.c
index f930c08..1569aaa 100644
--- a/lib/format_text/import_vsn1.c
+++ b/lib/format_text/import_vsn1.c
@@ -739,11 +739,10 @@ static struct volume_group *_read_vg(struct format_instance *fid,
{
const struct dm_config_node *vgn;
const struct dm_config_value *cv;
- const char *str, *format_str;
+ const char *str, *format_str, *system_id;
struct volume_group *vg;
struct dm_hash_table *pv_hash = NULL, *lv_hash = NULL;
unsigned scan_done_once = use_cached_pvs;
- char *system_id;
uint64_t vgstatus;
/* skip any top-level values */
@@ -758,10 +757,6 @@ static struct volume_group *_read_vg(struct format_instance *fid,
if (!(vg = alloc_vg("read_vg", fid->fmt->cmd, vgn->key)))
return_NULL;
- if (!(system_id = dm_pool_zalloc(vg->vgmem, NAME_LEN + 1)))
- goto_bad;
- vg->system_id = system_id;
-
/*
* The pv hash memorises the pv section names -> pv
* structures.
@@ -789,9 +784,6 @@ static struct volume_group *_read_vg(struct format_instance *fid,
goto bad;
}
- if (dm_config_get_str(vgn, "system_id", &str))
- strncpy(system_id, str, NAME_LEN);
-
if (dm_config_get_str(vgn, "lock_type", &str)) {
if (!(vg->lock_type = dm_pool_strdup(vg->vgmem, str)))
goto bad;
@@ -817,9 +809,15 @@ static struct volume_group *_read_vg(struct format_instance *fid,
/*
* A system id without WRITE_LOCKED is an old lvm1 system id.
*/
- if (!(vgstatus & LVM_WRITE_LOCKED) && system_id[0]) {
- memcpy(vg->lvm1_system_id, system_id, NAME_LEN + 1);
- memset(system_id, 0, NAME_LEN + 1);
+ if (dm_config_get_str(vgn, "system_id", &system_id)) {
+ if (!(vgstatus & LVM_WRITE_LOCKED)) {
+ if (!(vg->lvm1_system_id = dm_pool_zalloc(vg->vgmem, NAME_LEN + 1)))
+ goto_bad;
+ strncpy(vg->lvm1_system_id, system_id, NAME_LEN);
+ } else if (!(vg->system_id = dm_pool_strdup(vg->vgmem, system_id))) {
+ log_error("Failed to allocate memory for system_id in _read_vg.");
+ goto bad;
+ }
}
if (vgstatus & LVM_WRITE_LOCKED) {
8 years, 3 months
master - systemid: Use temp status var for LVM_WRITE_LOCKED
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=379d9ec8ec1a07...
Commit: 379d9ec8ec1a07b8fd218ab155ed7f6e611d8c73
Parent: 458b0210d1b4195171992f112aeb3a798d4509a3
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Mon Mar 9 19:18:14 2015 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Mon Mar 9 19:18:14 2015 +0000
systemid: Use temp status var for LVM_WRITE_LOCKED
---
lib/format_text/import_vsn1.c | 23 +++++++++++++----------
1 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/lib/format_text/import_vsn1.c b/lib/format_text/import_vsn1.c
index 837af6b..f930c08 100644
--- a/lib/format_text/import_vsn1.c
+++ b/lib/format_text/import_vsn1.c
@@ -531,7 +531,7 @@ static int _read_lvnames(struct format_instance *fid __attribute__((unused)),
const char *str;
const struct dm_config_value *cv;
const char *hostname;
- uint64_t timestamp = 0;
+ uint64_t timestamp = 0, lvstatus;
if (!(lv = alloc_lv(mem)))
return_0;
@@ -544,16 +544,17 @@ static int _read_lvnames(struct format_instance *fid __attribute__((unused)),
return 0;
}
- if (!_read_flag_config(lvn, &lv->status, LV_FLAGS)) {
+ if (!_read_flag_config(lvn, &lvstatus, LV_FLAGS)) {
log_error("Couldn't read status flags for logical volume %s.",
lv->name);
return 0;
}
- if (lv->status & LVM_WRITE_LOCKED) {
- lv->status |= LVM_WRITE;
- lv->status &= ~LVM_WRITE_LOCKED;
+ if (lvstatus & LVM_WRITE_LOCKED) {
+ lvstatus |= LVM_WRITE;
+ lvstatus &= ~LVM_WRITE_LOCKED;
}
+ lv->status = lvstatus;
if (dm_config_has_node(lvn, "creation_time")) {
if (!_read_uint64(lvn, "creation_time", ×tamp)) {
@@ -743,6 +744,7 @@ static struct volume_group *_read_vg(struct format_instance *fid,
struct dm_hash_table *pv_hash = NULL, *lv_hash = NULL;
unsigned scan_done_once = use_cached_pvs;
char *system_id;
+ uint64_t vgstatus;
/* skip any top-level values */
for (vgn = cft->root; (vgn && vgn->v); vgn = vgn->sib)
@@ -806,7 +808,7 @@ static struct volume_group *_read_vg(struct format_instance *fid,
goto bad;
}
- if (!_read_flag_config(vgn, &vg->status, VG_FLAGS)) {
+ if (!_read_flag_config(vgn, &vgstatus, VG_FLAGS)) {
log_error("Error reading flags of volume group %s.",
vg->name);
goto bad;
@@ -815,15 +817,16 @@ static struct volume_group *_read_vg(struct format_instance *fid,
/*
* A system id without WRITE_LOCKED is an old lvm1 system id.
*/
- if (!(vg->status & LVM_WRITE_LOCKED) && system_id[0]) {
+ if (!(vgstatus & LVM_WRITE_LOCKED) && system_id[0]) {
memcpy(vg->lvm1_system_id, system_id, NAME_LEN + 1);
memset(system_id, 0, NAME_LEN + 1);
}
- if (vg->status & LVM_WRITE_LOCKED) {
- vg->status |= LVM_WRITE;
- vg->status &= ~LVM_WRITE_LOCKED;
+ if (vgstatus & LVM_WRITE_LOCKED) {
+ vgstatus |= LVM_WRITE;
+ vgstatus &= ~LVM_WRITE_LOCKED;
}
+ vg->status = vgstatus;
if (!_read_int32(vgn, "extent_size", &vg->extent_size)) {
log_error("Couldn't read extent size for volume group %s.",
8 years, 3 months
master - vgchange: Additional system ID warnings.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=458b0210d1b419...
Commit: 458b0210d1b4195171992f112aeb3a798d4509a3
Parent: 1334ea214ea1f55173f2ff7e3045cc72a8c4e7c7
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Mon Mar 9 19:03:11 2015 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Mon Mar 9 19:03:11 2015 +0000
vgchange: Additional system ID warnings.
Also prompt before setting a system ID on a VG when none is set
on the host.
Put quotes round system ID in messages where it could be blank.
---
tools/vgchange.c | 57 ++++++++++++++++++++++++++++-------------------------
1 files changed, 30 insertions(+), 27 deletions(-)
diff --git a/tools/vgchange.c b/tools/vgchange.c
index 36b44a9..88a85d8 100644
--- a/tools/vgchange.c
+++ b/tools/vgchange.c
@@ -536,42 +536,45 @@ static int _vgchange_system_id(struct cmd_context *cmd, struct volume_group *vg)
}
if (!strcmp(vg->system_id, system_id)) {
- log_error("Volume Group system ID is already %s", vg->system_id);
+ log_error("Volume Group system ID is already \"%s\".", vg->system_id);
return 0;
}
- if (cmd->system_id && strcmp(system_id, cmd->system_id)) {
- if (!*system_id) {
- log_warn("WARNING: Removing the system ID allows unsafe access from other hosts.");
+ if (!*system_id && cmd->system_id && strcmp(system_id, cmd->system_id)) {
+ log_warn("WARNING: Removing the system ID allows unsafe access from other hosts.");
- if (!arg_count(cmd, yes_ARG) &&
- yes_no_prompt("Remove system ID %s on volume group %s? [y/n]: ",
- vg->system_id, vg->name) == 'n') {
- log_error("Volume group %s system ID not changed.", vg->name);
- return 0;
- }
- } else {
- if (lvs_in_vg_activated(vg)) {
- log_error("Logical Volumes in VG %s must be deactivated before system ID can be changed.",
- vg->name);
- return 0;
- }
+ if (!arg_count(cmd, yes_ARG) &&
+ yes_no_prompt("Remove system ID %s from volume group %s? [y/n]: ",
+ vg->system_id, vg->name) == 'n') {
+ log_error("System ID of volume group %s not changed.", vg->name);
+ return 0;
+ }
+ }
- log_warn("WARNING: Requested system ID %s does not match local system ID %s",
- system_id, cmd->system_id);
- log_warn("WARNING: Volume group %s might become inaccessible from this machine.",
- vg->name);
+ if (*system_id && (!cmd->system_id || strcmp(system_id, cmd->system_id))) {
+ if (lvs_in_vg_activated(vg)) {
+ log_error("Logical Volumes in VG %s must be deactivated before system ID can be changed.",
+ vg->name);
+ return 0;
+ }
- if (!arg_count(cmd, yes_ARG) &&
- yes_no_prompt("Set foreign system ID %s on volume group %s? [y/n]: ",
- system_id, vg->name) == 'n') {
- log_error("Volume group %s system ID not changed.", vg->name);
- return 0;
- }
+ if (cmd->system_id)
+ log_warn("WARNING: Requested system ID %s does not match local system ID %s.",
+ system_id, cmd->system_id ? : "");
+ else
+ log_warn("WARNING: No local system ID is set.");
+ log_warn("WARNING: Volume group %s might become inaccessible from this machine.",
+ vg->name);
+
+ if (!arg_count(cmd, yes_ARG) &&
+ yes_no_prompt("Set foreign system ID %s on volume group %s? [y/n]: ",
+ system_id, vg->name) == 'n') {
+ log_error("Volume group %s system ID not changed.", vg->name);
+ return 0;
}
}
- log_verbose("Changing system ID for VG %s from %s to %s.",
+ log_verbose("Changing system ID for VG %s from \"%s\" to \"%s\".",
vg->name, vg->system_id, system_id);
vg->system_id = system_id;
8 years, 3 months
master - vgconvert: Check system ID compatibility.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1334ea214ea1f5...
Commit: 1334ea214ea1f55173f2ff7e3045cc72a8c4e7c7
Parent: a8545462349c560cf66362cb3d25b44b7b0e819b
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Mon Mar 9 19:01:12 2015 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Mon Mar 9 19:01:12 2015 +0000
vgconvert: Check system ID compatibility.
If system ID is set, don't switch to a format that doesn't support it.
---
tools/vgconvert.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/tools/vgconvert.c b/tools/vgconvert.c
index 50b3e44..3742237 100644
--- a/tools/vgconvert.c
+++ b/tools/vgconvert.c
@@ -94,6 +94,13 @@ static int vgconvert_single(struct cmd_context *cmd, const char *vg_name,
return ECMD_FAILED;
}
+ /* New-style system ID supported? */
+ if (vg->system_id && *vg->system_id && (cmd->fmt->features & FMT_SYSTEMID_ON_PVS)) {
+ log_error("Unable to convert VG %s while it has a system ID set (%s).", vg->name,
+ vg->system_id);
+ return ECMD_FAILED;
+ }
+
/* Attempt to change any LVIDs that are too big */
if (cmd->fmt->features & FMT_RESTRICTED_LVIDS) {
dm_list_iterate_items(lvl, &vg->lvs) {
8 years, 3 months