Changes between Version 21 and Version 22 of xen

Feb 23, 2008, 6:13:34 PM (10 years ago)



  • xen

    v21 v22  
    8888If you're on the dom0, and you've attached to the virtual console of a domU with `xm console domUname` , you can detach from the console just as if you were detaching from an old-school telnet session.  Use `Ctrl+]`
     90=== passing pci devices to a domU ===
     92Debian xen has built in support for passing pci devices to domU using the "pciback" module.  The following xen kernel config options are enabled by default:
     94CONFIG_XEN_PCIDEV_FRONTEND=y (for DomU kernels)
     95CONFIG_XEN_PCIDEV_BACKEND=y (for Dom0 kernels)
     98You have to first find the pci device id of the devices you want to pass to the domU.  This is most easily done with '''lspci'''.  The id is given in the first column, usually of form "bus:slot.func" (eg. "00:0a.0"), refered to as "PCIDEV?" below.  Sometimes the device needs to be referred to by it's full address form "domain:bus:slot.func" (eg. "0000:00:0a.0"), referred to as "DPCIDEV?" below.
     100Before passing a pci device to a domU, it must first be hidden from dom0.  You can remove the pci devices manually from the dom0 kernel:
     102# remove the device from the kernel module controlling it
     103DRIVER=$(dirname $(find /sys/bus/pci/drivers -iname "$PCIDEV"))
     104echo -n $DPCIDEV > "$DRIVER"/unbind
     106and then add the devices to to the pciback list:
     108echo -n $DPCIDEV > /sys/bus/pci/drivers/pciback/new_slot
     109echo -n $DPCIDEV > /sys/bus/pci/drivers/pciback/bind
     111To have this happen automatially at boot, first tell the dom0 initramfs to include the "pciback" module.  On Debian, this is easily done by adding "pciback" to /etc/initramfs-tools/modules and then updating the initramfs:
     113echo pciback >> /etc/initramfs-tools/modules
     114update-initramfs -u -k $(uname -r)
     116There are pciback kernel parameters that tell the kernel which pci devices to ignore.  With GRUB, this is best done by adding the needed parameters to the "xenkopt" config line in the grub menu.lst:
     118## Xen Linux kernel options to use with the default Xen boot option               
     119# xenkopt=pciback.permissive pciback.hide=(PCIDEV0 PCIDEV1 ...) pciback.verbose_request=1
     121Don't forget to run '''update-grub'''.  Reboot the machine and make sure the changes take effect. 
     123Now add the pci devices to the domU config with a "pci=[...]" line:
     125pci=['PCIDEV0', 'PCIDEV1', ...]
     127After creating the domU, lspci should show the passed through devices.
     130 * []
     131 * []
    90133== upgrading kernels on Xen instances ==