Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
List overview
Download
lvm2-commits
July 2014
----- 2025 -----
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
lvm2-commits@lists.fedorahosted.org
7 participants
135 discussions
Start a n
N
ew thread
master - tests: use bigger metadata
by Zdenek Kabelac
17 Jul '14
17 Jul '14
Gitweb:
http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=27574d0e410c9b78…
Commit: 27574d0e410c9b78a1bdc14dc6fd3c9ed2b6ca9f Parent: 53b787e519261008c4b1d96ea58243c9e2e06f25 Author: Zdenek Kabelac <zkabelac(a)redhat.com> AuthorDate: Thu Jul 17 16:27:39 2014 +0200 Committer: Zdenek Kabelac <zkabelac(a)redhat.com> CommitterDate: Thu Jul 17 16:27:39 2014 +0200 tests: use bigger metadata Until resolved - use bigger then 4MB cache pool metadata. --- test/shell/pvmove-cache-segtypes.sh | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/test/shell/pvmove-cache-segtypes.sh b/test/shell/pvmove-cache-segtypes.sh index 1f5c6d9..9eaf186 100644 --- a/test/shell/pvmove-cache-segtypes.sh +++ b/test/shell/pvmove-cache-segtypes.sh @@ -142,7 +142,7 @@ lvremove -ff $vg ################################################# lvcreate -l 2 -n ${lv1}_foo $vg "$dev1" # RAID for cachepool -lvcreate --type raid1 -m 1 -L 4M -n meta $vg "$dev1" "$dev2" +lvcreate --type raid1 -m 1 -L 6M -n meta $vg "$dev1" "$dev2" lvcreate --type raid1 -m 1 -L 4M -n cachepool $vg "$dev1" "$dev2" lvconvert --yes --type cache-pool $vg/cachepool --poolmetadata $vg/meta # RAID for thin pool data LV
1
0
0
0
master - cleanup: drop testing impossible path
by Zdenek Kabelac
17 Jul '14
17 Jul '14
Gitweb:
http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=53b787e519261008…
Commit: 53b787e519261008c4b1d96ea58243c9e2e06f25 Parent: ffa1a7b046b0ec62d478a848181f16c4ee0126bb Author: Zdenek Kabelac <zkabelac(a)redhat.com> AuthorDate: Thu Jul 17 14:47:58 2014 +0200 Committer: Zdenek Kabelac <zkabelac(a)redhat.com> CommitterDate: Thu Jul 17 16:20:21 2014 +0200 cleanup: drop testing impossible path We cannot get NULL in this test - since if the arg is set it will always return non-NULL value here. (in-release update) --- tools/lvconvert.c | 18 +++--------------- 1 files changed, 3 insertions(+), 15 deletions(-) diff --git a/tools/lvconvert.c b/tools/lvconvert.c index b630ee2..63a1d98 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -242,10 +242,7 @@ static int _read_pool_params(struct lvconvert_params *lp, struct cmd_context *cm " the cache or cache-pool segment type."); return 0; } - if (!(lp->pool_data_lv_name = arg_str_value(cmd, cachepool_ARG, NULL))) { - log_error("Missing cache pool logical volume name."); - return 0; - } + lp->pool_data_lv_name = arg_str_value(cmd, cachepool_ARG, NULL); cachepool = 1; type_str = "cache-pool"; } else if (!strcmp(type_str, "cache-pool")) @@ -259,10 +256,7 @@ static int _read_pool_params(struct lvconvert_params *lp, struct cmd_context *cm " the thin or thin-pool segment type."); return 0; } - if (!(lp->pool_data_lv_name = arg_str_value(cmd, thinpool_ARG, NULL))) { - log_error("Missing thin pool logical volume name."); - return 0; - } + lp->pool_data_lv_name = arg_str_value(cmd, thinpool_ARG, NULL); thinpool = 1; type_str = "thin-pool"; } else if (!strcmp(type_str, "thin-pool")) @@ -270,13 +264,7 @@ static int _read_pool_params(struct lvconvert_params *lp, struct cmd_context *cm if (thinpool) { lp->discards = (thin_discards_t) arg_uint_value(cmd, discards_ARG, THIN_DISCARDS_PASSDOWN); - - if (arg_count(cmd, originname_ARG)) { - if (!(lp->origin_lv_name = arg_str_value(cmd, originname_ARG, NULL))) { - log_error("Missing --originname argument."); - return 0; - } - } + lp->origin_lv_name = arg_str_value(cmd, originname_ARG, NULL); } else { if (!arg_is_any_set(cmd, "is valid only with thin pools", discards_ARG, originname_ARG, zero_ARG,
1
0
0
0
master - cleanup: typo in message
by Zdenek Kabelac
17 Jul '14
17 Jul '14
Gitweb:
http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ffa1a7b046b0ec62…
Commit: ffa1a7b046b0ec62d478a848181f16c4ee0126bb Parent: ab72cdbf81ef5a52a63098b1997b3a6765a9edc5 Author: Zdenek Kabelac <zkabelac(a)redhat.com> AuthorDate: Thu Jul 17 14:46:38 2014 +0200 Committer: Zdenek Kabelac <zkabelac(a)redhat.com> CommitterDate: Thu Jul 17 16:19:57 2014 +0200 cleanup: typo in message in-release fix. --- tools/lvconvert.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/lvconvert.c b/tools/lvconvert.c index eef408a..b630ee2 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -529,7 +529,7 @@ static int _read_params(struct lvconvert_params *lp, struct cmd_context *cmd, ; else if (lp->snapshot) { /* Snapshot creation from pre-existing cow */ if (!argc) { - log_error("Please provide logical volume path for snaphost origin."); + log_error("Please provide logical volume path for snapshot origin."); return 0; } lp->origin_lv_name = argv[0];
1
0
0
0
master - cleanup: check arg_count once
by Zdenek Kabelac
17 Jul '14
17 Jul '14
Gitweb:
http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ab72cdbf81ef5a52…
Commit: ab72cdbf81ef5a52a63098b1997b3a6765a9edc5 Parent: 321592af71686b8963a6bae276533f4f19946578 Author: Zdenek Kabelac <zkabelac(a)redhat.com> AuthorDate: Mon Jul 14 17:34:49 2014 +0200 Committer: Zdenek Kabelac <zkabelac(a)redhat.com> CommitterDate: Thu Jul 17 16:18:35 2014 +0200 cleanup: check arg_count once Do not check quiet_ARG more then necessary. --- tools/lvmcmdline.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c index be7844b..ccef904 100644 --- a/tools/lvmcmdline.c +++ b/tools/lvmcmdline.c @@ -935,11 +935,9 @@ static int _get_settings(struct cmd_context *cmd) if (arg_count(cmd, quiet_ARG)) { cmd->current_settings.debug = 0; cmd->current_settings.verbose = 0; + cmd->current_settings.silent = (arg_count(cmd, quiet_ARG) > 1) ? 1 : 0; } - if (arg_count(cmd, quiet_ARG) > 1) - cmd->current_settings.silent = 1; - if (arg_count(cmd, test_ARG)) cmd->current_settings.test = arg_count(cmd, test_ARG);
1
0
0
0
master - raid: support lvdisplay --maps
by Zdenek Kabelac
17 Jul '14
17 Jul '14
Gitweb:
http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=321592af71686b89…
Commit: 321592af71686b8963a6bae276533f4f19946578 Parent: cac0722cacaac06ac1211194f1d6c21572a32998 Author: Zdenek Kabelac <zkabelac(a)redhat.com> AuthorDate: Wed Jul 16 23:55:46 2014 +0200 Committer: Zdenek Kabelac <zkabelac(a)redhat.com> CommitterDate: Thu Jul 17 16:18:34 2014 +0200 raid: support lvdisplay --maps Add legs printing for --maps Somewhat similar to mirror support - maybe there are more things to show... --- lib/raid/raid.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/lib/raid/raid.c b/lib/raid/raid.c index 33ba5b7..c3f5c3f 100644 --- a/lib/raid/raid.c +++ b/lib/raid/raid.c @@ -30,6 +30,21 @@ static const char *_raid_name(const struct lv_segment *seg) return seg->segtype->name; } +static void _raid_display(const struct lv_segment *seg) +{ + unsigned s; + + for (s = 0; s < seg->area_count; ++s) { + log_print(" Raid Data LV%2d", s); + display_stripe(seg, s, " "); + } + + for (s = 0; s < seg->area_count; ++s) + log_print(" Raid Metadata LV%2d\t%s", s, seg_metalv(seg, s)->name); + + log_print(" "); +} + static int _raid_text_import_area_count(const struct dm_config_node *sn, uint32_t *area_count) { @@ -404,6 +419,7 @@ static int _raid_target_unmonitor_events(struct lv_segment *seg, int events) static struct segtype_handler _raid_ops = { .name = _raid_name, + .display = _raid_display, .text_import_area_count = _raid_text_import_area_count, .text_import = _raid_text_import, .text_export = _raid_text_export,
1
0
0
0
master - metadata: use outfc for comments
by Zdenek Kabelac
17 Jul '14
17 Jul '14
Gitweb:
http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=cac0722cacaac06a…
Commit: cac0722cacaac06ac1211194f1d6c21572a32998 Parent: f5d6c4b0f3527b42ff3e7ef7a68010c3540d6f41 Author: Zdenek Kabelac <zkabelac(a)redhat.com> AuthorDate: Wed Jul 16 23:57:43 2014 +0200 Committer: Zdenek Kabelac <zkabelac(a)redhat.com> CommitterDate: Thu Jul 17 16:17:44 2014 +0200 metadata: use outfc for comments Few unecessary comments were written to on-disc metadata. Use outfc() to have comments only in archived files. (may also save couple bytes in ringbuffer). TODO: needed validation against newline char... --- lib/format_text/export.c | 10 ++++++---- lib/striped/striped.c | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/format_text/export.c b/lib/format_text/export.c index 319e5ea..aa0d905 100644 --- a/lib/format_text/export.c +++ b/lib/format_text/export.c @@ -329,6 +329,7 @@ static int _print_header(struct formatter *f, { char *buf; time_t t; + char com[PATH_MAX]; t = time(NULL); @@ -344,9 +345,10 @@ static int _print_header(struct formatter *f, } outf(f, "description = \"%s\"", dm_escape_double_quotes(buf, desc)); outnl(f); - outf(f, "creation_host = \"%s\"\t# %s %s %s %s %s", _utsname.nodename, - _utsname.sysname, _utsname.nodename, _utsname.release, - _utsname.version, _utsname.machine); + (void) dm_snprintf(com, sizeof(com), "# %s %s %s %s %s", + _utsname.sysname, _utsname.nodename, _utsname.release, + _utsname.version, _utsname.machine); + outfc(f, com, "creation_host = \"%s\"", _utsname.nodename); outf(f, "creation_time = %lu\t# %s", t, ctime(&t)); return 1; @@ -396,7 +398,7 @@ static int _print_vg(struct formatter *f, struct volume_group *vg) outf(f, "seqno = %u", vg->seqno); if (vg->fid && vg->fid->fmt) - outf(f, "format = \"%s\" # informational", vg->fid->fmt->name); + outfc(f, "# informational", "format = \"%s\"", vg->fid->fmt->name); if (!_print_flag_config(f, vg->status, VG_FLAGS)) return_0; diff --git a/lib/striped/striped.c b/lib/striped/striped.c index 3b08467..dfd4518 100644 --- a/lib/striped/striped.c +++ b/lib/striped/striped.c @@ -94,8 +94,8 @@ static int _striped_text_import(struct lv_segment *seg, const struct dm_config_n static int _striped_text_export(const struct lv_segment *seg, struct formatter *f) { - outf(f, "stripe_count = %u%s", seg->area_count, - (seg->area_count == 1) ? "\t# linear" : ""); + outfc(f, (seg->area_count == 1) ? "# linear" : NULL, + "stripe_count = %u", seg->area_count); if (seg->area_count > 1) outsize(f, (uint64_t) seg->stripe_size,
1
0
0
0
master - cache: use get_cache_mode for validation
by Zdenek Kabelac
17 Jul '14
17 Jul '14
Gitweb:
http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f5d6c4b0f3527b42…
Commit: f5d6c4b0f3527b42ff3e7ef7a68010c3540d6f41 Parent: 8f9f18013948f696bffaddb612d55a94f6279c9c Author: Zdenek Kabelac <zkabelac(a)redhat.com> AuthorDate: Thu Jul 17 15:12:21 2014 +0200 Committer: Zdenek Kabelac <zkabelac(a)redhat.com> CommitterDate: Thu Jul 17 16:16:45 2014 +0200 cache: use get_cache_mode for validation Use a single function to validate cache mode arg and set DM_ feature flags. --- lib/cache_segtype/cache.c | 6 +----- lib/metadata/cache_manip.c | 14 ++++++++++++++ lib/metadata/metadata-exported.h | 1 + tools/lvconvert.c | 13 +++---------- tools/lvcreate.c | 14 +++----------- 5 files changed, 22 insertions(+), 26 deletions(-) diff --git a/lib/cache_segtype/cache.c b/lib/cache_segtype/cache.c index 0e49530..ddaf3cf 100644 --- a/lib/cache_segtype/cache.c +++ b/lib/cache_segtype/cache.c @@ -74,11 +74,7 @@ static int _cache_pool_text_import(struct lv_segment *seg, if (dm_config_has_node(sn, "cache_mode")) { if (!(str = dm_config_find_str(sn, "cache_mode", NULL))) return SEG_LOG_ERROR("cache_mode must be a string in"); - if (!strcmp(str, "writethrough")) - seg->feature_flags |= DM_CACHE_FEATURE_WRITETHROUGH; - else if (!strcmp(str, "writeback")) - seg->feature_flags |= DM_CACHE_FEATURE_WRITEBACK; - else + if (!get_cache_mode(str, &seg->feature_flags)) return SEG_LOG_ERROR("Unknown cache_mode in"); } diff --git a/lib/metadata/cache_manip.c b/lib/metadata/cache_manip.c index e220dd9..8a5e5e3 100644 --- a/lib/metadata/cache_manip.c +++ b/lib/metadata/cache_manip.c @@ -299,3 +299,17 @@ int lv_cache_remove(struct logical_volume *cache_lv) return 1; } + +int get_cache_mode(const char *str, uint32_t *flags) +{ + if (!strcmp(str, "writethrough")) + *flags |= DM_CACHE_FEATURE_WRITETHROUGH; + else if (!strcmp(str, "writeback")) + *flags |= DM_CACHE_FEATURE_WRITEBACK; + else { + log_error("Cache pool cachemode \"%s\" is unknown.", str); + return 0; + } + + return 1; +} diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h index f2521db..2b06718 100644 --- a/lib/metadata/metadata-exported.h +++ b/lib/metadata/metadata-exported.h @@ -1050,6 +1050,7 @@ int update_cache_pool_params(struct volume_group *vg, unsigned attr, struct logical_volume *lv_cache_create(struct logical_volume *pool, struct logical_volume *origin); int lv_cache_remove(struct logical_volume *cache_lv); +int get_cache_mode(const char *str, uint32_t *flags); /* -- metadata/cache_manip.c */ struct cmd_vg *cmd_vg_add(struct dm_pool *mem, struct dm_list *cmd_vgs, diff --git a/tools/lvconvert.c b/tools/lvconvert.c index e128b81..eef408a 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -289,16 +289,9 @@ static int _read_pool_params(struct lvconvert_params *lp, struct cmd_context *cm } if (cachepool) { - if ((tmp_str = arg_str_value(cmd, cachemode_ARG, NULL))) { - if (!strcmp(tmp_str, "writeback")) - lp->feature_flags |= DM_CACHE_FEATURE_WRITEBACK; - else if (!strcmp(tmp_str, "writethrough")) - lp->feature_flags |= DM_CACHE_FEATURE_WRITETHROUGH; - else { - log_error("Unknown cachemode argument"); - return 0; - } - } + if ((tmp_str = arg_str_value(cmd, cachemode_ARG, NULL)) && + !get_cache_mode(tmp_str, &lp->feature_flags)) + return_0; } else { if (!arg_is_any_set(cmd, "is valid only with cache pools", cachemode_ARG, -1)) diff --git a/tools/lvcreate.c b/tools/lvcreate.c index 8e45cc1..e9a170c 100644 --- a/tools/lvcreate.c +++ b/tools/lvcreate.c @@ -713,17 +713,9 @@ static int _read_cache_pool_params(struct lvcreate_params *lp, lp->chunk_size = arg_uint_value(cmd, chunksize_ARG, DEFAULT_CACHE_POOL_CHUNK_SIZE * 2); - str_arg = arg_str_value(cmd, cachemode_ARG, NULL); - if (str_arg) { - if (!strcmp(str_arg, "writeback")) - lp->feature_flags |= DM_CACHE_FEATURE_WRITEBACK; - else if (!strcmp(str_arg, "writethrough")) - lp->feature_flags |= DM_CACHE_FEATURE_WRITETHROUGH; - else { - log_error("Unknown cachemode argument"); - return 0; - } - } + if ((str_arg = arg_str_value(cmd, cachemode_ARG, NULL)) && + !get_cache_mode(str_arg, &lp->feature_flags)) + return_0; return 1; }
1
0
0
0
master - lvconvert: improve merge validation
by Zdenek Kabelac
17 Jul '14
17 Jul '14
Gitweb:
http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8f9f18013948f696…
Commit: 8f9f18013948f696bffaddb612d55a94f6279c9c Parent: 7abad9ef88a9c47e302a454fe15d0c9989bf89a0 Author: Zdenek Kabelac <zkabelac(a)redhat.com> AuthorDate: Thu Jul 17 15:38:13 2014 +0200 Committer: Zdenek Kabelac <zkabelac(a)redhat.com> CommitterDate: Thu Jul 17 16:16:00 2014 +0200 lvconvert: improve merge validation Easier check for conflicting options with --merge. --- WHATS_NEW | 1 + tools/lvconvert.c | 15 ++++++--------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 9b498b0..956b07b 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.108 - ================================= + Improve lvconvert --merge validation. Improve lvconvert --splitsnapshot validation. Add report/list_item_separator lvm.conf option. Add lv_active_{locally,remotely,exclusively} LV reporting fields. diff --git a/tools/lvconvert.c b/tools/lvconvert.c index 0f58677..e128b81 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -523,15 +523,12 @@ static int _read_params(struct lvconvert_params *lp, struct cmd_context *cmd, /* There are six types of lvconvert. */ if (lp->merge) { /* Snapshot merge */ - if (arg_count(cmd, regionsize_ARG) || arg_count(cmd, chunksize_ARG) || - arg_count(cmd, zero_ARG) || arg_count(cmd, regionsize_ARG) || - arg_count(cmd, poolmetadata_ARG) || arg_count(cmd, poolmetadatasize_ARG) || - arg_count(cmd, readahead_ARG) || - arg_count(cmd, stripes_long_ARG) || arg_count(cmd, stripesize_ARG)) { - log_error("Only --background and --interval are valid " - "arguments for snapshot merge"); - return 0; - } + if (!arg_is_only_set(cmd, "cannot be used with --merge", + merge_ARG, + background_ARG, interval_ARG, + force_ARG, noudevsync_ARG, test_ARG, + -1)) + return_0; if (!(lp->segtype = get_segtype_from_string(cmd, "snapshot"))) return_0;
1
0
0
0
master - lvconvert: improve splitsnapshot test
by Zdenek Kabelac
17 Jul '14
17 Jul '14
Gitweb:
http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7abad9ef88a9c47e…
Commit: 7abad9ef88a9c47e302a454fe15d0c9989bf89a0 Parent: 4dcacbe369346e957398fd4951fc1a6d1fd4560f Author: Zdenek Kabelac <zkabelac(a)redhat.com> AuthorDate: Thu Jul 17 15:36:07 2014 +0200 Committer: Zdenek Kabelac <zkabelac(a)redhat.com> CommitterDate: Thu Jul 17 16:15:30 2014 +0200 lvconvert: improve splitsnapshot test Easier check for conflicting options with --splitsnapshot. --- WHATS_NEW | 1 + tools/lvconvert.c | 23 +++++++---------------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index db78347..9b498b0 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.108 - ================================= + Improve lvconvert --splitsnapshot validation. Add report/list_item_separator lvm.conf option. Add lv_active_{locally,remotely,exclusively} LV reporting fields. Comment out devices/{preferred_names,filter} in default lvm.conf file. diff --git a/tools/lvconvert.c b/tools/lvconvert.c index 6ec7fa5..0f58677 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -406,8 +406,14 @@ static int _read_params(struct lvconvert_params *lp, struct cmd_context *cmd, return 0; } - if (arg_count(cmd, splitsnapshot_ARG)) + if (arg_is_set(cmd, splitsnapshot_ARG)) { + if (!arg_is_only_set(cmd, "cannot be used with --splitsnapshot", + splitsnapshot_ARG, + force_ARG, noudevsync_ARG, test_ARG, + -1)) + return_0; lp->splitsnapshot = 1; + } if ((_snapshot_type_requested(cmd, type_str) || arg_count(cmd, merge_ARG)) && (arg_count(cmd, mirrorlog_ARG) || _mirror_or_raid_type_requested(cmd, type_str) || @@ -513,21 +519,6 @@ static int _read_params(struct lvconvert_params *lp, struct cmd_context *cmd, lp->mirrors_sign = arg_sign_value(cmd, mirrors_ARG, SIGN_NONE); } - if (lp->splitsnapshot && - (lp->snapshot || lp->thin || lp->merge || lp->merge_mirror || arg_count(cmd, thinpool_ARG) || - arg_count(cmd, mirrors_ARG) || arg_count(cmd, repair_ARG) || arg_count(cmd, replace_ARG) || - arg_count(cmd, chunksize_ARG) || arg_count(cmd, zero_ARG) || arg_count(cmd, regionsize_ARG) || - arg_count(cmd, poolmetadata_ARG) || arg_count(cmd, poolmetadatasize_ARG) || - arg_count(cmd, readahead_ARG) || arg_count(cmd, stripes_long_ARG) || - arg_count(cmd, stripesize_ARG) || arg_count(cmd, background_ARG) || - arg_count(cmd, interval_ARG) || arg_count(cmd, type_ARG) || arg_count(cmd, alloc_ARG) || - arg_count(cmd, corelog_ARG) || arg_count(cmd, mirrorlog_ARG) || - arg_count(cmd, splitmirrors_ARG) || arg_count(cmd, originname_ARG) || - arg_count(cmd, trackchanges_ARG) || arg_count(cmd, use_policies_ARG))) { - log_error("Incompatible arguments supplied with --splitsnapshot."); - return 0; - } - lp->alloc = (alloc_policy_t) arg_uint_value(cmd, alloc_ARG, ALLOC_INHERIT); /* There are six types of lvconvert. */
1
0
0
0
master - lvconvert: move to single name validation
by Zdenek Kabelac
17 Jul '14
17 Jul '14
Gitweb:
http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4dcacbe369346e95…
Commit: 4dcacbe369346e957398fd4951fc1a6d1fd4560f Parent: 04acf7a8d0713c858df893584401e96100f9d9d5 Author: Zdenek Kabelac <zkabelac(a)redhat.com> AuthorDate: Thu Jul 17 12:19:48 2014 +0200 Committer: Zdenek Kabelac <zkabelac(a)redhat.com> CommitterDate: Thu Jul 17 16:14:36 2014 +0200 lvconvert: move to single name validation Validate all LV names in _lvconvert_name_params(). --- tools/lvconvert.c | 19 ++++--------------- 1 files changed, 4 insertions(+), 15 deletions(-) diff --git a/tools/lvconvert.c b/tools/lvconvert.c index 8370b49..6ec7fa5 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -146,6 +146,9 @@ static int _lvconvert_name_params(struct lvconvert_params *lp, if (!_lvconvert_vg_name(lp, cmd, &lp->origin_lv_name)) return_0; + if (!_lvconvert_vg_name(lp, cmd, &lp->lv_split_name)) + return_0; + if (strchr(lp->lv_name_full, '/') && (vg_name = extract_vgname(cmd, lp->lv_name_full)) && lp->vg_name && strcmp(vg_name, lp->vg_name)) { @@ -483,21 +486,7 @@ static int _read_params(struct lvconvert_params *lp, struct cmd_context *cmd, return 0; } - lp->lv_split_name = arg_value(cmd, name_ARG); - if (lp->lv_split_name) { - if (strchr(lp->lv_split_name, '/')) { - if (!(lp->vg_name = extract_vgname(cmd, lp->lv_split_name))) - return_0; - - /* Strip VG from lv_split_name */ - if ((tmp_str = strrchr(lp->lv_split_name, '/'))) - lp->lv_split_name = tmp_str + 1; - } - - if (!apply_lvname_restrictions(lp->lv_split_name)) - return_0; - } - + lp->lv_split_name = arg_str_value(cmd, name_ARG, NULL); lp->keep_mimages = 1; lp->mirrors = arg_uint_value(cmd, splitmirrors_ARG, 0); lp->mirrors_sign = SIGN_MINUS;
1
0
0
0
← Newer
1
2
3
4
5
6
7
...
14
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Results per page:
10
25
50
100
200