[1/1] runqemu: add ability to skip using an existing tap device

Submitted by Scott Garman on Feb. 15, 2014, 7:04 p.m. | Patch ID: 66803


Message ID bb53744a8568261f4cb548df08e7332aa8389edd.1392490959.git.scott.a.garman@intel.com
State Accepted
Commit 2e490f3b08176b20fe41c64cf17ecf3b5af61f39
Headers show

Commit Message

Scott Garman Feb. 15, 2014, 7:04 p.m.
Support the sitauation where a user could have another VM running
which uses tap devices. To prevent runqemu from trying to use the
same tap device, runqemu will skip using a tap device if it finds
a filename tapX.skip within its lock directory.

This fixes [YOCTO #5815]

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
 scripts/runqemu-internal | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/scripts/runqemu-internal b/scripts/runqemu-internal
index f9ca380..d317dfd 100755
--- a/scripts/runqemu-internal
+++ b/scripts/runqemu-internal
@@ -178,6 +178,10 @@  else
         for tap in $POSSIBLE; do
+            if [ -e "$LOCKFILE.skip" ]; then
+                echo "Found $LOCKFILE.skip, skipping $tap"
+                continue
+            fi
             echo "Acquiring lockfile for $tap..."
             acquire_lock $LOCKFILE
             if [ $? -eq 0 ]; then
@@ -214,7 +218,7 @@  else
             echo "Using preconfigured tap device '$TAP'"
-            echo "If this is not intended, use flock on $LOCKFILE.lock to make runqemu skip $TAP."
+            echo "If this is not intended, touch $LOCKFILE.skip to make runqemu skip $TAP."
         cleanup() {