summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/qemu/qemu-helper
diff options
context:
space:
mode:
authorJoshua Watt <jpewhacker@gmail.com>2020-01-08 13:48:07 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-01-10 21:18:23 +0000
commit08220028e52992dcba667fc97bf3afe8be1949fb (patch)
tree50a373bfc238ba505d7f9f3c71091f8cc94a34d2 /meta/recipes-devtools/qemu/qemu-helper
parent1128c128ce64f5e7f5f0f0f83471d61d91d48cca (diff)
downloadpoky-08220028e52992dcba667fc97bf3afe8be1949fb.tar.gz
runqemu: Add network bridge support
Qemu supports attaching the virtual machine to an existing network bridge interface via the qemu-bridge-helper program (as long as the system is correctly configured to give the user permissions). Add support for runqemu to do this also via the "bridge=<INTERFACE>" argument. Note that for this to work correctly, the host qemu-bridge-helper must be used, not the one that might have been built by qemu-native. In order for qemu to correctly find this program, a qemu-oe-bridge-helper program has been added to qemu-helper-native, and runqemu will use this helper as the bridge helper. The helper will look for the host qemu-bridge-helper first by looking in the QEMU_BRIDGE_HELPER environment variable, then by search common paths where the helper is installed. (From OE-Core rev: 9e7b38c61c6b84b7f137c733ac5da9414025693d) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/qemu/qemu-helper')
-rwxr-xr-xmeta/recipes-devtools/qemu/qemu-helper/qemu-oe-bridge-helper25
1 files changed, 25 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu-helper/qemu-oe-bridge-helper b/meta/recipes-devtools/qemu/qemu-helper/qemu-oe-bridge-helper
new file mode 100755
index 0000000000..f057d4eef0
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu-helper/qemu-oe-bridge-helper
@@ -0,0 +1,25 @@
1#! /bin/sh
2# Copyright 2020 Garmin Ltd. or its subsidiaries
3#
4# SPDX-License-Identifier: GPL-2.0
5#
6# Attempts to find and exec the host qemu-bridge-helper program
7
8# If the QEMU_BRIDGE_HELPER variable is set by the user, exec it.
9if [ -n "$QEMU_BRIDGE_HELPER" ]; then
10 exec "$QEMU_BRIDGE_HELPER" "$@"
11fi
12
13# Search common paths for the helper program
14BN="qemu-bridge-helper"
15PATHS="/usr/libexec/ /usr/lib/qemu/"
16
17for p in $PATHS; do
18 if [ -e "$p/$BN" ]; then
19 exec "$p/$BN" "$@"
20 fi
21done
22
23echo "$BN not found!" > /dev/stderr
24exit 1
25