Mike Burns wrote:
+ +def __unload_modules(module): + lsmod = os.popen("lsmod | grep \"^%s \"" % module)
lsmod = len([x for x in file('/proc/modules).splitlines() if x.split()[0] == module]) > 0 Sorry, I just envy python writers.
+ + #line_count = os.popen("lsmod | grep \"^%s \" | wc -l" % module) + #if line_count > 0: + #kvm_log.info("Found module %s, checking for dependecies..." %module) + #dependencies = os.popen("lsmod | grep \"^%s \" | awk '{print $4}'" % module).readline() + #submodules = dependencies.split(",") + #for submodule in submodules: + #__unload_modules(submodule) +# + # + #kvm_log.info("Found module %s" % module) + #dependencies = os.popen("lsmod | grep \"^%s \" | awk '{print $4}'" % module) + #for line in dependencies.readlines(): + #print "Line: %s" % line + #submodules = line.split(",") +## for submodule in submodules: +## __unload_modules(submodule) + #raise error.TestError, "Aborting..." + #kvm_log.info("Deleting Module %s" % module) + #utils.system("/sbin/modprobe -r %s" % module) +
Please don't add dead code. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html