]>
git.proxmox.com Git - qemu-server.git/blob - pve-bridge
6 use PVE
::Tools
qw(run_command);
12 if ($iface eq '--hotplug') {
17 die "no interface specified\n" if !$iface;
19 die "got strange interface name '$iface'\n"
20 if $iface !~ m/^tap(\d+)i(\d+)$/;
25 my $migratedfrom = $hotplug ?
undef : $ENV{PVE_MIGRATED_FROM
};
27 my $conf = PVE
::QemuServer
::load_config
($vmid, $migratedfrom);
29 my $netconf = $conf->{$netid};
31 $netconf = $conf->{pending
}->{$netid} if !$migratedfrom && defined($conf->{pending
}->{$netid});
33 die "unable to get network config '$netid'\n"
34 if !defined($netconf);
36 my $net = PVE
::QemuServer
::parse_net
($netconf);
37 die "unable to parse network config '$netid'\n" if !$net;
39 PVE
::Network
::tap_create
($iface, $net->{bridge
});
41 # if ovs is under this bridge all traffic control settings will be flushed.
42 # so we need to call tap_rate_limit after tap_plug
43 PVE
::Network
::tap_plug
($iface, $net->{bridge
}, $net->{tag
}, $net->{firewall
}, $net->{trunks
});
45 PVE
::Network
::tap_rate_limit
($iface, $net->{rate
}) if $net->{rate
};