]> sourceware.org Git - lvm2.git/commitdiff
toolib: early validation of chunk size
authorZdenek Kabelac <zkabelac@redhat.com>
Sat, 4 Oct 2014 20:36:41 +0000 (22:36 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Mon, 6 Oct 2014 13:23:07 +0000 (15:23 +0200)
Since we now have validate_pool_chunk_size() we could
validate entered values directly prior openning vg.

tools/toollib.c

index 69c1c39950aa0664852978b508714c18d5ec997d..ddd669a464955010794f71b7ee8326e062172b21 100644 (file)
@@ -1257,6 +1257,10 @@ int get_pool_params(struct cmd_context *cmd,
 
                *passed_args |= PASS_ARG_CHUNK_SIZE;
                *chunk_size = arg_uint_value(cmd, chunksize_ARG, 0);
+
+               if (!validate_pool_chunk_size(cmd, segtype, *chunk_size))
+                       return_0;
+
                log_very_verbose("Setting pool chunk size: %s",
                                 display_size(cmd, *chunk_size));
        }
This page took 0.042618 seconds and 5 git commands to generate.