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

root@shahe26:~# virsh list
 Id Name                 State
----------------------------------
  4 vt_d_debian          running

root@shahe26:~# virsh list
 Id Name                 State
----------------------------------
  4 vt_d_debian          running

root@shahe26:~# virsh list
 Id Name                 State
----------------------------------
  4 vt_d_debian          running

root@shahe26:~# virsh list
 Id Name                 State
----------------------------------
  4 vt_d_debian          no state

root@shahe26:~# virsh list
 Id Name                 State
----------------------------------

root@shahe26:~# vim vt_d_debian.xml

The VM has already killed itself.

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

kern.log:
May  4 06:53:30 shahe26 kernel: [ 2249.587662] ixgbe: eth2: ixgbe_remove: complete
May  4 06:53:30 shahe26 kernel: [ 2249.587680] ixgbe 0000:02:00.1: PCI INT B disabled
May  4 06:53:30 shahe26 kernel: [ 2249.587718] pci-stub 0000:02:00.1: claimed by stub
May  4 06:53:30 shahe26 kernel: [ 2249.697347] pci-stub 0000:02:00.1: PCI INT B -> GSI 34 (level, low) -> IRQ 34
May  4 06:53:30 shahe26 kernel: [ 2249.797730] pci-stub 0000:02:00.1: restoring config space at offset 0xf (was 0x200, writing 0x205)
May  4 06:53:30 shahe26 kernel: [ 2249.797737] pci-stub 0000:02:00.1: restoring config space at offset 0xc (was 0x0, writing 0xfbd20000)
May  4 06:53:30 shahe26 kernel: [ 2249.797745] pci-stub 0000:02:00.1: restoring config space at offset 0x8 (was 0x4, writing 0xfbd1c004)
May  4 06:53:30 shahe26 kernel: [ 2249.797751] pci-stub 0000:02:00.1: restoring config space at offset 0x6 (was 0x1, writing 0xd881)
May  4 06:53:30 shahe26 kernel: [ 2249.797756] pci-stub 0000:02:00.1: restoring config space at offset 0x4 (was 0x4, writing 0xfbd40004)
May  4 06:53:30 shahe26 kernel: [ 2249.797761] pci-stub 0000:02:00.1: restoring config space at offset 0x3 (was 0x800010, writing 0x800040)
May  4 06:53:30 shahe26 kernel: [ 2249.797767] pci-stub 0000:02:00.1: restoring config space at offset 0x1 (was 0x100000, writing 0x100143)
May  4 06:53:31 shahe26 kernel: [ 2250.050962] assign device: host bdf = 2:0:1
May  4 06:53:37 shahe26 kernel: [ 2256.759165] pci-stub 0000:02:00.1: restoring config space at offset 0xf (was 0x200, writing 0x205)
May  4 06:53:37 shahe26 kernel: [ 2256.759173] pci-stub 0000:02:00.1: restoring config space at offset 0xc (was 0x0, writing 0xfbd20000)
May  4 06:53:37 shahe26 kernel: [ 2256.759183] pci-stub 0000:02:00.1: restoring config space at offset 0x8 (was 0x4, writing 0xfbd1c004)
May  4 06:53:37 shahe26 kernel: [ 2256.759188] pci-stub 0000:02:00.1: restoring config space at offset 0x6 (was 0x1, writing 0xd881)
May  4 06:53:37 shahe26 kernel: [ 2256.759192] pci-stub 0000:02:00.1: restoring config space at offset 0x4 (was 0x4, writing 0xfbd40004)
May  4 06:53:37 shahe26 kernel: [ 2256.759195] pci-stub 0000:02:00.1: restoring config space at offset 0x3 (was 0x800010, writing 0x800040)
May  4 06:53:37 shahe26 kernel: [ 2256.759200] pci-stub 0000:02:00.1: restoring config space at offset 0x1 (was 0x100000, writing 0x100147)
May  4 06:53:37 shahe26 kernel: [ 2256.759230] pci-stub 0000:02:00.1: PCI INT B disabled
May  4 06:53:38 shahe26 kernel: [ 2257.259706] ixgbe 0000:02:00.1: PCI INT B -> GSI 34 (level, low) -> IRQ 34
May  4 06:53:38 shahe26 kernel: [ 2257.259722] ixgbe 0000:02:00.1: setting latency timer to 64
May  4 06:53:38 shahe26 kernel: [ 2257.382635] ixgbe 0000:02:00.1: irq 105 for MSI/MSI-X
May  4 06:53:38 shahe26 kernel: [ 2257.382638] ixgbe 0000:02:00.1: irq 106 for MSI/MSI-X
May  4 06:53:38 shahe26 kernel: [ 2257.382689] ixgbe 0000:02:00.1: irq 128 for MSI/MSI-X
May  4 06:53:38 shahe26 kernel: [ 2257.382691] ixgbe 0000:02:00.1: irq 129 for MSI/MSI-X
May  4 06:53:38 shahe26 kernel: [ 2257.382694] ixgbe 0000:02:00.1: irq 130 for MSI/MSI-X
May  4 06:53:38 shahe26 kernel: [ 2257.382696] ixgbe 0000:02:00.1: irq 131 for MSI/MSI-X
May  4 06:53:38 shahe26 kernel: [ 2257.382698] ixgbe 0000:02:00.1: irq 132 for MSI/MSI-X
May  4 06:53:38 shahe26 kernel: [ 2257.382700] ixgbe 0000:02:00.1: irq 133 for MSI/MSI-X
May  4 06:53:38 shahe26 kernel: [ 2257.382703] ixgbe 0000:02:00.1: irq 134 for MSI/MSI-X
May  4 06:53:38 shahe26 kernel: [ 2257.382705] ixgbe 0000:02:00.1: irq 135 for MSI/MSI-X
May  4 06:53:38 shahe26 kernel: [ 2257.382707] ixgbe 0000:02:00.1: irq 136 for MSI/MSI-X
May  4 06:53:38 shahe26 kernel: [ 2257.382709] ixgbe 0000:02:00.1: irq 137 for MSI/MSI-X
May  4 06:53:38 shahe26 kernel: [ 2257.382744] ixgbe: 0000:02:00.1: ixgbe_init_interrupt_scheme: Multiqueue Enabled: Rx Queue count = 16, Tx Queue count = 16
May  4 06:53:38 shahe26 kernel: [ 2257.382749] ixgbe 0000:02:00.1: (PCI Express:5.0Gb/s:Width x8) 00:a0:d1:ec:dc:49
May  4 06:53:38 shahe26 kernel: [ 2257.382834] ixgbe 0000:02:00.1: MAC: 2, PHY: 7, SFP+: 3, PBA No: ffffff-0ff
May  4 06:53:38 shahe26 kernel: [ 2257.383724] ixgbe 0000:02:00.1: Intel(R) 10 Gigabit Network Connection

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

I don't know how to solve this problem ,can anyone help me ?

best regards,
qinguan



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>
                <!-->
                Direct attachment to physical interface.requires the Linux macvtap driver.
                <interface type='direct'>
                        <source dev='eth0' mode='vepa'>
                </interface>
                </!-->

        </devices>
</domain>