All of lore.kernel.org
 help / color / mirror / Atom feed
* main - lvconvert: VDO kernel support before converting
@ 2021-02-17 10:54 Zdenek Kabelac
  0 siblings, 0 replies; only message in thread
From: Zdenek Kabelac @ 2021-02-17 10:54 UTC (permalink / raw)
  To: lvm-devel

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a7cb25c877ad70c48fa66258f8e3f2157e2e2be5
Commit:        a7cb25c877ad70c48fa66258f8e3f2157e2e2be5
Parent:        a915cd5a46dca80bb1ce981a2ee923b8e813d887
Author:        Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate:    Wed Feb 17 11:13:19 2021 +0100
Committer:     Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Wed Feb 17 11:21:35 2021 +0100

lvconvert: VDO kernel support before converting

Early check for kernel support of VDO target before starting any
conversion work.
---
 tools/lvconvert.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index ef31799fa..8bd73bb53 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -5472,6 +5472,14 @@ static int _lvconvert_to_vdopool_single(struct cmd_context *cmd,
 	if (!(lvc.segtype = get_segtype_from_string(cmd, SEG_TYPE_NAME_VDO)))
 		return_0;
 
+	if (activation() && lvc.segtype->ops->target_present) {
+		if (!lvc.segtype->ops->target_present(cmd, NULL, &lvc.target_attr)) {
+			log_error("%s: Required device-mapper target(s) not detected in your kernel.",
+				  lvc.segtype->name);
+			return 0;
+		}
+	}
+
 	if (vg_is_shared(vg)) {
 		/* FIXME: need to swap locks betwen LVs? */
 		log_error("Unable to convert VDO pool in VG with lock_type %s", vg->lock_type);



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-17 10:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-17 10:54 main - lvconvert: VDO kernel support before converting Zdenek Kabelac

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.