On 08/21/2012 11:22 AM, Rajesh Kumar Mallah wrote:
I see, if you attach a PCI device into guest with 'managed' mode(managed='yes') then the device is automatically detached from guest and returned to host after guest exiting, for example. # lspci | grep Eth 00:19.0 Ethernet controller: Intel Corporation 82566DM-2 Gigabit Network Connection (rev 02) # readlink /sys/bus/pci/devices/0000\:00\:19.0/driver/ -f /sys/bus/pci/drivers/e1000e # virsh start foo Domain foo started # ping -c 3 xx.xx.xx.xx PING xx.xx.xx.xx (xx.xx.xx.xx) 56(84) bytes of data. 64 bytes from nx-in-f160.1e100.net (xx.xx.xx.xx): icmp_seq=1 ttl=49 time=87.8 ms 64 bytes from nx-in-f160.1e100.net (xx.xx.xx.xx): icmp_seq=2 ttl=49 time=85.2 ms 64 bytes from nx-in-f160.1e100.net (xx.xx.xx.xx): icmp_seq=3 ttl=49 time=91.8 ms --- xx.xx.xx.xx ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2093ms rtt min/avg/max/mdev = 85.240/88.327/91.881/2.731 ms # cat hostdev.xml <hostdev mode='subsystem' type='pci' managed='yes'> <source> <address domain='0x0000' bus='0x00' slot='0x19' function='0x0'/> </source> </hostdev> # virsh attach-device foo hostdev.xml Device attached successfully # readlink /sys/bus/pci/devices/0000\:00\:19.0/driver/ -f /sys/bus/pci/drivers/pci-stub # ping -c 3 xx.xx.xx.xx connect: Network is unreachable # virsh destroy foo Domain foo destroyed # readlink /sys/bus/pci/devices/0000\:00\:19.0/driver/ -f /sys/bus/pci/drivers/e1000e # ping -c 3 xx.xx.xx.xx PING xx.xx.xx.xx (xx.xx.xx.xx) 56(84) bytes of data. 64 bytes from xx.xx.xx.xx: icmp_seq=1 ttl=49 time=79.7 ms 64 bytes from xx.xx.xx.xx: icmp_seq=2 ttl=49 time=83.2 ms 64 bytes from xx.xx.xx.xx: icmp_seq=3 ttl=49 time=84.5 ms --- xx.xx.xx.xx ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2087ms rtt min/avg/max/mdev = 79.714/82.480/84.513/2.040 ms Notes, need to wait for local network recovery again then check network connectivity. If your network still is disconnect, it may be a bug IMHO, please show your libvirt and qemu-kvm version, or my example is not what you want, please let me know. Thanks, Alex
|
_______________________________________________ libvirt-users mailing list libvirt-users@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvirt-users