Adapt to latest macvtap device names.
This commit is contained in:
parent
3573fa3697
commit
4d961c60e9
1 changed files with 4 additions and 2 deletions
|
@ -17,8 +17,10 @@ img=$(dialog --clear --backtitle "Virtual Machine Chooser" \
|
||||||
|
|
||||||
## If the menu is canceled, $0 stops here because of set -e
|
## If the menu is canceled, $0 stops here because of set -e
|
||||||
|
|
||||||
mac="$(ip link | grep -A1 "vm-macvtap" | \
|
# FIXME: Use first device found for now:
|
||||||
|
mac="$(ip link | grep -A1 -m1 "macvtap-" | \
|
||||||
sed -nE "s%\s+link/ether ([[:xdigit:]:]{17}) .+%\1%p")"
|
sed -nE "s%\s+link/ether ([[:xdigit:]:]{17}) .+%\1%p")"
|
||||||
|
tapdev="$(ip link | grep -A1 -m1 "macvtap-" | sed -nE "s%^[1-9]:\s(\S+)@.*%\1%p")"
|
||||||
|
|
||||||
if [[ $# -eq 0 ]] ; then
|
if [[ $# -eq 0 ]] ; then
|
||||||
mem=$(sed -En "s/^MemAvailable:\s+([0-9]+)\s+kB/\1/p" /proc/meminfo)
|
mem=$(sed -En "s/^MemAvailable:\s+([0-9]+)\s+kB/\1/p" /proc/meminfo)
|
||||||
|
@ -47,7 +49,7 @@ case "$img" in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
type="ethernet,mac=${mac},target.dev=vm-macvtap,xpath1.set=./target/@managed=no"
|
type="ethernet,mac=${mac},target.dev=${tapdev},xpath1.set=./target/@managed=no"
|
||||||
n=0
|
n=0
|
||||||
for vm in $(virsh --connect qemu:///session list --all --name) ; do
|
for vm in $(virsh --connect qemu:///session list --all --name) ; do
|
||||||
if virsh domiflist "$vm" | grep -q "$mac" ; then
|
if virsh domiflist "$vm" | grep -q "$mac" ; then
|
||||||
|
|
Loading…
Add table
Reference in a new issue