public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2/daemons/dmeventd/plugins/mirror dmeventd_ ...
@ 2009-10-22 10:40 mornfall
  0 siblings, 0 replies; 2+ messages in thread
From: mornfall @ 2009-10-22 10:40 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mornfall@sourceware.org	2009-10-22 10:40:41

Modified files:
	daemons/dmeventd/plugins/mirror: dmeventd_mirror.c 

Log message:
	Only announce mirror monitoring to syslog after initialisation succeeds.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/plugins/mirror/dmeventd_mirror.c.diff?cvsroot=lvm2&r1=1.26&r2=1.27

--- LVM2/daemons/dmeventd/plugins/mirror/dmeventd_mirror.c	2009/09/17 10:37:24	1.26
+++ LVM2/daemons/dmeventd/plugins/mirror/dmeventd_mirror.c	2009/10/22 10:40:41	1.27
@@ -243,8 +243,6 @@
 
 	pthread_mutex_lock(&_register_mutex);
 
-	syslog(LOG_INFO, "Monitoring mirror device %s for events\n", device);
-
 	/*
 	 * Need some space for allocations.  1024 should be more
 	 * than enough for what we need (device mapper name splitting)
@@ -264,6 +262,8 @@
 		lvm2_run(_lvm_handle, "_memlock_inc");
 	}
 
+	syslog(LOG_INFO, "Monitoring mirror device %s for events\n", device);
+
 	_register_count++;
 	r = 1;
 


^ permalink raw reply	[flat|nested] 2+ messages in thread

* LVM2/daemons/dmeventd/plugins/mirror dmeventd_ ...
@ 2010-03-30 14:39 zkabelac
  0 siblings, 0 replies; 2+ messages in thread
From: zkabelac @ 2010-03-30 14:39 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2010-03-30 14:39:55

Modified files:
	daemons/dmeventd/plugins/mirror: dmeventd_mirror.c 

Log message:
	Updated syslog messages
	
	Use our common '.' end format for syslog messages.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/plugins/mirror/dmeventd_mirror.c.diff?cvsroot=lvm2&r1=1.32&r2=1.33

--- LVM2/daemons/dmeventd/plugins/mirror/dmeventd_mirror.c	2010/03/26 22:15:43	1.32
+++ LVM2/daemons/dmeventd/plugins/mirror/dmeventd_mirror.c	2010/03/30 14:39:55	1.33
@@ -42,17 +42,17 @@
 	 *    U => Unclassified failure (bug)
 	 */ 
 	if (status_code == 'F') {
-		syslog(LOG_ERR, "%s device %s flush failed.\n",
+		syslog(LOG_ERR, "%s device %s flush failed.",
 		       dev_type, dev_name);
 		r = ME_FAILURE;
 	} else if (status_code == 'S')
-		syslog(LOG_ERR, "%s device %s sync failed.\n",
+		syslog(LOG_ERR, "%s device %s sync failed.",
 		       dev_type, dev_name);
 	else if (status_code == 'R')
-		syslog(LOG_ERR, "%s device %s read failed.\n",
+		syslog(LOG_ERR, "%s device %s read failed.",
 		       dev_type, dev_name);
 	else if (status_code != 'A') {
-		syslog(LOG_ERR, "%s device %s has failed (%c).\n",
+		syslog(LOG_ERR, "%s device %s has failed (%c).",
 		       dev_type, dev_name, status_code);
 		r = ME_FAILURE;
 	}
@@ -143,7 +143,7 @@
 		return -ENAMETOOLONG;	/* FIXME These return code distinctions are not used so remove them! */
 
 	if (!dm_split_lvm_name(dmeventd_lvm2_pool(), device, &vg, &lv, &layer)) {
-		syslog(LOG_ERR, "Unable to determine VG name from %s",
+		syslog(LOG_ERR, "Unable to determine VG name from %s.",
 		       device);
 		return -ENOMEM;	/* FIXME Replace with generic error return - reason for failure has already got logged */
 	}
@@ -156,7 +156,7 @@
 	/* FIXME Is any sanity-checking required on %s? */
 	if (CMD_SIZE <= snprintf(cmd_str, CMD_SIZE, "lvconvert --config devices{ignore_suspended_devices=1} --repair --use-policies %s/%s", vg, lv)) {
 		/* this error should be caught above, but doesn't hurt to check again */
-		syslog(LOG_ERR, "Unable to form LVM command: Device name too long");
+		syslog(LOG_ERR, "Unable to form LVM command: Device name too long.");
 		return -ENAMETOOLONG; /* FIXME Replace with generic error return - reason for failure has already got logged */
 	}
 
@@ -184,12 +184,12 @@
 					  &target_type, &params);
 
 		if (!target_type) {
-			syslog(LOG_INFO, "%s mapping lost.\n", device);
+			syslog(LOG_INFO, "%s mapping lost.", device);
 			continue;
 		}
 
 		if (strcmp(target_type, "mirror")) {
-			syslog(LOG_INFO, "%s has unmirrored portion.\n", device);
+			syslog(LOG_INFO, "%s has unmirrored portion.", device);
 			continue;
 		}
 
@@ -199,13 +199,13 @@
 			   _part_ of the device is in sync
 			   Also, this is not an error
 			*/
-			syslog(LOG_NOTICE, "%s is now in-sync\n", device);
+			syslog(LOG_NOTICE, "%s is now in-sync.", device);
 			break;
 		case ME_FAILURE:
-			syslog(LOG_ERR, "Device failure in %s\n", device);
+			syslog(LOG_ERR, "Device failure in %s.", device);
 			if (_remove_failed_devices(device))
 				/* FIXME Why are all the error return codes unused? Get rid of them? */
-				syslog(LOG_ERR, "Failed to remove faulty devices in %s\n",
+				syslog(LOG_ERR, "Failed to remove faulty devices in %s.",
 				       device);
 			/* Should check before warning user that device is now linear
 			else
@@ -217,7 +217,7 @@
 			break;
 		default:
 			/* FIXME Provide value then! */
-			syslog(LOG_INFO, "Unknown event received.\n");
+			syslog(LOG_INFO, "Unknown event received.");
 		}
 	} while (next);
 
@@ -231,7 +231,7 @@
 		    void **unused __attribute((unused)))
 {
 	int r = dmeventd_lvm2_init();
-	syslog(LOG_INFO, "Monitoring mirror device %s for events", device);
+	syslog(LOG_INFO, "Monitoring mirror device %s for events.", device);
 	return r;
 }
 
@@ -241,7 +241,7 @@
 		      int minor __attribute((unused)),
 		      void **unused __attribute((unused)))
 {
-	syslog(LOG_INFO, "No longer monitoring mirror device %s for events\n",
+	syslog(LOG_INFO, "No longer monitoring mirror device %s for events.",
 	       device);
 	dmeventd_lvm2_exit();
 	return 1;


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-03-30 14:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-22 10:40 LVM2/daemons/dmeventd/plugins/mirror dmeventd_ mornfall
2010-03-30 14:39 zkabelac

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).