From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lindsay Haisley Date: Fri, 19 Nov 2004 16:44:55 +0000 Subject: Re: USB/VMWare question Message-Id: <20041119164455.GC10981@fmp.com> List-Id: References: <20041116044028.GA11922@fmp.com> In-Reply-To: <20041116044028.GA11922@fmp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org 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://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