public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Mike Burns <mburns@redhat.com>
Cc: kvm@vger.kernel.org, lmr@redhat.com, ulublin@redhat.com,
	dhuff@redhat.com
Subject: Re: [PATCH][KVM-AUTOTEST] Make code to remove kvm modules more robust
Date: Sun, 24 May 2009 18:36:16 +0300	[thread overview]
Message-ID: <4A196970.9070709@redhat.com> (raw)
In-Reply-To: <1242849851-8029-1-git-send-email-mburns@redhat.com>

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


  reply	other threads:[~2009-05-24 15:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-20 20:04 [PATCH][KVM-AUTOTEST] Make code to remove kvm modules more robust Mike Burns
2009-05-24 15:36 ` Avi Kivity [this message]
2009-05-25 13:41 ` Lucas Meneghel Rodrigues
2009-05-25 16:40   ` Avi Kivity
2009-05-26  4:43     ` Lucas Meneghel Rodrigues

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A196970.9070709@redhat.com \
    --to=avi@redhat.com \
    --cc=dhuff@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=lmr@redhat.com \
    --cc=mburns@redhat.com \
    --cc=ulublin@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox