Ubuntu Server Guide Changes, errors and bugs
Device Passthrough / Hotplug
Download 1.27 Mb. Pdf ko'rish
|
ubuntu-server-guide
If instead of the here described hotplugging you want to always pass through a device add the xml content of the device to your static guest xml representation via e.g. virsh edit don’t need to use attach/detach. There are different kinds of passthrough. Types available to you depend on your Hardware and software setup. • USB hotplug/passthrough • VF hotplug/Passthrough But both kinds are handled in a very similar way and while there are various way to do it (e.g. also via qemu monitor) driving such a change via libvirt is recommended. That way libvirt can try to manage all sorts of special cases for you and also somewhat masks version differences. In general when driving hotplug via libvirt you create a xml snippet that describes the device just as you would do in a static guest description. A usb device is usually identified by Vendor/Product id’s: 103 Virtual functions are usually assigned via their PCI-ID (domain, bus, slot, function). Note To get the Virtual function in the first place is very device dependent and can therefore not be fully covered here. But in general it involves setting up an iommu, registering via VFIO and sometimes requesting a number of VFs. Here an example on ppc64el to get 4 VFs on a device: $ sudo modprobe v f i o −p c i # i d e n t i f y d e v i c e $ l s p c i −n −s 0 0 0 5 : 0 1 : 0 1 . 3 0 0 0 5 : 0 1 : 0 1 . 3 0 2 0 0 : 10 d f : e228 ( r e v 1 0 ) # r e g i s t e r and r e q u e s t VFs $ echo 10 d f e228 | sudo t e e / s y s / bus / p c i / d r i v e r s / v f i o −p c i /new_id $ echo 4 | sudo t e e / s y s / bus / p c i / d e v i c e s / 0 0 0 5 \ : 0 1 \ : 0 0 . 0 / sriov_numvfs You then attach or detach the device via libvirt by relating the guest with the xml snippet. v i r s h a t t a c h −d e v i c e # Use t h e De v i ce i n t t h e Guest v i r s h detach−d e v i c e Download 1.27 Mb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling