From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH][KVM-AUTOTEST] Make code to remove kvm modules more robust Date: Sun, 24 May 2009 18:36:16 +0300 Message-ID: <4A196970.9070709@redhat.com> References: <1242849851-8029-1-git-send-email-mburns@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, lmr@redhat.com, ulublin@redhat.com, dhuff@redhat.com To: Mike Burns Return-path: Received: from mx2.redhat.com ([66.187.237.31]:46365 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753677AbZEXPgX (ORCPT ); Sun, 24 May 2009 11:36:23 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n4OFaPAd027883 for ; Sun, 24 May 2009 11:36:25 -0400 In-Reply-To: <1242849851-8029-1-git-send-email-mburns@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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