X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=pve-bridge-hotplug;h=f36ed4088ee7540eaafca5ec1e6ba4c4141db4ce;hb=ec82e3eee4cc96d6c841056f16acfa14871739c3;hp=2131db58721e1b6292ba2039327876baf59924a6;hpb=208ba94e9660157de980880770d91ab550d81590;p=qemu-server.git diff --git a/pve-bridge-hotplug b/pve-bridge-hotplug index 2131db5..f36ed40 100755 --- a/pve-bridge-hotplug +++ b/pve-bridge-hotplug @@ -1,39 +1,3 @@ -#!/usr/bin/perl +#!/bin/sh -use strict; -use warnings; -use PVE::QemuServer; -use PVE::Tools qw(run_command); -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+)$/; - -my $vmid = $1; -my $netid = "net$2"; - -my $conf = PVE::QemuServer::load_config($vmid); - -my $netconf = $conf->{$netid}; - -$netconf = $conf->{pending}->{$netid} if defined($conf->{pending}->{$netid}); - -die "unable to get network config '$netid'\n" - if !defined($netconf); - -my $net = PVE::QemuServer::parse_net($netconf); -die "unable to parse network config '$netid'\n" if !$net; - -PVE::Network::tap_create($iface, $net->{bridge}); - -# if ovs is under this bridge all traffic control settings will be flushed. -# so we need to call tap_rate_limit after tap_plug -PVE::Network::tap_plug($iface, $net->{bridge}, $net->{tag}, $net->{firewall}); - -PVE::Network::tap_rate_limit($iface, $net->{rate}) if $net->{rate}; - -exit 0; +exec /var/lib/qemu-server/pve-bridge --hotplug "$@"