From 03984e05a33a25cb005861e9e562a673965769e2 Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Wed, 6 Jan 2010 13:27:06 +0000 Subject: [PATCH] Rename mirror_device_fault_policy to mirror_image_fault policy --- WHATS_NEW | 1 + doc/example.conf | 2 +- lib/config/defaults.h | 2 +- lib/metadata/mirror.c | 10 +++++++--- tools/lvconvert.c | 3 +++ 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 06d55deff..8270f74de 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.57 - ==================================== + Rename mirror_device_fault_policy to mirror_image_fault policy. Remove empty PV devices if lvconvert --repair is using defined policies. Use fixed buffer to prevent stack overflow in persistent filter dump. Use snapshot metadata usage to determine if a snapshot is empty. diff --git a/doc/example.conf b/doc/example.conf index fb0f59ad2..045006712 100644 --- a/doc/example.conf +++ b/doc/example.conf @@ -405,7 +405,7 @@ activation { # be allocated for the replacement. mirror_log_fault_policy = "allocate" - mirror_device_fault_policy = "remove" + mirror_image_fault_policy = "remove" } diff --git a/lib/config/defaults.h b/lib/config/defaults.h index c6585ff26..da13fc2b3 100644 --- a/lib/config/defaults.h +++ b/lib/config/defaults.h @@ -46,7 +46,7 @@ #define DEFAULT_MIRRORLOG "disk" #define DEFAULT_MIRROR_LOG_FAULT_POLICY "allocate" -#define DEFAULT_MIRROR_DEV_FAULT_POLICY "remove" +#define DEFAULT_MIRROR_IMAGE_FAULT_POLICY "remove" #define DEFAULT_MIRROR_MAX_IMAGES 8 /* limited by kernel DM_KCOPYD_MAX_REGIONS */ #define DEFAULT_DMEVENTD_MIRROR_LIB "libdevmapper-event-lvm2mirror.so" #define DEFAULT_DMEVENTD_MONITOR 1 diff --git a/lib/metadata/mirror.c b/lib/metadata/mirror.c index b5578f1a9..56f04112f 100644 --- a/lib/metadata/mirror.c +++ b/lib/metadata/mirror.c @@ -783,9 +783,13 @@ static int get_mirror_fault_policy(struct cmd_context *cmd __attribute((unused)) if (log_policy) policy = find_config_str(NULL, "activation/mirror_log_fault_policy", DEFAULT_MIRROR_LOG_FAULT_POLICY); - else - policy = find_config_str(NULL, "activation/mirror_device_fault_policy", - DEFAULT_MIRROR_DEV_FAULT_POLICY); + else { + policy = find_config_str(NULL, "activation/mirror_image_fault_policy", + NULL); + if (!policy) + policy = find_config_str(NULL, "activation/mirror_device_fault_policy", + DEFAULT_MIRROR_IMAGE_FAULT_POLICY); + } if (!strcmp(policy, "remove")) return MIRROR_REMOVE; diff --git a/tools/lvconvert.c b/tools/lvconvert.c index 2ab42f919..6629cd4ff 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -475,6 +475,9 @@ static void _lvconvert_mirrors_repair_ask(struct cmd_context *cmd, if (arg_count(cmd, use_policies_ARG)) { leg_policy = find_config_tree_str(cmd, + "activation/mirror_image_fault_policy", NULL); + if (!leg_policy) + leg_policy = find_config_tree_str(cmd, "activation/mirror_device_fault_policy", DEFAULT_MIRROR_DEVICE_FAULT_POLICY); log_policy = find_config_tree_str(cmd, -- 2.43.5