
On Wed, May 04, 2011 at 10:17:39PM +0800, guan qin wrote:
Hi, I try to use VT-d, but meet with a strange problem .
I create a VM through "virsh create ***.xml",as follows: root@shahe26:~# virsh create vt_d_debian.xml Domain vt_d_debian created from vt_d_debian.xml user.log: May 4 06:53:30 shahe26 libvirtd: 06:53:30.649: warning : qemudParsePCIDeviceStrs:1422 : Unexpected exit status '1', qemu probably failed May 4 06:53:30 shahe26 libvirtd: 06:53:30.805: warning : qemudParsePCIDeviceStrs:1422 : Unexpected exit status '1', qemu probably failed May 4 06:53:38 shahe26 libvirtd: 06:53:38.393: error : qemuMonitorCommandWithHandler:255 : cannot send monitor command 'info balloon': Connection reset by peer May 4 06:53:38 shahe26 libvirtd: 06:53:38.393: error : qemuMonitorTextGetBalloonInfo:555 : operation failed: could not query memory balloon allocation
This indicates that QEMU shutdown immediately after being launched.
libvirt/qemu/vt_d_debian.log LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin HOME=/ QEMU_AUDIO_DRV=none /usr/bin/kvm -S -M pc-0.12 -enable-kvm -m 512 -smp 1,sockets=1,cores=1,threads=1 -name vt_d_debian -uuid 5ed196df-319b-7be2-28f4-a070e0ca9d77 -nodefaults -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/vt_d_debian.monitor,server,nowait -mon chardev=monitor,mode=readline -rtc base=utc -boot c -drive file=/root/debian_dev.img,if=none,id=drive-virtio-disk0,boot=on,format=raw -device virtio-blk-pci,bus=pci.0,addr=0x3,drive=drive-virtio-disk0,id=virtio-disk0 -usb -device usb-mouse,id=input0 -vnc 127.0.0.1:0 -vga cirrus -device pci-assign,host=02:00.1,id=hostdev0,bus=pci.0,addr=0x4 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 Failed to assign irq for "hostdev0": Operation not permitted Perhaps you are assigning a device that shares an IRQ with another device? Failed to assign irq for "hostdev0": Operation not permitted Perhaps you are assigning a device that shares an IRQ with another device? Failed to assign irq for "hostdev0": Operation not permitted Perhaps you are assigning a device that shares an IRQ with another device? Failed to assign irq for "hostdev0": Operation not permitted Perhaps you are assigning a device that shares an IRQ with another device? Failed to assign irq for "hostdev0": Operation not permitted Perhaps you are assigning a device that shares an IRQ with another device? Failed to assign irq for "hostdev0": Operation not permitted Perhaps you are assigning a device that shares an IRQ with another device? Failed to assign irq for "hostdev0": Operation not permitted Perhaps you are assigning a device that shares an IRQ with another device? Failed to assign irq for "hostdev0": Operation not permitted Perhaps you are assigning a device that shares an IRQ with another device? Failed to assign irq for "hostdev0": Operation not permitted Perhaps you are assigning a device that shares an IRQ with another device? Failed to assign irq for "hostdev0": Operation not permitted Perhaps you are assigning a device that shares an IRQ with another device? Failed to assign irq for "hostdev0": Operation not permitted Perhaps you are assigning a device that shares an IRQ with another device? assigned_dev_pci_read_config: pread failed, ret = 0 errno = 1
This pretty much tells us the problem is with the PCI device you tried to assign to the guest.
dmesg information is in the attached file dmesg.
<domain type='kvm'> <name>vt_d_debian</name> <description>just test using sriov!</description> <os> <type>hvm</type> <boot dev='hd'/> </os>
<memory>524288</memory> <currentMemory>524288</currentMemory> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash>
<features><pae/><acpi/><apic/></features> <clock offset='utc'/> <devices> <input type='mouse' bus='usb'/> <disk type='file' device='disk'> <source file='/root/debian_dev.img'/>
<!--> use virtio or /'ide' in ide io </!--> <target dev='hda' bus='virtio'/> </disk>
<emulator>/usr/bin/kvm</emulator> <graphics type='vnc' port='-1'/>
<!--> VT-d or sr-iov assign a pci device just use the hostdev element! When managed is "yes" for a PCI device, it is detached from the host before being passed on to the guest. </!--> <hostdev mode='subsystem' type='pci' managed='yes'> <source> <address bus='0x2' slot='0x0' function='0x1'/> </source> </hostdev>
You don't mention what version of libvirt / kvm you have ... ? If you have oldish versions, you might need to edit /etc/libvirt/qemu.conf and set 'clear_emulator_capabilities = 0', and user=0, group=0 to make QEMU run as root with full privileges. Newer versions can run fully unprivileged. The other possibility is that this PCI device really *is* sharing an IRQ with another device on your host, in which case you're more or less out of luck & can't assign this device. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|