From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Graf Subject: Re: [PATCH] Inform users about busy device assignment attempt Date: Wed, 09 Dec 2009 20:18:21 +0100 Message-ID: <4B1FF7FD.5080407@suse.de> References: <1260381853-8954-1-git-send-email-agraf@suse.de> <20091209181956.GA13487@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: "Daniel P. Berrange" Return-path: Received: from cantor2.suse.de ([195.135.220.15]:42126 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757184AbZLITSP (ORCPT ); Wed, 9 Dec 2009 14:18:15 -0500 In-Reply-To: <20091209181956.GA13487@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Daniel P. Berrange wrote: > On Wed, Dec 09, 2009 at 07:04:13PM +0100, Alexander Graf wrote: > >> When using -pcidevice on a device that is already in use by a kernel driver >> all the user gets is the following (very useful) information: >> >> Failed to assign device "04:00.0" : Device or resource busy >> Failed to deassign device "04:00.0" : Invalid argument >> Error initializing device pci-assign >> >> Since I usually prefer to have my computer do the thinking for me, I figured >> it might be a good idea to check and see if a device is actually used by a >> driver. If so, tell the user. >> >> So with this patch applied you get the following output: >> >> Failed to assign device "04:00.0" : Device or resource busy >> *** The driver 'igb' is occupying your device 04:00.0. >> *** Try running "rmmod igb" on the commandline >> Failed to deassign device "04:00.0" : Invalid argument >> Error initializing device pci-assign >> >> That should keep people like me from doing the most obvious misuses :-). >> > > Unconditionally telling people to run rmmod is a pretty dangerous thing > todo. If they typod and gave the PCI addr of their disk controller instead > of the NIC, they'll be less than happy at the results of our recommended > command to "fix" the error. Likewise if they have multiple devices using > the same driver & just want to assign one of them. I think it is safer to > just have the first bit of your proposed error message > > "The device 04:00.0 is in use by the kernel driver 'igb'." > > > NB 'rmmod' is not the ideal approach for PCI assignment. It is better > to explicitly re-bind the device to 'pcistub' because that ensures that > no other driver will ever be able to reclaim the device. > Oh - mind to get into detail there? It'd be great if we could tell users an even better way to unbind their device from the driver than rmmod :) Alex