aboutsummaryrefslogtreecommitdiff
path: root/kvm-creator
diff options
context:
space:
mode:
authorGreg Lyle <greg@stealthisemail.com>2011-06-06 11:39:03 -0400
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>2011-06-06 13:23:52 -0400
commit997036d2f376b91098cf4bd68756836140e1d12c (patch)
treea94982b797645da01383ed3a165db29316fc31cb /kvm-creator
parent8bbe7adc00da05dd2b5a8a2df143ac6232ab5b4e (diff)
downloadkvm-manager-997036d2f376b91098cf4bd68756836140e1d12c.tar.gz
kvm-manager-997036d2f376b91098cf4bd68756836140e1d12c.tar.bz2
Use the name of a newly created guest as the base of the name of the tap interface created for that guest.
Diffstat (limited to 'kvm-creator')
-rwxr-xr-xkvm-creator2
1 files changed, 1 insertions, 1 deletions
diff --git a/kvm-creator b/kvm-creator
index 2428000..541d32c 100755
--- a/kvm-creator
+++ b/kvm-creator
@@ -25,7 +25,7 @@ UDEV_RULES_FILE="/etc/udev/rules.d/92-kvm_creator-%s.rules"
ls /etc/sv/kvm/* &> /dev/null
if [ "$?" -eq 0 ]; then
- TAP="${5:-tap$(( $( cat /etc/sv/kvm/*/env/TAP | sed 's/^tap//' | sort -n | tail -n 1 ) + 1 ))}"
+ TAP="${5:-${1}0}"
MAC="${6:-$(printf "%s:%02x" "$(cat /etc/sv/kvm/*/env/MAC | sort | head -n1 | cut -f 1-5 -d: )" "$(( 0x$( cat /etc/sv/kvm/*/env/MAC | cut -f 6 -d: | sort | tail -n 1 ) + 1 ))" )}"
else
TAP=tap0