]>
git.proxmox.com Git - qemu-server.git/blob - pve-bridge-hotplug
6 use PVE
::Tools
qw(run_command);
11 die "no interface specified\n" if !$iface;
13 die "got strange interface name '$iface'\n"
14 if $iface !~ m/^tap(\d+)i(\d+)$/;
19 my $conf = PVE
::QemuServer
::load_config
($vmid);
21 my $netconf = $conf->{$netid};
23 $netconf = $conf->{pending
}->{$netid} if defined($conf->{pending
}->{$netid});
25 die "unable to get network config '$netid'\n"
26 if !defined($netconf);
28 my $net = PVE
::QemuServer
::parse_net
($netconf);
29 die "unable to parse network config '$netid'\n" if !$net;
31 PVE
::Network
::tap_create
($iface, $net->{bridge
});
33 # if ovs is under this bridge all traffic control settings will be flushed.
34 # so we need to call tap_rate_limit after tap_plug
35 PVE
::Network
::tap_plug
($iface, $net->{bridge
}, $net->{tag
}, $net->{firewall
});
37 PVE
::Network
::tap_rate_limit
($iface, $net->{rate
}) if $net->{rate
};