5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-03-09 08:58:25 +03:00

add pve-bridgedown script

This allow to delete fwbr bridge, link interfaces, cleanup ovs
when vm is shutdown

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
Alexandre Derumier 2014-05-07 10:42:43 +02:00 committed by Dietmar Maurer
parent 2dd4aa4c95
commit 011c581720
3 changed files with 18 additions and 1 deletions

View File

@ -81,6 +81,7 @@ install: ${PKGSOURCES}
install -D -m 0755 qmupdate ${DESTDIR}${VARLIBDIR}/qmupdate
install -D -m 0755 qemu.init.d ${DESTDIR}/etc/init.d/${PACKAGE}
install -m 0755 pve-bridge ${DESTDIR}${VARLIBDIR}/pve-bridge
install -m 0755 pve-bridgedown ${DESTDIR}${VARLIBDIR}/pve-bridgedown
install -s -m 0755 vmtar ${DESTDIR}${LIBDIR}
install -s -m 0755 sparsecp ${DESTDIR}${LIBDIR}
install -m 0755 qmextract ${DESTDIR}${LIBDIR}

View File

@ -1202,7 +1202,7 @@ sub print_netdev_full {
my $vmname = $conf->{name} || "vm$vmid";
if ($net->{bridge}) {
return "type=tap,id=$netid,ifname=${ifname},script=/var/lib/qemu-server/pve-bridge$vhostparam";
return "type=tap,id=$netid,ifname=${ifname},script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/qemu-server/pve-bridgedown$vhostparam";
} else {
return "type=user,id=$netid,hostname=$vmname";
}

16
pve-bridgedown Executable file
View File

@ -0,0 +1,16 @@
#!/usr/bin/perl
use strict;
use warnings;
use PVE::Network;
my $iface = shift;
die "no interface specified\n" if !$iface;
die "got strange interface name '$iface'\n"
if $iface !~ m/^tap(\d+)i(\d+)$/;
PVE::Network::tap_unplug($iface);
exit 0;