Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Oct 2013 22:00:55 +0000 (UTC)
From:      Alan Somers <asomers@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r256355 - projects/zfsd/head/cddl/sbin/zfsd
Message-ID:  <201310112200.r9BM0tN2044162@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: asomers
Date: Fri Oct 11 22:00:54 2013
New Revision: 256355
URL: http://svnweb.freebsd.org/changeset/base/256355

Log:
  Modify the parsing of device control attach and detach events to tolerate
  the timestamp key<=>value pair added to all events in changeset 256353.
  
  cddl/sbin/zfsd/dev_ctl_event.cc:
  	o In DevCtlEvent::ParseEventString(), remove code that verified that
  	  attach and detach events contained no trailing key<=>value pairs
  	  after the "parent" field.
  	o Fix whitespace/style error in an if statement.
  
  Submitted by:	gibbs
  Approved by:	ken (mentor)
  Sponsored By:	Spectra Logic Corporation

Modified:
  projects/zfsd/head/cddl/sbin/zfsd/dev_ctl_event.cc

Modified: projects/zfsd/head/cddl/sbin/zfsd/dev_ctl_event.cc
==============================================================================
--- projects/zfsd/head/cddl/sbin/zfsd/dev_ctl_event.cc	Fri Oct 11 21:55:12 2013	(r256354)
+++ projects/zfsd/head/cddl/sbin/zfsd/dev_ctl_event.cc	Fri Oct 11 22:00:54 2013	(r256355)
@@ -256,7 +256,7 @@ DevCtlEvent::GetTimestamp() const
 	timeval tv_timestamp;
 	struct tm tm_timestamp;
 
-	if ( ! Contains("timestamp") ) {
+	if (!Contains("timestamp")) {
 		throw ZfsdException("Event contains no timestamp: %s",
 				m_eventString.c_str());
 	}
@@ -320,17 +320,6 @@ DevCtlEvent::ParseEventString(DevCtlEven
 		start += 4;
 		end = eventString.find_first_of(" \t\n", start);
 		nvpairs["parent"] = eventString.substr(start, end);
-		if (end == string::npos)
-			break;
-
-		/*
-		 * The parent field should terminate the event with the
-		 * exception of trailing whitespace.
-		 */
-		end = eventString.find_first_not_of(" \t\n", end);
-		if (end != string::npos)
-			throw ParseException(ParseException::INVALID_FORMAT,
-					     end);
 		break;
 	case NOTIFY:
 		break;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310112200.r9BM0tN2044162>