master - commands: support shortcut -H for cache objects
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=fc77e4291bdae39e1ea9dfdf0c8ef9af493df9cb Commit: fc77e4291bdae39e1ea9dfdf0c8ef9af493df9cb Parent: 1a6c892864c409724bcc0fdd48e325ae1674ae8b Author: Zdenek Kabelac <[email protected]> AuthorDate: Mon Sep 29 20:43:11 2014 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Mon Oct 6 15:18:05 2014 +0200
commands: support shortcut -H for cache objects
Introduce cache_long_ARG for those instancies
where --cache is not related to caching LV.
(pvchange,vg|lv|pvscan).
cache_ARG is now with -H shortcut.
--- WHATS_NEW | 1 + tools/args.h | 3 ++- tools/commands.h | 6 +++--- tools/lvscan.c | 4 ++-- tools/pvscan.c | 2 +- tools/vgscan.c | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-)
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.112 - ===================================== + Option --cache has also shortcut -H (i.e. lvcreate -H). Refactor lvcreate code and better preserve --type argument. Refactor process_each_vg in toollib. Pools cannot be used as external origin.
tools/args.h +2 -1
@@ -63,7 +63,7 @@ arg(merge_ARG, '\0', "merge", NULL, 0) arg(monitor_ARG, '\0', "monitor", yes_no_arg, 0) arg(config_ARG, '\0', "config", string_arg, 0) arg(trustcache_ARG, '\0', "trustcache", NULL, 0) -arg(cache_ARG, '\0', "cache", NULL, 0) +arg(cache_long_ARG, '\0', "cache", NULL, 0) arg(cachemode_ARG, '\0', "cachemode", string_arg, 0) arg(cachepool_ARG, '\0', "cachepool", string_arg, 0)arg (ignoremonitoring_ARG,'\0' ,"ignoremonitoring" ,NULL ,0 )
@@ -140,6 +140,7 @@ arg(file_ARG, 'f', "file", string_arg, 0) arg(force_ARG, 'f', "force", NULL, ARG_COUNTABLE) arg(full_ARG, 'f', "full", NULL, 0) arg(help_ARG, 'h', "help", NULL, 0) +arg(cache_ARG, 'H', "cache", NULL, 0) arg(help2_ARG, '?', "", NULL, 0) arg(stripesize_ARG, 'I', "stripesize", size_kb_arg, 0)arg (stripes_ARG,'i' ,"stripes" , int_arg,0 )
tools/commands.h +3 -3
@@ -592,7 +592,7 @@ xx(lvscan, "\t[--version]\n", all_ARG, blockdevice_ARG, ignorelockingfailure_ARG, partial_ARG, - readonly_ARG, cache_ARG) + readonly_ARG, cache_long_ARG) xx(pvchange, "Change attributes of physical volume(s)",
@@ -839,7 +839,7 @@ xx(pvscan,"\t[-v|--verbose] " "\n" "\t[--version]\n" , - activate_ARG, available_ARG, backgroundfork_ARG, cache_ARG, + activate_ARG, available_ARG, backgroundfork_ARG, cache_long_ARG, exported_ARG, ignorelockingfailure_ARG, major_ARG, minor_ARG, novolumegroup_ARG, partial_ARG, readonly_ARG, short_ARG, uuid_ARG)
@@ -1227,7 +1227,7 @@ xx(vgscan, "\t[-v|--verbose]\n" "\t[--version]" "\n", - cache_ARG, ignorelockingfailure_ARG, mknodes_ARG, partial_ARG) + cache_long_ARG, ignorelockingfailure_ARG, mknodes_ARG, partial_ARG) xx(vgsplit, "Move physical volumes into a new or existing volume group",
tools/lvscan.c +2 -2
@@ -56,7 +56,7 @@ static int lvscan_single(struct cmd_context *cmd, struct logical_volume *lv,const char *active_str, *snapshot_str; -if (arg_count (cmd, cache_ARG)) +if (arg_count (cmd, cache_long_ARG))return _lvscan_single_lvmetad (cmd, lv);if (!arg_count (cmd, all_ARG) && !lv_is_visible (lv))
@@ -93,7 +93,7 @@ static int lvscan_single(struct cmd_context *cmd, struct logical_volume *lv,int lvscan (struct cmd_context *cmd,int argc,char **argv) { -if (argc && !arg_count (cmd, cache_ARG)) { +if (argc && !arg_count (cmd, cache_long_ARG)) {log_error ("No additional command line arguments allowed" );return EINVALID_CMD_LINE ; }
tools/pvscan.c +1 -1
@@ -327,7 +327,7 @@ int pvscan(struct cmd_context *cmd, int argc, char **argv)uint64_t size_new =0 ;unsigned len; -if (arg_count (cmd, cache_ARG)) +if (arg_count (cmd, cache_long_ARG))return _pvscan_lvmetad (cmd, argc, argv);if (argc) {
tools/vgscan.c +1 -1
@@ -46,7 +46,7 @@ int vgscan(struct cmd_context *cmd, int argc, char **argv) cmd->filter->wipe (cmd->filter);lvmcache_destroy (cmd,1 ,0 ); -if (arg_count (cmd, cache_ARG)) { +if (arg_count (cmd, cache_long_ARG)) {if (lvmetad_active ()) {if (!lvmetad_pvscan_all_devs (cmd,NULL ))return ECMD_FAILED ;