Bug 5815 - qemu can't connect to TAP device if another VM already is using TAP0
Summary: qemu can't connect to TAP device if another VM already is using TAP0
Status: RESOLVED FIXED
Alias: None
Product: General Runtime
Classification: Runtime
Component: General Runtime (show other bugs)
Version: 1.6
Hardware: x86 x86_64
: Medium normal
Target Milestone: 1.6
Assignee: Scott Garman
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2014-02-12 23:19 UTC by Casey Schaufler
Modified: 2014-02-19 00:10 UTC (History)
0 users

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Casey Schaufler 2014-02-12 23:19:14 UTC
build$ runqemu qemux86

Continuing with the following parameters:
KERNEL: [/home/cschaufler/Yocto/poky-dora-10.0.1/build/tmp/deploy/images/qemux86/bzImage-qemux86.bin]
ROOTFS: [/home/cschaufler/Yocto/poky-dora-10.0.1/build/tmp/deploy/images/qemux86/core-image-sato-qemux86.ext3]
FSTYPE: [ext3]
Acquiring lockfile for tap0...
Using preconfigured tap device 'tap0'
If this is not intended, use flock on /tmp/qemu-tap-locks/tap0.lock to make runqemu skip tap0.
Running qemu-system-i386...
/home/cschaufler/Yocto/poky-dora-10.0.1/build/tmp/sysroots/x86_64-linux/usr/bin/qemu-system-i386 -kernel /home/cschaufler/Yocto/poky-dora-10.0.1/build/tmp/deploy/images/qemux86/bzImage-qemux86.bin -net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=no,downscript=no -hda /home/cschaufler/Yocto/poky-dora-10.0.1/build/tmp/deploy/images/qemux86/core-image-sato-qemux86.ext3 -show-cursor -usb -usbdevice wacom-tablet -vga vmware -no-reboot -m 256 --append "vga=0 uvesafb.mode_option=640x480-32 root=/dev/hda rw mem=256M ip=192.168.7.2::192.168.7.1:255.255.255.0 oprofile.timer=1 "
qemu-system-i386: -net tap,vlan=0,ifname=tap0,script=no,downscript=no: could not configure /dev/net/tun (tap0): Device or resource busy
qemu-system-i386: -net tap,vlan=0,ifname=tap0,script=no,downscript=no: Device 'tap' could not be initialized
Releasing lockfile of preconfigured tap device 'tap0'

build$ flock /tmp/qemu-tap-locks/tap0.lock
flock: bad number: /tmp/qemu-tap-locks/tap0.lock
Comment 1 Scott Garman 2014-02-15 19:10:17 UTC
I have submitted a workaround for this to the oe-core ML.

Since there is no way in software we can determine if an existing tap device is in use, the workaround allows a user to simply touch a filename in the runqemu tap lock directory, and it will skip using that tap device.