Skip to contentSkip to conversation

master - vgconvert: Check system ID compatibility.

PATCH Alasdair Kergon 1 participant 1 message Mar 9, 2015

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1334ea214ea1f55173f2ff7e3045cc72a8c4e7c7
Commit:        1334ea214ea1f55173f2ff7e3045cc72a8c4e7c7
Parent:        a8545462349c560cf66362cb3d25b44b7b0e819b
Author:        Alasdair G Kergon <[email protected]>
AuthorDate:    Mon Mar 9 19:01:12 2015 +0000
Committer:     Alasdair G Kergon <[email protected]>
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(-)
tools/vgconvert.c +7 -0
index 50b3e44..3742237 100644
@@ -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) {