From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: RFC: Automatically making a PCI device assignable in the config file Date: Wed, 10 Jul 2013 15:48:00 +0100 Message-ID: <51DD7420.5050803@eu.citrix.com> References: <20957.26468.175816.677766@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20957.26468.175816.677766@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: Ian Campbell , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On 10/07/13 14:53, Ian Jackson wrote: > George Dunlap writes ("RFC: Automatically making a PCI device assignable in the config file"): >> I've been doing some work to try to make driver domains easier to set >> up and use. At the moment, in order to pass a device through to a >> guest, you first need to assign it to pciback. This involves doing >> one of three things: >> * Running xl pci-assignable-add for the device >> * Specifying the device to be grabbed on the dom0 Linux command-line >> * Doing some hackery in /etc/modules.d >> >> None of these are very satisfying. What I think would be better is if >> there was a way to specify in the guest config file, "If device X is >> not assignable, try to make it assignable". That way you can have a >> driver domain grab the appropriate device just by running "xl create >> domnet"; and once we have the xendomains script up and running with >> xl, you can simply configure your domnet appropriately, and then put >> it in /etc/xen/auto, to be started automatically on boot. >> >> My initial idea was to add a parameter to the pci argument in the >> config file; for example: >> >> pci = ['08:04.1,permissive=1,seize=1'] >> >> The 'seize=1' would indicate that if bdf 08:04.1 is not already >> assignable, that xl should try to make is assignable. > I think it's a design error that this isn't done automatically by > default. > > It would be nice if there was a safety check that the device isn't > currently in use by dom0, but I don't think it's essential. We could > just put a note in the docs saying "if you specify your dom0 nic it > will go away, duh" or something. I think it's a really bad interface decision if a simple typo might result in you yanking out your disk. But in any case, if you think libxl_pci_attach() should automatically grab the device, that makes things a lot easier. I'll write up a patch to add a "seize" flag and that will be that. -George