Add running_config() function to fetch path of running config

Modify cpu_hotplug test to use it.



git-svn-id: http://test.kernel.org/svn/autotest/trunk@248 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/bin/autotest_utils.py b/bin/autotest_utils.py
index 0d3c6a7..71f9f04 100755
--- a/bin/autotest_utils.py
+++ b/bin/autotest_utils.py
@@ -340,6 +340,17 @@
 	      (elapsed/count, user/count, system/count, cpu/count)
 
 
+def running_config():
+	"""
+	Return path of config file of the currently running kernel
+	"""
+	for config in ('/proc/config.gz', \
+		       '/boot/config-%s' % system_output('uname -r') ):
+		if os.path.isfile(config):
+			return config
+	return None
+
+
 class fd_stack:
 	"""a stack of fd redirects