From: Mike Burns <mburns@redhat.com>
To: Lucas Meneghel Rodrigues <mrodrigu@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: [KVM-AUTOTEST PATCH] Instead of trying to remove kvm modules with rmmod, use modprobe -r, as it handles module dependencies better
Date: Tue, 19 May 2009 13:26:07 -0400 [thread overview]
Message-ID: <4A12EBAF.7080302@redhat.com> (raw)
In-Reply-To: <1242338026.2554.44.camel@localhost.localdomain>
Lucas Meneghel Rodrigues wrote:
> In certain situations, trying to do a rmmod on the kvm modules might
> generate errors, as there is a chain of dependencies involved. Instead,
> let's use modprobe -r, as it handles dependencies.
>
> Signed-off-by: Lucas Meneghel Rodrigues <mrodrigu@redhat.com>
>
> diff --git a/client/tests/kvm_runtest_2/kvm_install.py b/client/tests/kvm_runtes
> index dbf8401..c27c6c7 100755
> --- a/client/tests/kvm_runtest_2/kvm_install.py
> +++ b/client/tests/kvm_runtest_2/kvm_install.py
> @@ -192,9 +192,9 @@ def __load_kvm_modules():
> #utils.system("pkill qemu 1>/dev/null 2>&1", ignore_status=True)
> utils.system("pkill qemu", ignore_status=True)
> #if utils.system("grep kvm_%s /proc/modules 1>/dev/null" % vendor, ignore_s
> - utils.system("/sbin/rmmod kvm_%s" % vendor, ignore_status=True)
> + utils.system("/sbin/modprobe -r kvm_%s" % vendor, ignore_status=True)
> #if utils.system("grep kvm /proc/modules 1>/dev/null", ignore_status=True)
> - utils.system("/sbin/rmmod kvm", ignore_status=True)
> + utils.system("/sbin/modprobe -r kvm", ignore_status=True)
>
> if utils.system("grep kvm /proc/modules 1>/dev/null", ignore_status=True) =
> message = "Failed to remove old KVM modules"
>
>
In normal situations, this works perfectly fine. It also suppresses the
output to stderr if a module is not already loaded on the machine.
Errors are are still encountered, however, if another module is
installed that depends on one of the modules kvm_install is trying to
remove. In my environment, I have a module, ksm, which depends on kvm
being loaded. If I modprobe -r kvm, them it will fail saying "Module
kvm is in use". Overall, this is a minimal impact change that doesn't
cause any problems, but it doesn't seem to address the initial problem
of having other modules that depend on one of the kvm modules.
Mike
next prev parent reply other threads:[~2009-05-19 17:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-14 21:53 [KVM-AUTOTEST PATCH] Instead of trying to remove kvm modules with rmmod, use modprobe -r, as it handles module dependencies better Lucas Meneghel Rodrigues
2009-05-19 17:26 ` Mike Burns [this message]
2009-05-24 14:54 ` Avi Kivity
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=4A12EBAF.7080302@redhat.com \
--to=mburns@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mrodrigu@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