<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>3028</bug_id>
          
          <creation_ts>2012-08-28 21:33:52 +0000</creation_ts>
          <short_desc>runqemu aborts if it finds a preconfigured tap device</short_desc>
          <delta_ts>2012-09-29 03:08:41 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>Meta-yocto</product>
          <component>meta-yocto</component>
          <version>1.3</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.3 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tom Zanussi">tom.zanussi</reporter>
          <assigned_to name="Scott Garman">scott.a.garman</assigned_to>
          <cc>liang.li2</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>24563</commentid>
    <comment_count>0</comment_count>
    <who name="Tom Zanussi">tom.zanussi</who>
    <bug_when>2012-08-28 21:33:52 +0000</bug_when>
    <thetext>If there&apos;s an existing tap device on the system, runqemu takes a different path that essentially leaves the trailing colon on the tap device name e.g. tap0: instead of what it should be: tap0.  Stripping the colon off the name it finds should fix the problem, but the runqemu* scripts should be audited for similar kind of problems with this and other devices.

If there isn&apos;t a tap device found, the script uses the output of:

tap=`sudo $QEMUIFUP $USERID $GROUPID $OECORE_NATIVE_SYSROOT

which doesn&apos;t cause a problem, which is why the problem isn&apos;t normally seen (i.e. everybody must be using Ubuntu).

Details: my system has the following ifconfig output:

[trz@empanada build]$ ifconfig
em1: flags=4099&lt;UP,BROADCAST,MULTICAST&gt;  mtu 1500
        ether 08:2e:5f:74:a0:a0  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 48  base 0x6000  

lo: flags=73&lt;UP,LOOPBACK,RUNNING&gt;  mtu 16436
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10&lt;host&gt;
        loop  txqueuelen 0  (Local Loopback)
        RX packets 103  bytes 5852 (5.7 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 103  bytes 5852 (5.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

tap0: flags=4099&lt;UP,BROADCAST,MULTICAST&gt;  mtu 1500
        inet 192.168.7.1  netmask 255.255.255.255  broadcast 192.168.7.255
        inet6 fe80::707d:5fff:fe24:2343  prefixlen 64  scopeid 0x20&lt;link&gt;
        ether 72:7d:5f:24:23:43  txqueuelen 500  (Ethernet)
        RX packets 50  bytes 16387 (16.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 21  bytes 3461 (3.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

which produces the error below:

Continuing with the following parameters:
KERNEL: [/home/trz/yocto/systemtap-ext/build/tmp/deploy/images/bzImage-qemux86.bin]
ROOTFS: [/home/trz/yocto/systemtap-ext/build/tmp/deploy/images/core-image-sato-qemux86.ext3]
FSTYPE: [ext3]
Acquiring lockfile for tap0:...
Using preconfigured tap device &apos;tap0:&apos;
/home/trz/yocto/systemtap-ext/scripts/runqemu-internal: line 219: 0: * 2 + 1: syntax error in expression (error token is &quot;: * 2 + 1&quot;)
WARNING: distccd not present, no distcc support loaded.
Running qemu...
/home/trz/yocto/systemtap-ext/build/tmp/sysroots/x86_64-linux/usr/bin/qemu -kernel /home/trz/yocto/systemtap-ext/build/tmp/deploy/images/bzImage-qemux86.bin -net nic,vlan=0 -net tap,vlan=0,ifname=tap0:,script=no,downscript=no -hda /home/trz/yocto/systemtap-ext/build/tmp/deploy/images/core-image-sato-qemux86.ext3 -show-cursor -usb -usbdevice wacom-tablet -vga vmware -no-reboot -m 128 --append &quot;vga=0 root=/dev/hda rw mem=128M ip=192.168.7.1::192.168.7.:255.255.255.0 oprofile.timer=1 &quot;
qemu: -net tap,vlan=0,ifname=tap0:,script=no,downscript=no: could not configure /dev/net/tun (tap0:): Operation not permitted
qemu: -net tap,vlan=0,ifname=tap0:,script=no,downscript=no: Device &apos;tap&apos; could not be initialized
Set &apos;tap0:&apos; nonpersistent
Releasing lockfile of preconfigured tap device &apos;tap0:&apos;
[trz@empanada build]$ emacs -nw</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25713</commentid>
    <comment_count>1</comment_count>
    <who name="Scott Garman">scott.a.garman</who>
    <bug_when>2012-09-25 16:11:57 +0000</bug_when>
    <thetext>Fixed in oe-core and poky master as of:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=e46be72a8e5d064b4b46d5b0c37d67bbb2ccae55</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25954</commentid>
    <comment_count>2</comment_count>
    <who name="liang li">liang.li2</who>
    <bug_when>2012-09-29 03:08:41 +0000</bug_when>
    <thetext>verified on :
git info:718eb85806e080d0b165344b272e531ef19421eb
git branch: 1.3_M5
test env: 
host: ubuntu 12.04 x86_64

if tap0 already existed (first qemu target has been up),then run &quot;runqemu&quot; to boot up second qemu target, it can boot up normally. after that,run &quot;ifconfig&quot; on the host,output below:
$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:1a:a0:bb:2d:c5  
          inet addr:128.224.162.249  Bcast:128.224.163.255  Mask:255.255.254.0
          inet6 addr: fe80::21a:a0ff:febb:2dc5/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1624216 errors:0 dropped:150 overruns:0 frame:0
          TX packets:254343 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:260431134 (260.4 MB)  TX bytes:24668860 (24.6 MB)
          Interrupt:16 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:8824 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8824 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:853917 (853.9 KB)  TX bytes:853917 (853.9 KB)

tap0      Link encap:Ethernet  HWaddr a6:50:e7:bd:ef:83  
          inet addr:192.168.7.1  Bcast:192.168.7.255  Mask:255.255.255.255
          inet6 addr: fe80::a450:e7ff:febd:ef83/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:35901 errors:0 dropped:0 overruns:0 frame:0
          TX packets:47692 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:13795073 (13.7 MB)  TX bytes:38379876 (38.3 MB)

tap1      Link encap:Ethernet  HWaddr ee:de:0c:3b:9c:9c  
          inet addr:192.168.7.3  Bcast:192.168.7.255  Mask:255.255.255.255
          inet6 addr: fe80::ecde:cff:fe3b:9c9c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6 errors:0 dropped:0 overruns:0 frame:0
          TX packets:50 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:468 (468.0 B)  TX bytes:9842 (9.8 KB)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>