Hi ,<br> I look into the qemu log file ,find that :<br><br>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_5 -uuid 05f608a3-f64f-2418-a90a-d611982c8336 -nodefaults -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/vt_d_5.monitor,server,nowait -mon chardev=monitor,mode=readline -rtc base=utc -boot c -drive file=/home/qinguan/exp/kvm_vtd/ubuntu_1.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 <a href="http://127.0.0.1:0">127.0.0.1:0</a> -vga cirrus -device pci-assign,host=00:19.0,id=hostdev0,bus=pci.0,addr=0x4 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5<br>
Failed to assign irq for "hostdev0": Operation not permitted<br>Perhaps you are assigning a device that shares an IRQ with another device?<br>Failed to assign irq for "hostdev0": Operation not permitted<br>
Perhaps you are assigning a device that shares an IRQ with another device?<br>Failed to assign irq for "hostdev0": Operation not permitted<br>Perhaps you are assigning a device that shares an IRQ with another device?<br>
Failed to assign irq for "hostdev0": Operation not permitted<br>Perhaps you are assigning a device that shares an IRQ with another device?<br>Failed to assign irq for "hostdev0": Operation not permitted<br>
<br>maybe the VM can't access to the network because of Failed to assign irg for "hostdev0"?<br><br>in kern.log :<br>May 1 12:40:07 Optiplex-780 kernel: [ 3172.784803] e1000e 0000:00:19.0: PCI INT A disabled<br>
May 1 12:40:07 Optiplex-780 kernel: [ 3172.784863] pci-stub 0000:00:19.0: claimed by stub<br>May 1 12:40:07 Optiplex-780 kernel: [ 3173.103965] pci-stub 0000:00:19.0: PCI INT A -> GSI 21 (level, low) -> IRQ 21<br>
May 1 12:40:07 Optiplex-780 kernel: [ 3173.204030] pci-stub 0000:00:19.0: restoring config space at offset 0x6 (was 0x1, writing 0xece1)<br>May 1 12:40:07 Optiplex-780 kernel: [ 3173.204035] pci-stub 0000:00:19.0: restoring config space at offset 0x5 (was 0x0, writing 0xf7ad9000)<br>
May 1 12:40:07 Optiplex-780 kernel: [ 3173.204039] pci-stub 0000:00:19.0: restoring config space at offset 0x4 (was 0x0, writing 0xf7ae0000)<br>May 1 12:40:07 Optiplex-780 kernel: [ 3173.204045] pci-stub 0000:00:19.0: restoring config space at offset 0x1 (was 0x100000, writing 0x100103)<br>
May 1 12:40:07 Optiplex-780 kernel: [ 3173.435751] assign device 0:0:19.0<br>May 1 12:44:24 Optiplex-780 kernel: [ 3430.568526] pci-stub 0000:00:19.0: restoring config space at offset 0x6 (was 0x1, writing 0xece1)<br>May 1 12:44:24 Optiplex-780 kernel: [ 3430.568532] pci-stub 0000:00:19.0: restoring config space at offset 0x5 (was 0x0, writing 0xf7ad9000)<br>
May 1 12:44:24 Optiplex-780 kernel: [ 3430.568537] pci-stub 0000:00:19.0: restoring config space at offset 0x4 (was 0x0, writing 0xf7ae0000)<br>May 1 12:44:24 Optiplex-780 kernel: [ 3430.568543] pci-stub 0000:00:19.0: restoring config space at offset 0x1 (was 0x100000, writing 0x100103)<br>
May 1 12:44:24 Optiplex-780 kernel: [ 3430.568561] pci-stub 0000:00:19.0: PCI INT A disabled<br><br><br>root@Optiplex-780:/var/log/libvirt/qemu# cat /proc/interrupts<br> CPU0 CPU1 CPU2 CPU3 <br>
0: 97 1 2 1 IO-APIC-edge timer<br> 1: 2 0 0 0 IO-APIC-edge i8042<br> 7: 0 0 0 0 IO-APIC-edge parport0<br>
8: 1 0 0 0 IO-APIC-edge rtc0<br> 9: 0 0 0 0 IO-APIC-fasteoi acpi<br> 12: 1 2 1 0 IO-APIC-edge i8042<br>
16: 0 0 0 0 IO-APIC-fasteoi uhci_hcd:usb2<br> 17: 5822 1952 3614 2233 IO-APIC-fasteoi uhci_hcd:usb4, uhci_hcd:usb7<br> 18: 0 0 0 0 IO-APIC-fasteoi uhci_hcd:usb8<br>
22: 1 1 1 0 IO-APIC-fasteoi ehci_hcd:usb1, uhci_hcd:usb5<br> 23: 1461 1299 1153 912 IO-APIC-fasteoi ehci_hcd:usb3, uhci_hcd:usb6<br> 24: 268579 0 0 0 HPET_MSI-edge hpet2<br>
25: 0 286310 0 0 HPET_MSI-edge hpet3<br> 26: 0 0 210675 0 HPET_MSI-edge hpet4<br> 27: 0 0 0 256688 HPET_MSI-edge hpet5<br>
29: 1 0 0 0 DMAR_MSI-edge dmar1<br> 30: 0 0 0 0 DMAR_MSI-edge dmar0<br> 31: 0 0 0 0 DMAR_MSI-edge dmar2<br>
35: 0 0 0 1 PCI-MSI-edge eth1<br> 36: 1456 916 1323 1657 PCI-MSI-edge eth1-rx-0<br> 37: 1031 772 1459 895 PCI-MSI-edge eth1-rx-1<br>
38: 958 965 785 470 PCI-MSI-edge eth1-rx-2<br> 39: 1319 557 1007 714 PCI-MSI-edge eth1-rx-3<br> 40: 892 864 417 1134 PCI-MSI-edge eth1-tx-0<br>
41: 414 749 998 606 PCI-MSI-edge eth1-tx-1<br> 42: 307 921 375 332 PCI-MSI-edge eth1-tx-2<br> 43: 966 693 396 502 PCI-MSI-edge eth1-tx-3<br>
54: 7109 5755 5683 5609 PCI-MSI-edge ahci<br> 55: 74 105 73 84 PCI-MSI-edge hda_intel<br> 56: 1446 927 1108 870 PCI-MSI-edge i915<br>
NMI: 0 0 0 0 Non-maskable interrupts<br>LOC: 740 725 703 677 Local timer interrupts<br>SPU: 0 0 0 0 Spurious interrupts<br>
PMI: 0 0 0 0 Performance monitoring interrupts<br>PND: 0 0 0 0 Performance pending work<br>RES: 665 679 714 547 Rescheduling interrupts<br>
CAL: 5332 408 5619 539 Function call interrupts<br>TLB: 1880 2843 1788 3202 TLB shootdowns<br>TRM: 0 0 0 0 Thermal event interrupts<br>
THR: 0 0 0 0 Threshold APIC interrupts<br>MCE: 0 0 0 0 Machine check exceptions<br>MCP: 5 5 5 5 Machine check polls<br>
ERR: 3<br>MIS: 0<br>root@Optiplex-780:/var/log/libvirt/qemu# <br><br>I search the similarly problems that sharing the irg but never find a answer , and now I have no idea.<br>How to solve the problem ,can you help me ? thanks.<br>
<br>best regards,<br>qinguan<br><br><br><div class="gmail_quote">在 2011年5月4日 下午2:55,guan qin <span dir="ltr"><<a href="mailto:qinguan0619@gmail.com">qinguan0619@gmail.com</a>></span>写道:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
sorry for missing some information.<br>I checkd the device that :<br># readlink /sys/bus/pci/devices/0000\:00\:19.0/driver<br>../../../bus/pci/drivers/pci-stub<br><br>the device has been already claimed by pci-stub and under the control of pci_stub.<br>
so the reason that can't up the eth in VM maybe has nothing to do with the libvirt version.<br><br>After doing the first three steps:<a href="http://www.linux-kvm.org/page/How_to_assign_devices_with_VT-d_in_KVM" target="_blank">How_to_assign_devices_with_VT-d_in_KVM</a><br>
(<br><b>1. Modifying kernel config<br></b><b>2. build kernel<br></b><b>3. reboot and verify that your system has IOMMU support</b><br>),<br>I use "virsh create vt_d.xml" instead of the ubind/bind and assign device.<br>
(the kvm and kvm_intel has already been loaded)<br>should I do something others to use the VT_d?<br><br>best regards,<br>qinguan<br><br><br><div class="gmail_quote">在 2011年5月4日 下午2:31,guan qin <span dir="ltr"><<a href="mailto:qinguan0619@gmail.com" target="_blank">qinguan0619@gmail.com</a>></span>写道:<div>
<div></div><div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,the libvirt version is 0.8.3, I just used "apt-get install libvirt-bin" to install it under debian6.0.1a.<br>
Is it necessary to install 0.8.4 or higher version ?<br><br>Best regards,<br>qinguan<br><br><br><div class="gmail_quote"><div>
在 2011年5月3日 下午4:28,Osier Yang <span dir="ltr"><<a href="mailto:jyang@redhat.com" target="_blank">jyang@redhat.com</a>></span>写道:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
于 2011年05月03日 15:38, guan qin 写道:<div><div></div><div><br>
<div>> Thanks a lot for your reply sincerely!<br>
> Actually ,if I do as what<br>
> <a href="http://www.linux-kvm.org/page/How_to_assign_devices_with_VT-d_in_KVM" target="_blank">http://www.linux-kvm.org/page/How_to_assign_devices_with_VT-d_in_KVM</a> said,:<br>
> "<br>
> # echo "8086 10b9" > /sys/bus/pci/drivers/pci-stub/new_id<br>
> # echo 0000:01:00.0 > /sys/bus/pci/devices/0000:01:00.0/driver/unbind<br>
> # echo 0000:01:00.0 > /sys/bus/pci/drivers/pci-stub/bind<br>
> "<br>
> Then I can assign a NIC to the VM ,and the VM also can use the NIC to<br>
> access the network.<br>
> But , according the libvirt guide that<br>
> <a href="http://libvirt.org/formatdomain.html#elementsUSB" target="_blank">http://libvirt.org/formatdomain.html#elementsUSB</a> shows:<br>
> "<br>
> When |managed| is "yes" for a PCI device, it is detached from the host<br>
> before being passed on to the guest.<br>
> "<br>
> So should I still "unbind " the device from the host OS driver first ?<br>
> If that ,What's the "detached" meaning ? thanks.<br>
> best regards,<br>
> qinguan<br>
<br>
</div>libvirt trys to detach the PCI device from host as preparation when<br>
starting up the domain, and it also binds the device to pci_stub<br>
driver, so it's strange that you need to do it manually? what's<br>
your libvirt version?<br>
<div><br>
> 在 2011年5月3日 上午8:47,David White <<a href="mailto:dwhite@speakeasy.net" target="_blank">dwhite@speakeasy.net</a><br>
</div>> <mailto:<a href="mailto:dwhite@speakeasy.net" target="_blank">dwhite@speakeasy.net</a>>>写道:<br>
<div><div></div><div>><br>
><br>
> did you 'unbind' the device from the host OS driver?<br>
><br>
><br>
> On 05/01/2011 01:38 AM, guan qin wrote:<br>
>> Hi,<br>
>><br>
>> I encounter a problem that the eth can't be up in the VM by using<br>
>> VT-d.<br>
>> I boot the VM using "virsh create vt_d.xml".<br>
>> The VM could recongize the NIC which was assigned .then I do in VM<br>
>> as follows:<br>
>> #cat /sys/class/net/eth0/operstate<br>
>> down<br>
>> #ifconfig eth0 up<br>
>> #cat /sys/class/net/eth0/operstate<br>
>> down<br>
>> #ficonfig eth 10.100.0.5<br>
>> #cat /sys/class/net/eth0/operstate<br>
>> down<br>
>> more system information is attached.(uname 、ifconfig 、lspci、<br>
>> cmdline...)<br>
>><br>
>> I can't figure out the reason why the eth is still down? can<br>
>> anyone help me ?<br>
>><br>
>> best regards,<br>
>> qinguan<br>
>><br>
>><br>
>><br>
>> vt_d.xml:<br>
>> <domain type='kvm'><br>
>> <name>test</name><br>
>> <description>just test using sriov!</description><br>
>> <os><br>
>> <type>hvm</type><br>
>> <boot dev='hd'/><br>
>> </os><br>
>> <memory>524288</memory><br>
>> <currentMemory>524288</currentMemory><br>
>> <on_poweroff>destroy</on_poweroff><br>
>> <on_reboot>restart</on_reboot><br>
>> <on_crash>restart</on_crash><br>
>><br>
>> <features><pae/><acpi/><apic/></features><br>
>> <clock offset='utc'/><br>
>> <devices><br>
>> <input type='mouse' bus='usb'/><br>
>> <disk type='file' device='disk'><br>
>> <source file='/home/qinguan/exp/ubuntu_1.img'/><br>
>> <target dev='hda' bus='virtio'/><br>
>> </disk><br>
>> <emulator>/usr/bin/kvm</emulator><br>
>> <graphics type='vnc' port='-1'/><br>
>> <hostdev mode='subsystem' type='pci' managed='yes'><br>
>> <source><br>
>> <address bus='0x0' slot='0x19' function='0x0'/><br>
>> </source><br>
>> </hostdev><br>
>> </devices><br>
>> </domain><br>
>><br>
>><br>
>> _______________________________________________<br>
>> libvirt-users mailing list<br>
</div></div>>> <a href="mailto:libvirt-users@redhat.com" target="_blank">libvirt-users@redhat.com</a> <mailto:<a href="mailto:libvirt-users@redhat.com" target="_blank">libvirt-users@redhat.com</a>><br>
<div><div></div><div>>> <a href="https://www.redhat.com/mailman/listinfo/libvirt-users" target="_blank">https://www.redhat.com/mailman/listinfo/libvirt-users</a><br>
><br>
><br>
><br>
><br>
> _______________________________________________<br>
> libvirt-users mailing list<br>
> <a href="mailto:libvirt-users@redhat.com" target="_blank">libvirt-users@redhat.com</a><br>
> <a href="https://www.redhat.com/mailman/listinfo/libvirt-users" target="_blank">https://www.redhat.com/mailman/listinfo/libvirt-users</a><br>
<br>
</div></div></div></div></blockquote></div><br>
</blockquote></div></div></div><br>
</blockquote></div><br>