In Xen 4.3, Debian linux Wheezy/Sid, I am using the command: xl pci-assignable-add 04:00.0 To start sharing of my ethernet card to my gateway DomU. This works fine but I am not sure where the command should be executed on startup. Is there a standard script for these commands to allow PCI passthrough before the DomUs are restored by xl? I have tried adding it to the /etc/init.d/xen file under the xend_start() and xend_restart() functions, after "xend_start_real" but it doesn''t seem to work.
Hello Frank, On Sat, Nov 23, Frank wrote:> In Xen 4.3, Debian linux Wheezy/Sid, I am using the command: > xl pci-assignable-add 04:00.0 > To start sharing of my ethernet card to my gateway DomU. > > This works fine but I am not sure where the command should be executed on startup. > Is there a standard script for these commands to allow PCI passthrough before the > DomUs are restored by xl? > > I have tried adding it to the /etc/init.d/xen file under the > xend_start() and xend_restart() functions, after "xend_start_real"you can insert that option in a file /etc/modprobe.d/xen_pciback.conf which contains "options xen-pciback hide=(04:00.0)" And be sure that dom0 doesn''t load the ethernet driver. something like "blacklist drivermodule" where drivermodule is the name of ethernet driver you want to passthrough. Then you have to execute "depmod -a" and reboot the system. To add the ethernet card to a domU automaticly you have to add a line like: "pci = [ ''04:00.0'']" to your DomU config. Hope that helps -- Best regards Dieter -- I do not get viruses because I do not use MS software. If you use Outlook then please do not put my email address in your address-book so that WHEN you get a virus it won''t use my address in the From field.
Begin forwarded message:> From: Frank <xen_help@greenant.net> > Subject: Re: [Xen-users] correct config file to start PCI passthrough > Date: 25 November 2013 3:40:38 AM AEDT > To: Dieter Bloms <dieter@bloms.de> > > >> ok, the ethernet driver is loaded before the pciback. >> So you have to put the pciback driver into the ramdisc to be sure it is >> loaded before the ethernet driver so it can catch the pci device before >> the ethernet driver gets it. > > I''m afraid I don''t understand, the manual command > xl pci-assignable-add 04:00.0 > works well. Why not just use this command in a script? >_______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
On Sat, 2013-11-23 at 17:00 +1100, Frank wrote:> In Xen 4.3, Debian linux Wheezy/Sid, I am using the command: > xl pci-assignable-add 04:00.0 > To start sharing of my ethernet card to my gateway DomU. > > This works fine but I am not sure where the command should be executed on startup. > Is there a standard script for these commands to allow PCI passthrough before the > DomUs are restored by xl? > > I have tried adding it to the /etc/init.d/xen file under the > xend_start() and xend_restart() functions, after "xend_start_real" > > but it doesn''t seem to work.I doubt xend_start is being run if you are using xl. Perhaps try somewhere else in that file? Ian.
>> In Xen 4.3, Debian linux Wheezy/Sid, I am using the command: >> xl pci-assignable-add 04:00.0 >> To start sharing of my ethernet card to my gateway DomU. >> >> This works fine but I am not sure where the command should be executed on startup. >> Is there a standard script for these commands to allow PCI passthrough before the >> DomUs are restored by xl? >> >> I have tried adding it to the /etc/init.d/xen file under the >> xend_start() and xend_restart() functions, after "xend_start_real" >> >> but it doesn''t seem to work. > > I doubt xend_start is being run if you are using xl. Perhaps try > somewhere else in that file? > > Ian. >A good idea, I have tried inserting into /etc/init.d/xendomains instead I placed it as listed below, it correctly brings up the PCI Passthrough: … do_start_restore() { [ -n "$XENDOMAINS_SAVE" ] || return [ -d "$XENDOMAINS_SAVE" ] || return [ -n "$XENDOMAINS_RESTORE" ] || return xl pci-assignable-add 04:00.0 for file in $XENDOMAINS_SAVE/*; do …. do_start_auto() { [ -n "$XENDOMAINS_AUTO" ] || return [ -d "$XENDOMAINS_AUTO" ] || return xl pci-assignable-add 04:00.0 for file in $XENDOMAINS_AUTO/*; do name="$(check_config_name $file)" ….. seems to work well (although I think it is executing twice on boot) but this flagged another issue, when suspending/saving a domain with PCI passthrough active it throws errors including: Saving …….. FAIL xc: progress: Saving memory: iter (…….. xc: error: Fatal PT Race (pfn 281c24, type 10000000): Internal error libxl: error: libel_dom.c:1370:libxl__xc_domain_save_done: saving domain: domain responded to suspend request : invalid argument Failed to save domain, resuming domain This is documented in the wiki with the suggestion of running pci-detach before shutdown: xl pci-detach machinename 04:00.0 I guess attaching again before resuming would work but it''s getting convoluted so I decided to change on_reboot to ''destroy'' and place the machine in /etc/xen/auto It would be nice if these attach/detach statements were handled properly by the start/stop scripts if a PCI passthrough was configured in the DomU.cfg. Alas, hacking that up is somewhat beyond my proficiencies. This works partially, a reboot brings the machine back up but for some reason xl ignores the destroy directive and is still trying to save the machine rather than just shutting it down (which eventually times out) It looks like /etc/default/xendomains (which is set with a save/restore path) overrides the setting. I have the feeling that there are too many daemons running... _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users