diff --git a/tools/args.h b/tools/args.h index e64d97546..35a4fb1fc 100644 --- a/tools/args.h +++ b/tools/args.h @@ -26,6 +26,7 @@ arg(units_ARG, '\0', "units", string_arg) arg(nosuffix_ARG, '\0', "nosuffix", NULL) arg(removemissing_ARG, '\0', "removemissing", NULL) arg(abort_ARG, '\0', "abort", NULL) +arg(mknodes_ARG, '\0', "mknodes", NULL) /* Allow some variations */ arg(resizable_ARG, '\0', "resizable", yes_no_arg) diff --git a/tools/commands.h b/tools/commands.h index 3c03b80a4..5be9ca3fd 100644 --- a/tools/commands.h +++ b/tools/commands.h @@ -752,11 +752,12 @@ xx(vgscan, "\t[-d|--debug]\n" "\t[-h|--help]\n" "\t[--ignorelockingfailure]\n" + "\t[--mknodes]\n" "\t[-P|--partial] " "\n" "\t[-v|--verbose]\n" "\t[--version]" "\n", - ignorelockingfailure_ARG, partial_ARG) + ignorelockingfailure_ARG, mknodes_ARG, partial_ARG) xx(vgsplit, "Move physical volumes into a new volume group", diff --git a/tools/vgscan.c b/tools/vgscan.c index eb239c12a..d9856c4cf 100644 --- a/tools/vgscan.c +++ b/tools/vgscan.c @@ -45,6 +45,8 @@ static int vgscan_single(struct cmd_context *cmd, const char *vg_name, int vgscan(struct cmd_context *cmd, int argc, char **argv) { + int maxret, ret; + if (argc) { log_error("Too many parameters on command line"); return EINVALID_CMD_LINE; @@ -58,6 +60,14 @@ int vgscan(struct cmd_context *cmd, int argc, char **argv) log_print("Reading all physical volumes. This may take a while..."); - return process_each_vg(cmd, argc, argv, LCK_VG_READ, 1, NULL, - &vgscan_single); + maxret = process_each_vg(cmd, argc, argv, LCK_VG_READ, 1, NULL, + &vgscan_single); + + if (arg_count(cmd, mknodes_ARG)) { + ret = vgmknodes(cmd, argc, argv); + if (ret > maxret) + maxret = ret; + } + + return maxret; }