linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lindsay Haisley <fmouse-gentoo@fmp.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: USB/VMWare question
Date: Fri, 19 Nov 2004 16:44:55 +0000	[thread overview]
Message-ID: <20041119164455.GC10981@fmp.com> (raw)
In-Reply-To: <20041116044028.GA11922@fmp.com>

Thus spake Richard Troth on Tue, Nov 16, 2004 at 10:43:24AM CST
> I get similar pain with SuSE 9.1 (2.6.4 kernel).
> If you happen to hear of a fix,  and it doesn't get posted,
> please let me know!

Here's my fix.  I'll post it to the hotplug-devel list, too.

I make no recommendation that this patch be included in, or even considered
for future hotplug releases.  It's a specific fix for a specific problem
involving a piece of commercial software (VMware).  Because the developoment
of hotplug and udev is very active, and it looks as if hotplug functionality
may be folded into udev at some point, this fix may have a rather limited
lifespan, however the principle will probably be applicable as long as
module loading is implemented in user space.

This fix is specifically for VMware Workstation.  Other solutions may be
available for VMware server products which come with API tools for
communication between guest and host OSes.  It relies on the simple fact
that the vmmon kernel module is only in use when an instance of VMware
Workstation is running, and lsmod shows a usage count greater than 0. The
patch causes the load_modules function to grep the file
/etc/hotplug/vmblacklist (you have to create this) and if a module listed
therein is requested as the result of a hotplug event, it examines the usage
count on the loaded vmmon module. If no vmmon module is loaded, or if it's
usage count is 0, then the vmblacklisted module is loaded. If the vmmon
module exists and has a usage count greater than 0 then the blacklisted
module is not loaded. This is a patch against
/etc/hotplug/hotplug.functions.

Be sure to use dashes instead of underscores on module names in vmblacklist,
e.g. "usb-storage". The hotplug script expects them.

--- hotplug.functions.orig	2004-11-18 16:55:32.423375746 -0600
+++ hotplug.functions	2004-11-18 17:41:06.757171240 -0600
@@ -134,6 +134,11 @@
 		debug_mesg "... blacklisted module:  $MODULE"
 		continue
 	    fi
+	    if grep -q "^$(echo $MODULE|sed -e 's/[-_]/[-_]/g')\$" $HOTPLUG_DIR/vmblacklist; then
+		if [ "$(lsmod|grep vmmon|awk -F" " '{print $1}')" = "vmmon" -a $(lsmod|grep vmmon|awk -F" " '{print $3}') != "0" ];then
+   		   continue
+		fi
+	    fi
 
 	    # statically linked modules aren't shown by 'lsmod',
 	    # and user mode drivers will ONLY have a setup script;


-- 
Lindsay Haisley       | "Fighting against human |     PGP public key
FMP Computer Services |    creativity is like   |      available at
512-259-1190          |    trying to eradicate  | <http://pubkeys.fmp.com>
http://www.fmp.com    |        dandelions"      |
                      |      (Pamela Jones)     |


-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

      reply	other threads:[~2004-11-19 16:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-16  4:40 USB/VMWare question Lindsay Haisley
2004-11-19 16:44 ` Lindsay Haisley [this message]

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=20041119164455.GC10981@fmp.com \
    --to=fmouse-gentoo@fmp.com \
    --cc=linux-hotplug@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).