public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2/daemons/dmeventd libdevmapper-event.c
@ 2011-01-06  9:45 zkabelac
  0 siblings, 0 replies; 6+ messages in thread
From: zkabelac @ 2011-01-06  9:45 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-01-06 09:45:05

Modified files:
	daemons/dmeventd: libdevmapper-event.c 

Log message:
	Remove unneeded stack prints after log_error

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/libdevmapper-event.c.diff?cvsroot=lvm2&r1=1.37&r2=1.38

--- LVM2/daemons/dmeventd/libdevmapper-event.c	2010/12/22 15:28:44	1.37
+++ LVM2/daemons/dmeventd/libdevmapper-event.c	2011/01/06 09:45:05	1.38
@@ -432,7 +432,6 @@
 
 		log_error("%s: Can't open client fifo %s: %s",
 			  __func__, fifos->client_path, strerror(errno));
-		stack;
 		return 0;
 	}
 
@@ -441,7 +440,7 @@
 
 	if (!strncmp(DMEVENTD_PATH, "/", 1) && stat(DMEVENTD_PATH, &statbuf)) {
 		log_error("Unable to find dmeventd.");
-		return_0;
+		return 0;
 	}
 
 	pid = fork();
@@ -479,7 +478,6 @@
 	if ((fifos->server = open(fifos->server_path, O_RDWR)) < 0) {
 		log_error("%s: open server fifo %s",
 			  __func__, fifos->server_path);
-		stack;
 		return 0;
 	}
 
@@ -495,7 +493,6 @@
 		log_error("%s: Can't open client fifo %s: %s",
 			  __func__, fifos->client_path, strerror(errno));
 		close(fifos->server);
-		stack;
 		return 0;
 	}
 


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

* LVM2/daemons/dmeventd libdevmapper-event.c
@ 2012-03-01 10:41 zkabelac
  0 siblings, 0 replies; 6+ messages in thread
From: zkabelac @ 2012-03-01 10:41 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-03-01 10:41:49

Modified files:
	daemons/dmeventd: libdevmapper-event.c 

Log message:
	More useful debug message

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/libdevmapper-event.c.diff?cvsroot=lvm2&r1=1.47&r2=1.48

--- LVM2/daemons/dmeventd/libdevmapper-event.c	2012/02/28 11:03:24	1.47
+++ LVM2/daemons/dmeventd/libdevmapper-event.c	2012/03/01 10:41:48	1.48
@@ -731,8 +731,8 @@
 	if (_do_event(next ? DM_EVENT_CMD_GET_NEXT_REGISTERED_DEVICE :
 		      DM_EVENT_CMD_GET_REGISTERED_DEVICE, dmevh->dmeventd_path,
 		      &msg, dmevh->dso, uuid, dmevh->mask, 0)) {
+		log_debug("%s: device not registered.", dm_task_get_name(dmt));
 		ret = -ENOENT;
-		stack;
 		goto fail;
 	}
 


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

* LVM2/daemons/dmeventd libdevmapper-event.c
@ 2011-07-08 12:35 agk
  0 siblings, 0 replies; 6+ messages in thread
From: agk @ 2011-07-08 12:35 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2011-07-08 12:35:48

Modified files:
	daemons/dmeventd: libdevmapper-event.c 

Log message:
	report which dev was not found

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/libdevmapper-event.c.diff?cvsroot=lvm2&r1=1.41&r2=1.42

--- LVM2/daemons/dmeventd/libdevmapper-event.c	2011/04/04 16:11:09	1.41
+++ LVM2/daemons/dmeventd/libdevmapper-event.c	2011/07/08 12:35:48	1.42
@@ -559,10 +559,19 @@
 	}
 
 	if (!info.exists) {
-		log_error("_get_device_info: device not found");
+		log_error("_get_device_info: %s%s%s%.0d%s%.0d%s%s: device not found",
+			  dmevh->uuid ? : "", 
+			  (!dmevh->uuid && dmevh->dev_name) ? dmevh->dev_name : "", 
+			  (!dmevh->uuid && !dmevh->dev_name && dmevh->major > 0) ? "(" : "",
+			  (!dmevh->uuid && !dmevh->dev_name && dmevh->major > 0) ? dmevh->major : 0,
+			  (!dmevh->uuid && !dmevh->dev_name && dmevh->major > 0) ? ":" : "",
+			  (!dmevh->uuid && !dmevh->dev_name && dmevh->minor > 0) ? dmevh->minor : 0,
+			  (!dmevh->uuid && !dmevh->dev_name && dmevh->major > 0) && dmevh->minor == 0 ? "0" : "",
+			  (!dmevh->uuid && !dmevh->dev_name && dmevh->major > 0) ? ") " : "");
 		goto bad;
 	}
 
+		  
 	return dmt;
 
       bad:


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

* LVM2/daemons/dmeventd libdevmapper-event.c
@ 2011-01-06 10:45 zkabelac
  0 siblings, 0 replies; 6+ messages in thread
From: zkabelac @ 2011-01-06 10:45 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-01-06 10:45:41

Modified files:
	daemons/dmeventd: libdevmapper-event.c 

Log message:
	Remove dead assignment of 'ret' value
	
	Variable 'ret' assigned from _do_event() was actually not used and replaced with next
	assignment without any read of the returned value.
	
	Code is reformated - so the error path is put in the if() branch and normal
	code is put after the 'if' together with FIXME comment.
	
	FIXME lowprio: logging needs to be fixed in this code,
	- multiple log_errors are printed, stacks are missing...

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/libdevmapper-event.c.diff?cvsroot=lvm2&r1=1.38&r2=1.39

--- LVM2/daemons/dmeventd/libdevmapper-event.c	2011/01/06 09:45:05	1.38
+++ LVM2/daemons/dmeventd/libdevmapper-event.c	2011/01/06 10:45:41	1.39
@@ -715,17 +715,18 @@
 
 	uuid = dm_task_get_uuid(dmt);
 
-	if (!(ret = _do_event(next ? DM_EVENT_CMD_GET_NEXT_REGISTERED_DEVICE :
-			     DM_EVENT_CMD_GET_REGISTERED_DEVICE, dmevh->dmeventd_path,
-			      &msg, dmevh->dso, uuid, dmevh->mask, 0))) {
-		/* FIXME this will probably horribly break if we get
-		   ill-formatted reply */
-		ret = _parse_message(&msg, &reply_dso, &reply_uuid, &reply_mask);
-	} else {
+	if (_do_event(next ? DM_EVENT_CMD_GET_NEXT_REGISTERED_DEVICE :
+		      DM_EVENT_CMD_GET_REGISTERED_DEVICE, dmevh->dmeventd_path,
+		      &msg, dmevh->dso, uuid, dmevh->mask, 0)) {
 		ret = -ENOENT;
+		stack;
 		goto fail;
 	}
 
+	/* FIXME this will probably horribly break if we get
+	   ill-formatted reply */
+	ret = _parse_message(&msg, &reply_dso, &reply_uuid, &reply_mask);
+
 	dm_task_destroy(dmt);
 	dmt = NULL;
 


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

* LVM2/daemons/dmeventd libdevmapper-event.c
@ 2010-03-24 11:36 zkabelac
  0 siblings, 0 replies; 6+ messages in thread
From: zkabelac @ 2010-03-24 11:36 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2010-03-24 11:36:49

Modified files:
	daemons/dmeventd: libdevmapper-event.c 

Log message:
	Move declaration of struct dm_info info to declaration block.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/libdevmapper-event.c.diff?cvsroot=lvm2&r1=1.30&r2=1.31

--- LVM2/daemons/dmeventd/libdevmapper-event.c	2010/01/14 10:11:26	1.30
+++ LVM2/daemons/dmeventd/libdevmapper-event.c	2010/03/24 11:36:48	1.31
@@ -688,6 +688,7 @@
 	enum dm_event_mask reply_mask = 0;
 	struct dm_task *dmt = NULL;
 	struct dm_event_daemon_message msg = { 0, 0, NULL };
+	struct dm_info info;
 
 	if (!(dmt = _get_device_info(dmevh))) {
 		stack;
@@ -746,7 +747,6 @@
 		goto fail;
 	}
 
-	struct dm_info info;
 	if (!dm_task_get_info(dmt, &info)) {
 		ret = -1;
 		goto fail;


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

* LVM2/daemons/dmeventd libdevmapper-event.c
@ 2010-01-14 10:11 zkabelac
  0 siblings, 0 replies; 6+ messages in thread
From: zkabelac @ 2010-01-14 10:11 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2010-01-14 10:11:26

Modified files:
	daemons/dmeventd: libdevmapper-event.c 

Log message:
	Cleanup gcc warning: null argument where non-null required (arg.2)
	As the const declaration of execvp is a bit weird, using local
	dmeventdpath string.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/libdevmapper-event.c.diff?cvsroot=lvm2&r1=1.29&r2=1.30

--- LVM2/daemons/dmeventd/libdevmapper-event.c	2009/07/13 21:26:41	1.29
+++ LVM2/daemons/dmeventd/libdevmapper-event.c	2010/01/14 10:11:26	1.30
@@ -398,6 +398,8 @@
 	int pid, ret = 0;
 	int status;
 	struct stat statbuf;
+	char dmeventdpath[] = DMEVENTD_PATH; /* const type for execvp */
+	char * const args[] = { dmeventdpath, NULL };
 
 	if (stat(fifos->client_path, &statbuf))
 		goto start_server;
@@ -437,7 +439,7 @@
 		log_error("Unable to fork.");
 
 	else if (!pid) {
-		execvp(DMEVENTD_PATH, NULL);
+		execvp(args[0], args);
 		_exit(EXIT_FAILURE);
 	} else {
 		if (waitpid(pid, &status, 0) < 0)


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

end of thread, other threads:[~2012-03-01 10:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-06  9:45 LVM2/daemons/dmeventd libdevmapper-event.c zkabelac
  -- strict thread matches above, loose matches on Subject: below --
2012-03-01 10:41 zkabelac
2011-07-08 12:35 agk
2011-01-06 10:45 zkabelac
2010-03-24 11:36 zkabelac
2010-01-14 10:11 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).