public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2/daemons/dmeventd/plugins/snapshot dmevent ...
@ 2011-04-08 14:18 zkabelac
  0 siblings, 0 replies; 5+ messages in thread
From: zkabelac @ 2011-04-08 14:18 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-04-08 14:18:40

Modified files:
	daemons/dmeventd/plugins/snapshot: dmeventd_snapshot.c 

Log message:
	Use dm_snprintf
	
	and fix differently signed comparation.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c.diff?cvsroot=lvm2&r1=1.14&r2=1.15

--- LVM2/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c	2011/02/14 14:26:36	1.14
+++ LVM2/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c	2011/04/08 14:18:40	1.15
@@ -125,8 +125,8 @@
 		syslog(LOG_ERR, "Unable to determine VG name from %s.", device);
 		return 0;
 	}
-	if (sizeof(cmd_str) <= snprintf(cmd_str, sizeof(cmd_str),
-					"lvextend --use-policies %s/%s", vg, lv)) {
+	if (dm_snprintf(cmd_str, sizeof(cmd_str),
+			"lvextend --use-policies %s/%s", vg, lv) < 0) {
 		syslog(LOG_ERR, "Unable to form LVM command: Device name too long.");
 		return 0;
 	}


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

* LVM2/daemons/dmeventd/plugins/snapshot dmevent ...
@ 2011-10-19 14:31 mornfall
  0 siblings, 0 replies; 5+ messages in thread
From: mornfall @ 2011-10-19 14:31 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mornfall@sourceware.org	2011-10-19 14:31:49

Modified files:
	daemons/dmeventd/plugins/snapshot: dmeventd_snapshot.c 

Log message:
	Remove a redundant (and in some cases, misleading) message about snapshot
	extension, in the snapshot dmeventd plugin. The reporting is done as needed by
	the LVM command nowadays.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c.diff?cvsroot=lvm2&r1=1.15&r2=1.16

--- LVM2/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c	2011/04/08 14:18:40	1.15
+++ LVM2/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c	2011/10/19 14:31:49	1.16
@@ -119,7 +119,6 @@
 {
 	char *vg = NULL, *lv = NULL, *layer = NULL;
 	char cmd_str[1024];
-	int r = 0;
 
 	if (!dm_split_lvm_name(dmeventd_lvm2_pool(), device, &vg, &lv, &layer)) {
 		syslog(LOG_ERR, "Unable to determine VG name from %s.", device);
@@ -131,10 +130,7 @@
 		return 0;
 	}
 
-	r = dmeventd_lvm2_run(cmd_str);
-	syslog(LOG_INFO, "Extension of snapshot %s/%s %s.", vg, lv,
-	       (r == ECMD_PROCESSED) ? "finished successfully" : "failed");
-	return r == ECMD_PROCESSED;
+	return dmeventd_lvm2_run(cmd_str) == ECMD_PROCESSED;
 }
 
 static void _umount(const char *device, int major, int minor)


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

* LVM2/daemons/dmeventd/plugins/snapshot dmevent ...
@ 2011-02-14 14:26 mornfall
  0 siblings, 0 replies; 5+ messages in thread
From: mornfall @ 2011-02-14 14:26 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mornfall@sourceware.org	2011-02-14 14:26:37

Modified files:
	daemons/dmeventd/plugins/snapshot: dmeventd_snapshot.c 

Log message:
	Avoid flooding syslog with redundant messages when a snapshot is invalidated
	(reported by Corey).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c.diff?cvsroot=lvm2&r1=1.13&r2=1.14

--- LVM2/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c	2010/11/23 21:19:45	1.13
+++ LVM2/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c	2011/02/14 14:26:36	1.14
@@ -200,7 +200,6 @@
 	_parse_snapshot_params(params, &status);
 
 	if (status.invalid) {
-		syslog(LOG_ERR, "Trying to umount invalid snapshot %s...\n", device);
 		struct dm_info info;
 		if (dm_task_get_info(dmt, &info)) {
 			dmeventd_lvm2_unlock();


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

* LVM2/daemons/dmeventd/plugins/snapshot dmevent ...
@ 2010-02-15 12:55 prajnoha
  0 siblings, 0 replies; 5+ messages in thread
From: prajnoha @ 2010-02-15 12:55 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2433 bytes --]

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	prajnoha@sourceware.org	2010-02-15 12:55:20

Modified files:
	daemons/dmeventd/plugins/snapshot: dmeventd_snapshot.c 

Log message:
	Rename "stat" to "status" in dmeventd_snapshot.c.
	
	Otherwise "warning: declaration of ‘stat’ shadows a global declaration"
	will appear because it shadows "stat" from stat.h.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c.diff?cvsroot=lvm2&r1=1.7&r2=1.8

--- LVM2/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c	2010/01/22 12:48:58	1.7
+++ LVM2/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c	2010/02/15 12:55:20	1.8
@@ -38,7 +38,7 @@
 
 /* FIXME possibly reconcile this with target_percent when we gain
    access to regular LVM library here. */
-static void _parse_snapshot_params(char *params, struct snap_status *stat)
+static void _parse_snapshot_params(char *params, struct snap_status *status)
 {
 	char *p;
 	/*
@@ -46,10 +46,10 @@
 	 * Invalid	-- snapshot invalidated
 	 * Unknown	-- status unknown
 	 */
-	stat->used = stat->max = 0;
+	status->used = status->max = 0;
 
 	if (!strncmp(params, "Invalid", 7)) {
-		stat->invalid = 1;
+		status->invalid = 1;
 		return;
 	}
 
@@ -66,8 +66,8 @@
 	*p = '\0';
 	p++;
 
-	stat->used = atoi(params);
-	stat->max = atoi(p);
+	status->used = atoi(params);
+	status->max = atoi(p);
 }
 
 void process_event(struct dm_task *dmt,
@@ -78,7 +78,7 @@
 	uint64_t start, length;
 	char *target_type = NULL;
 	char *params;
-	struct snap_status stat = { 0 };
+	struct snap_status status = { 0 };
 	const char *device = dm_task_get_name(dmt);
 	int percent, *percent_warning = (int*)private;
 
@@ -92,18 +92,18 @@
 	if (!target_type)
 		goto out;
 
-	_parse_snapshot_params(params, &stat);
+	_parse_snapshot_params(params, &status);
 	/*
 	 * If the snapshot has been invalidated or we failed to parse
 	 * the status string. Report the full status string to syslog.
 	 */
-	if (stat.invalid || !stat.max) {
+	if (status.invalid || !status.max) {
 		syslog(LOG_ERR, "Snapshot %s changed state to: %s\n", device, params);
 		*percent_warning = 0;
 		goto out;
 	}
 
-	percent = 100 * stat.used / stat.max;
+	percent = 100 * status.used / status.max;
 	if (percent >= *percent_warning) {
 		syslog(LOG_WARNING, "Snapshot %s is now %i%% full.\n", device, percent);
 		/* Print warning on the next multiple of WARNING_STEP. */


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

* LVM2/daemons/dmeventd/plugins/snapshot dmevent ...
@ 2010-01-22  0:18 agk
  0 siblings, 0 replies; 5+ messages in thread
From: agk @ 2010-01-22  0:18 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2010-01-22 00:18:37

Modified files:
	daemons/dmeventd/plugins/snapshot: dmeventd_snapshot.c 

Log message:
	fix lib include

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c.diff?cvsroot=lvm2&r1=1.5&r2=1.6

--- LVM2/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c	2010/01/21 22:15:46	1.5
+++ LVM2/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c	2010/01/22 00:18:37	1.6
@@ -12,7 +12,7 @@
  * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "dmlib.h"
+#include "lib.h"
 
 #include "lvm2cmd.h"
 #include "errors.h"


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

end of thread, other threads:[~2011-10-19 14:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-08 14:18 LVM2/daemons/dmeventd/plugins/snapshot dmevent zkabelac
  -- strict thread matches above, loose matches on Subject: below --
2011-10-19 14:31 mornfall
2011-02-14 14:26 mornfall
2010-02-15 12:55 prajnoha
2010-01-22  0:18 agk

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).