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...
|