]> gitweb.fluxo.info Git - kvm-manager.git/commitdiff
Use the name of a newly created guest as the base of the name of the tap interface...
authorGreg Lyle <greg@stealthisemail.com>
Mon, 6 Jun 2011 15:39:03 +0000 (11:39 -0400)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Mon, 6 Jun 2011 17:23:52 +0000 (13:23 -0400)
kvm-creator

index 2428000704fa9d19956f17af50801f83fbf3a483..541d32c6243aa4c805a2123f653e21c30b4b4beb 100755 (executable)
@@ -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