qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Possible race condition when using TUN/TAP devices


From: Thomas Favre-Bulle
Subject: [Qemu-devel] Possible race condition when using TUN/TAP devices
Date: Wed, 16 Feb 2011 13:53:21 +0100

Hi,

I noticed the following error when trying to run multiple Qemu/KVM
instances:

------------
warning: could not open /dev/net/tun: no virtual network emulation
qemu-kvm: -netdev tap,id=hostnet0: Device 'tap' could not be initialized
------------

Tracing the error showed that returned errno is 16 (EBUSY) and happens
only when launching multiple instances in parallel.

In net/tap-linux.c line 40, qemu attempts to open /dev/net/tun (rw
mode). Then line 78, fcntl is called to set current file descriptor in
non blocking mode. IMHO, the problem is there, isn't it ?

Qemu/KVM version: 0.12.1.2 (also tested with 0.13.0)
System: RHEL6 GA (2.6.32-71)
Qemu command line: /usr/libexec/qemu-kvm -M rhel6.0.0 -enable-kvm -m
2048 -smp 8,sockets=8,cores=1,threads=1 -name vm5 -uuid
dbcc794b-cda6-44cb-b9f1-5a2024a4281d -rtc base=utc -boot order=cn
-chardev socket,id=monitor,port=15006,host=127.0.0.1,server,nowait -mon
chardev=monitor,mode=control -pidfile /var/run/vm5.pid -drive
file=/var/lib/libvirt/images/vm5.img,if=none,id=drive-ide0-0-0,boot=on
-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0
-netdev tap,ifname=tap5,id=hostnet0 -device
virtio-net-pci,netdev=hostnet0,mac=52:54:99:12:34:45,bus=pci.0,addr=0x04
-chardev pty,id=serial0 -device isa-serial,chardev=serial0 -usb -vnc
127.0.0.1:5 -vga cirrus -device virtio-balloon-pci,bus=pci.0,addr=0x03

more instances are run using a similar command line (only name, uuid,
mac address, etc. changes)
-- 
Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]