Bug 8263

Summary: runqemu script gets confused if tap0 is already taken
Product: [Yocto Project Subprojects] ADT Reporter: Gianluigi Tiesi <sherpya>
Component: adtAssignee: Joshua Lock <joshuagloe>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: joshuagloe, poky.adt.watcher, poky.watcher, richard.purdie, sherpya
Version: 1.8   
Target Milestone: 1.8.2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know
Attachments:
Description Flags
proposed fix none

Description Gianluigi Tiesi 2015-09-07 04:14:27 UTC
Created attachment 2710 [details]
proposed fix

runqemu script fails in a strange way if tap0 is already taken.
It starts but no root is specified so the kernel panics. It's a bit misleading since has nothing to do with root fs.

Acquiring lockfile for tap0@NONE...                                                                                                                                                           
Using preconfigured tap device 'tap0@NONE'                                                                                                                                                    
If this is not intended, touch /tmp/qemu-tap-locks/tap0@NONE.skip to make runqemu skip tap0@NONE.                                                                                             
/home/sherpya/poky/scripts/runqemu-internal: line 256: 0@NONE: value too great for base (error token is "0@NONE")    

by touching the file, the scripts creates tap1 instead and it works

as I see the script uses ip link to get tap devices on my kernel 4.1.6
it shows them as:
5: tap0@NONE: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 100
    link/ether 72:15:34:8b:75:a9 brd ff:ff:ff:ff:ff:ff
7: tap1@NONE: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 500
    link/ether 32:f1:bb:36:25:c6 brd ff:ff:ff:ff:ff:ff

attached patch fixes the problem using a regexp instead, it's made against fido, but since it's one liner it should not be difficult to apply to master

a side note, you don't need to pipe grep, awk already does it
Comment 1 Richard Purdie 2015-09-07 17:04:06 UTC
Was this fixed in master with http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=0968e3a68b0b06caeb827938ddf556f21bfce646 ?
Comment 2 Gianluigi Tiesi 2015-09-08 04:41:42 UTC
yes, anyway it does not prevent future name changes :D
please cherry-pick the fix on fido
Comment 3 Joshua Lock 2015-09-10 10:47:57 UTC
I've queued this cherry-pick in my joshuagl/fido-next branch

http://cgit.openembedded.org/openembedded-core-contrib/log/?h=joshuagl/fido-next
Comment 5 Joshua Lock 2015-11-11 09:40:21 UTC
Fixed in 1.8.1