Hi.
My Problem is that i want to pass two devices, in my case two identical tv-cards, to my VM. When i have only one card installed it works fine, and i see the device in the VM.
I use Debian Lenny with additional packages from Debian Sid for the KVM packages. The Kernel is a vanilla kernel with modifications, like explained on
http://www.linux-kvm.org/page/How_to_assign...
My Kernel is a 2.6.31 and the kvm version is 85.
My hardware is an AMD X2 4850e on a Gigabyte mainboard (GA-M61P-S3) with a GeForce 6100 / nForce 430 chipset.
I followed all further steps from that page.
Find my tv-cards:
Code:
debian-server:~# lspci | grep SkyStar
01:07.0 Network controller: Techsan Electronics Co Ltd B2C2 FlexCopII DVB chip / Technisat SkyStar2 DVB card (rev 02)
01:09.0 Network controller: Techsan Electronics Co Ltd B2C2 FlexCopII DVB chip / Technisat SkyStar2 DVB card (rev 02)
Check their IRQ's:
Code:
01:07.0 Network controller: Techsan Electronics Co Ltd B2C2 FlexCopII DVB chip / Technisat SkyStar2 DVB card (rev 02)
Subsystem: Techsan Electronics Co Ltd B2C2 FlexCopII DVB chip / Technisat SkyStar2 DVB card
Flags: bus master, slow devsel, latency 32, IRQ 5
Memory at ed400000 (32-bit, non-prefetchable) [size=64K]
I/O ports at d000 [size=32]
01:09.0 Network controller: Techsan Electronics Co Ltd B2C2 FlexCopII DVB chip / Technisat SkyStar2 DVB card (rev 02)
Subsystem: Techsan Electronics Co Ltd B2C2 FlexCopII DVB chip / Technisat SkyStar2 DVB card
Flags: bus master, slow devsel, latency 32, IRQ 7
Memory at ed410000 (32-bit, non-prefetchable) [size=64K]
I/O ports at d400 [size=32]
Check for other devices with identical IRQ:
Code:
debian-server:/var/log# lspci -v | grep IRQ
Flags: 66MHz, fast devsel, IRQ 7
Flags: bus master, 66MHz, fast devsel, latency 0, IRQ 23
Flags: bus master, 66MHz, fast devsel, latency 0, IRQ 22
Flags: bus master, 66MHz, fast devsel, latency 0, IRQ 25
Flags: bus master, 66MHz, fast devsel, latency 0, IRQ 11
Flags: bus master, slow devsel, latency 32, IRQ 5
Flags: bus master, slow devsel, latency 32, IRQ 7
Flags: bus master, stepping, 66MHz, medium devsel, latency 32, IRQ 16
Create new stud-device, unbind cards, bind them to stud-driver. I tried two ways:
Code:
debian-server:~# echo "13d0 2103" > /sys/bus/pci/drivers/pci-stub/new_id
debian-server:~# echo "13d0 2103" > /sys/bus/pci/drivers/pci-stub/new_id
debian-server:~# echo 0000:01:07.0 > /sys/bus/pci/devices/0000\:01\:07.0/driver/unbind
debian-server:~# echo 0000:01:07.0 > /sys/bus/pci/drivers/pci-stub/bind
debian-server:~# echo 0000:01:09.0 > /sys/bus/pci/devices/0000\:01\:09.0/driver/unbind
debian-server:~# echo 0000:01:09.0 > /sys/bus/pci/drivers/pci-stub/bind
and with append
Code:
debian-server:~# echo "13d0 2103" > /sys/bus/pci/drivers/pci-stub/new_id
debian-server:~# echo "13d0 2103" >> /sys/bus/pci/drivers/pci-stub/new_id
debian-server:~# echo 0000:01:07.0 > /sys/bus/pci/devices/0000\:01\:07.0/driver/unbind
debian-server:~# echo 0000:01:07.0 > /sys/bus/pci/drivers/pci-stub/bind
debian-server:~# echo 0000:01:09.0 > /sys/bus/pci/devices/0000\:01\:09.0/driver/unbind
debian-server:~# echo 0000:01:09.0 >> /sys/bus/pci/drivers/pci-stub/bind
Then i added the card in the VM xml file under /etc/libvirt/qemu/Debian.xml (it's nearly at the end):
Code:
<domain type='kvm'>
<name>Debian</name>
<uuid>fef2e6a0-3fb8-d976-c59a-53a4636d712f</uuid>
<memory>786432</memory>
<currentMemory>786432</currentMemory>
<vcpu>2</vcpu>
<os>
<type arch='x86_64' machine='pc'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/kvm</emulator>
<disk type='file' device='cdrom'>
<driver name='qemu' type=''/>
<target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/root/KVM-Images/Debian.qcow2'/>
<target dev='vda' bus='virtio'/>
</disk>
<interface type='bridge'>
<mac address='52:54:00:57:94:c0'/>
<source bridge='br0'/>
<model type='virtio'/>
</interface>
<serial type='pty'>
<source path='/dev/pts/2'/>
<target port='0'/>
</serial>
<console type='pty' tty='/dev/pts/2'>
<source path='/dev/pts/2'/>
<target port='0'/>
</console>
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address domain='0x0000' bus='0x01' slot='0x07' function='0x0'/>
</source>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address domain='0x0000' bus='0x01' slot='0x09' function='0x0'/>
</source>
</hostdev>
<input type='tablet' bus='usb'/>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='5910' autoport='no' keymap='en-us'/>
</devices>
</domain>
When i now try to start my VM with the virt-manager, it stops with an error. An excerpt from /var/log/messages:
Code:
debian-server libvirtd: 18:58:23.326: warning : pciTrySecondaryBusReset:483 : Other devices on bus with 0000:01:07.0, not doing bus reset
The error occurs when i have a second tv-card installed. I can't find any informations about limitations with more than one device on the bus address. As you can see, my tv-cards are on bus number 1 and all onboard components number 0. Is that maybe the problem, that i block the whole bus?
I'm grateful for any ideas or helpful tips.