]> sourceware.org Git - lvm2.git/commitdiff
Additional kernel target checks before pvmove & snapshot creation.
authorAlasdair Kergon <agk@redhat.com>
Mon, 24 May 2004 20:51:56 +0000 (20:51 +0000)
committerAlasdair Kergon <agk@redhat.com>
Mon, 24 May 2004 20:51:56 +0000 (20:51 +0000)
WHATS_NEW
lib/metadata/mirror.c
tools/lvcreate.c

index 170baeda52c698c76eac81c7242d087827258524..b6eb113e9eadd8e99354b3ecc0f51fab5a10ebd4 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,3 +1,7 @@
+Version 2.00.17 -
+=============================
+  Additional kernel target checks before pvmove & snapshot creation.
+
 Version 2.00.16 - 24 May 2004
 =============================
   Set area_count within alloc_lv_segment.
index 3e93103ee884000063f476a61571d6e1e984c115..8d926769cfcc2b4368c70c3b44e96f4a086b22d4 100644 (file)
@@ -18,6 +18,7 @@
 #include "toolcontext.h"
 #include "segtypes.h"
 #include "display.h"
+#include "activate.h"
 
 /* 
  * Replace any LV segments on given PV with temporary mirror.
@@ -42,6 +43,13 @@ int insert_pvmove_mirrors(struct cmd_context *cmd,
                return 0;
        }
 
+        if (activation() && segtype->ops->target_present &&
+            !segtype->ops->target_present()) {
+                log_error("%s: Required device-mapper target(s) not "
+                          "detected in your kernel", segtype->name);
+                return 0;
+        }
+
        /* Work through all segments on the supplied PV */
        list_iterate(segh, &lv->segments) {
                seg = list_item(segh, struct lv_segment);
index 10ff466b8e8a2ad89b79e28fcbce144c9938a55e..f69f66c4c3959e173921bf200843ec60a48bc227 100644 (file)
@@ -246,6 +246,11 @@ static int _read_params(struct lvcreate_params *lp, struct cmd_context *cmd,
                }
                lp->chunk_size = 2 * arg_uint_value(cmd, chunksize_ARG, 8);
                log_verbose("Setting chunksize to %d sectors.", lp->chunk_size);
+
+               if (!(lp->segtype = get_segtype_from_string(cmd, "snapshot"))) {
+                       stack;
+                       return 0;
+               }
        } else {
                if (arg_count(cmd, chunksize_ARG)) {
                        log_error("-c is only available with snapshots");
This page took 0.041476 seconds and 5 git commands to generate.