aboutsummaryrefslogtreecommitdiff
path: root/kvm-creator
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2009-11-11 13:17:29 -0500
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>2009-11-11 13:17:29 -0500
commit7704f63a57d21afd19d7c98830e5be172b454e9a (patch)
tree35abf0fc3bccee8d52e0f157ec0cd28633634106 /kvm-creator
parentb928aaa9ad3d0024399d2ff3fe2418d05b7bac82 (diff)
downloadkvm-manager-7704f63a57d21afd19d7c98830e5be172b454e9a.tar.gz
kvm-manager-7704f63a57d21afd19d7c98830e5be172b454e9a.tar.bz2
fix MAC address updates.
Diffstat (limited to 'kvm-creator')
-rwxr-xr-xkvm-creator5
1 files changed, 3 insertions, 2 deletions
diff --git a/kvm-creator b/kvm-creator
index 12ad8be..b27af0a 100755
--- a/kvm-creator
+++ b/kvm-creator
@@ -19,10 +19,11 @@ DISK="/dev/mapper/${VG}-${NAME}"
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 ))}"
- MAC="${6:-$(cat /etc/sv/kvm/*/env/MAC | head -n1 | cut -f 1-5 -d: ):$(( $( cat /etc/sv/kvm/*/env/MAC | cut -f 6 -d: | sort -n | tail -n 1 ) + 1 ))}"
+ 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 -n | tail -n 1 ) + 1 ))" )}"
else
TAP=tap0
- MAC=00:00:00:00:00:00
+ # use a locally-administered MAC address:
+ MAC=02:00:00:00:00:01
fi
usage() {