[libvirt-users] PCI passthrough error

Wen Congyang wency at cn.fujitsu.com
Fri Mar 30 00:42:52 UTC 2012


At 03/30/2012 05:41 AM, Jaap Winius Wrote:
> Hi folks,
> 
> Has anyone encountered the following PCI passthrough error?
> 
>   error: internal error Process exited while reading console \
>          log output: char device redirected to /dev/pts/1
>   assigned_dev_pci_read: pread failed, ret = 0 errno = 2

IIRC, the errno is wrong. ret 0 means that there is no more data in
pci config space. the qemu process's user/group is qemu, and it
can only read first 64/128bytes of the config space. When you
use PCI passthrough, qemu will read PCI device's capabilities.
All the capabilities's offset > 64/128 bits.

Thanks
Wen Congyang

> 
> It's produced after I've detached the PCI device from the base OS and
> have tried to start up the guest domain.
> 
> To get to this point, I mostly followed these instructions:
> 
> http://docs.fedoraproject.org/en-US/Fedora/13/html/Virtualization_Guide/chap-Virtualization-PCI_passthrough.html#sect-Virtualization-PCI_passthrough-AI_device_to_a_host
> 
> 
> The distro I'm using is Debian squeeze, which by default comes with
> libvirt 0.8.3 and qemu-kvm 0.12.5, although to avoid a different PCI
> passthrough error, I used Debian backports for squeeze to upgrade them
> to libvirt 0.9.8 and qemu-kvm 1.0.
> 
> The motherboard involved has VT-d support, which I've enabled with the
> "intel_iommu=on" kernel option (dmesg shows "Intel-IOMMU: enabled"). I
> did not bother with setsebool because SELinux is disabled.
> 
> According to lspci, the device I want to pass through to the guest
> domain, a USB controller, has bus/slot/function 00:1a.0, so I added the
> following stanza to the <devices> section of my guest domain:
> 
>   <hostdev mode='subsystem' type='pci' managed='yes'>
>     <source>
>       <address domain='0x0000' bus='0x00'
>                slot='0x1a' function='0x0'/>
>     </source>
>   </hostdev>
> 
> Actually, every time I save this configuration, libvirt changes it to:
> 
>   <hostdev mode='subsystem' type='pci' managed='yes'>
>     <source>
>       <address domain='0x0000' bus='0x00'
>                slot='0x1a' function='0x0'/>
>     </source>
>     <address type='pci' domain='0x0000' bus='0x00'
>              slot='0x05' function='0x0'/>
>   </hostdev>
> 
> Huh, slot 5? I don't have any PCI devices that use slot 5. Well, at
> least the system doesn't complain, but I worry that this might be a
> symptom of something more serious.
> 
> Anyway, I'd be very grateful if anyone has any tips on how I might avoid
> the aforementioned error and get PCI passthrough to to work.
> 
> Thanks,
> 
> Jaap
> 
> _______________________________________________
> libvirt-users mailing list
> libvirt-users at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-users
> 




More information about the libvirt-users mailing list