Bug 8263 - runqemu script gets confused if tap0 is already taken
Summary: runqemu script gets confused if tap0 is already taken
Status: CLOSED FIXED
Alias: None
Product: ADT
Classification: Yocto Project Subprojects
Component: adt (show other bugs)
Version: 1.8
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.8.2
Assignee: Joshua Lock
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-09-07 04:14 UTC by Gianluigi Tiesi
Modified: 2015-11-11 09:40 UTC (History)
5 users (show)

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


Attachments
proposed fix (470 bytes, patch)
2015-09-07 04:14 UTC, Gianluigi Tiesi
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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