]> sourceware.org Git - lvm2.git/commitdiff
lvconvert: VDO kernel support before converting
authorZdenek Kabelac <zkabelac@redhat.com>
Wed, 17 Feb 2021 10:13:19 +0000 (11:13 +0100)
committerZdenek Kabelac <zkabelac@redhat.com>
Wed, 17 Feb 2021 10:21:35 +0000 (11:21 +0100)
Early check for kernel support of VDO target before starting any
conversion work.

tools/lvconvert.c

index ef31799fa3530a30fb6828919d1b4bc8a7c49442..8bd73bb53d1a2175e2de2f695c92668767c38ebc 100644 (file)
@@ -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);
This page took 0.038808 seconds and 5 git commands to generate.