Skip to contentSkip to conversation

LVM2 ./WHATS_NEW lib/activate/activate.c lib/l ...

PATCH [email protected] 1 participant 1 message Jan 24, 2007

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: agk at sourceware.org 2007-01-24 23:43:27

Modified files:

	.              : WHATS_NEW 
	lib/activate   : activate.c 
	lib/log        : log.h 
	tools          : lvchange.c vgchange.c 

Added files:
scripts : lvm2_monitoring_init_rhel4

Log message:
lvm.static no longer interacts with dmeventd unless explicitly asked to.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.555&r2=1.556
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.119&r2=1.120
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/log/log.h.diff?cvsroot=lvm2&r1=1.33&r2=1.34
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/scripts/lvm2_monitoring_init_rhel4.diff?cvsroot=lvm2&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvchange.c.diff?cvsroot=lvm2&r1=1.77&r2=1.78
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgchange.c.diff?cvsroot=lvm2&r1=1.56&r2=1.57

WHATS_NEW +1 -0
@@ -1,5 +1,6 @@
 Version 2.02.20 -
 ===================================
+  lvm.static no longer interacts with dmeventd unless explicitly asked to.
   Add field definitions to report help text.
   Remove unnecessary cmd arg from target_*monitor_events().
   Add private variable to dmeventd shared library interface.
lib/activate/activate.c +4 -0
@@ -653,6 +653,10 @@
 	struct lv_segment *seg;
 	int (*monitor_fn) (struct lv_segment *s, int e);
 
+	/* skip dmeventd code altogether */
+	if (dmeventd_monitor_mode() == DMEVENTD_MONITOR_IGNORE)
+		return 1;
+
 	/*
 	 * Nothing to do if dmeventd configured not to be used.
 	 */
lib/log/log.h +2 -0
@@ -90,6 +90,8 @@
 int lockingfailed(void);
 int security_level(void);
 int mirror_in_sync(void);
+
+#define DMEVENTD_MONITOR_IGNORE -1
 int dmeventd_monitor_mode(void);
 
 /* Suppress messages to stdout/stderr (1) or everywhere (2) */

/cvs/lvm2/LVM2/scripts/lvm2_monitoring_init_rhel4,v --> standard output revision 1.1

- renamed from scripts/lvm2_monitoring_init_rhel4 +98 -0

98 lines not on this page · raw message

tools/lvchange.c +5 -2
@@ -94,7 +94,8 @@
 	if (lv->status & PVMOVE)
 		return 1;
 
-	if (!monitor_dev_for_events(cmd, lv, dmeventd_monitor_mode()))
+	if ((dmeventd_monitor_mode() != DMEVENTD_MONITOR_IGNORE) &&
+	    !monitor_dev_for_events(cmd, lv, dmeventd_monitor_mode()))
 		stack;
 
 	return 1;
@@ -591,7 +592,9 @@
 		return ECMD_FAILED;
 	}
 
-	init_dmeventd_monitor(arg_int_value(cmd, monitor_ARG, DEFAULT_DMEVENTD_MONITOR));
+	init_dmeventd_monitor(arg_int_value(cmd, monitor_ARG,
+					    cmd->is_static ?
+					    DMEVENTD_MONITOR_IGNORE : DEFAULT_DMEVENTD_MONITOR));
 
 	/* access permission change */
 	if (arg_count(cmd, permission_ARG)) {
tools/vgchange.c +12 -7
@@ -105,7 +105,8 @@
 {
 	int active, monitored;
 
-	if ((active = lvs_in_vg_activated(vg))) {
+	if ((active = lvs_in_vg_activated(vg)) &&
+	    dmeventd_monitor_mode() != DMEVENTD_MONITOR_IGNORE) {
 		monitored = _monitor_lvs_in_vg(cmd, vg, dmeventd_monitor_mode());
 		log_print("%d logical volume(s) in volume group "
 			    "\"%s\" %smonitored",
@@ -146,11 +147,13 @@
 	if (activate && (active = lvs_in_vg_activated(vg))) {
 		log_verbose("%d logical volume(s) in volume group \"%s\" "
 			    "already active", active, vg->name);
-		monitored = _monitor_lvs_in_vg(cmd, vg, dmeventd_monitor_mode());
-		log_verbose("%d existing logical volume(s) in volume "
-			    "group \"%s\" %smonitored",
-			    monitored, vg->name,
-			    dmeventd_monitor_mode() ? "" : "un");
+		if (dmeventd_monitor_mode() != DMEVENTD_MONITOR_IGNORE) {
+			monitored = _monitor_lvs_in_vg(cmd, vg, dmeventd_monitor_mode());
+			log_verbose("%d existing logical volume(s) in volume "
+				    "group \"%s\" %smonitored",
+				    monitored, vg->name,
+				    dmeventd_monitor_mode() ? "" : "un");
+		}
 	}
 
 	if (activate && _activate_lvs_in_vg(cmd, vg, available))
@@ -532,7 +535,9 @@
 		return ECMD_FAILED;
 	}
 
-	init_dmeventd_monitor(arg_int_value(cmd, monitor_ARG, DEFAULT_DMEVENTD_MONITOR));
+	init_dmeventd_monitor(arg_int_value(cmd, monitor_ARG,
+					    cmd->is_static ?
+					    DMEVENTD_MONITOR_IGNORE : DEFAULT_DMEVENTD_MONITOR));
 
 	if (arg_count(cmd, available_ARG))
 		r = _vgchange_available(cmd, vg);