Patchwork [1/1] runqemu: work with tap device names that end with a colon

login
register
mail settings
Submitter Scott Garman
Date Sept. 21, 2012, 10:06 p.m.
Message ID <788ce6395c57aae824d913c5c9073801a9732c69.1348265025.git.scott.a.garman@intel.com>
Download mbox | patch
Permalink /patch/37027/
State Accepted
Commit 85ed217b603a86113dda11d952850e8ceed30795
Headers show

Comments

Scott Garman - Sept. 21, 2012, 10:06 p.m.
On Fedora systems (and likely others), ifconfig returns interface
names that end with a colon. Make sure we strip the colon off the
tap device name before using it.

This fixes [YOCTO #3028]

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
---
 scripts/runqemu-gen-tapdevs |    2 +-
 scripts/runqemu-internal    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Richard Purdie - Sept. 24, 2012, 10:25 a.m.
On Fri, 2012-09-21 at 15:06 -0700, Scott Garman wrote:
> On Fedora systems (and likely others), ifconfig returns interface
> names that end with a colon. Make sure we strip the colon off the
> tap device name before using it.
> 
> This fixes [YOCTO #3028]
> 
> Signed-off-by: Scott Garman <scott.a.garman@intel.com>
> ---
>  scripts/runqemu-gen-tapdevs |    2 +-
>  scripts/runqemu-internal    |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

Merged to master, thanks.

Richard

Patch

diff --git a/scripts/runqemu-gen-tapdevs b/scripts/runqemu-gen-tapdevs
index 2c1ff0e..f5be30a 100755
--- a/scripts/runqemu-gen-tapdevs
+++ b/scripts/runqemu-gen-tapdevs
@@ -70,7 +70,7 @@  if [ ! -x "$IFCONFIG" ]; then
 fi
 
 # Ensure we start with a clean slate
-for tap in `$IFCONFIG | grep ^tap | awk '{ print \$1 }'`; do
+for tap in `$IFCONFIG | grep ^tap | awk '{ print \$1 }' | sed s/://`; do
 	echo "Note: Destroying pre-existing tap interface $tap..."
 	$TUNCTL -d $tap
 done
diff --git a/scripts/runqemu-internal b/scripts/runqemu-internal
index 6e20dd7..6b8bb65 100755
--- a/scripts/runqemu-internal
+++ b/scripts/runqemu-internal
@@ -154,7 +154,7 @@  if [ ! -x "$IFCONFIG" ]; then
        exit 1
 fi
 
-POSSIBLE=`$IFCONFIG -a | grep '^tap' | awk '{print $1}'`
+POSSIBLE=`$IFCONFIG -a | grep '^tap' | awk '{print $1}' | sed s/://`
 TAP=""
 LOCKFILE=""
 for tap in $POSSIBLE; do