]>
git.proxmox.com Git - qemu-server.git/blob - vm-network-scripts/pve-bridge
7 use PVE
::Tools
qw(run_command);
12 require PVE
::Network
::SDN
::Zones
;
19 if ($iface eq '--hotplug') {
24 die "no interface specified\n" if !$iface;
26 die "got strange interface name '$iface'\n"
27 if $iface !~ m/^tap(\d+)i(\d+)$/;
32 my $migratedfrom = $hotplug ?
undef : $ENV{PVE_MIGRATED_FROM
};
34 my $conf = PVE
::QemuConfig-
>load_config($vmid, $migratedfrom);
36 my $netconf = $conf->{$netid};
38 $netconf = $conf->{pending
}->{$netid} if !$migratedfrom && defined($conf->{pending
}->{$netid});
40 die "unable to get network config '$netid'\n"
41 if !defined($netconf);
43 my $net = PVE
::QemuServer
::parse_net
($netconf);
44 die "unable to parse network config '$netid'\n" if !$net;
47 PVE
::Network
::SDN
::Zones
::tap_create
($iface, $net->{bridge
});
48 PVE
::Network
::SDN
::Zones
::tap_plug
($iface, $net->{bridge
}, $net->{tag
}, $net->{firewall
}, $net->{trunks
}, $net->{rate
});
50 PVE
::Network
::tap_create
($iface, $net->{bridge
});
51 PVE
::Network
::tap_plug
($iface, $net->{bridge
}, $net->{tag
}, $net->{firewall
}, $net->{trunks
}, $net->{rate
});