Commit c6d960ce authored by Leigh B Stoller's avatar Leigh B Stoller

Add "loopback" vlan devices. This is used when a link is turned into a

trivial link betweem two VMs on the same phys host. There is no vlan,
but we can fake things enough so that everything looks as it should by
creating a bridge device with no vlan devices in it.
parent 3f7d874b
......@@ -327,7 +327,18 @@ sub vz_rootPreConfigNetwork {
foreach my $ifc (@{$node_ifs->{$node}}) {
next if (!$ifc->{ISVIRT});
if ($ifc->{ITYPE} eq "vlan") {
if ($ifc->{ITYPE} eq "loop") {
my $vtag = $ifc->{VTAG};
#
# No physical device. Its a loopback (trivial) link/lan
# All we need is a common bridge to put the veth ifaces into.
#
my $brname = "br$vtag";
$brs{$brname}{ENCAP} = 0;
$brs{$brname}{SHORT} = 0;
}
elsif ($ifc->{ITYPE} eq "vlan") {
my $iface = $ifc->{IFACE};
my $vtag = $ifc->{VTAG};
my $vdev = "vlan${vtag}";
......@@ -1130,6 +1141,7 @@ sub vz_vnodePreConfigControlNetwork {
#
open(FD,">$privroot/etc/resolv.conf")
or die "vz_vnodePreConfigControlNetwork: could not open resolv.conf for $vnode_id: $!";
print FD "nameserver $bossip\n";
print FD "search $shortdomain\n";
close(FD);
......@@ -1178,7 +1190,7 @@ sub vz_vnodePreConfigExpNetwork {
my $vdev = "vlan${vtag}";
$br = "pbr$vdev";
}
elsif ($ifc->{PMAC} eq "none") {
elsif ($ifc->{PMAC} eq "none" || $ifc->{ITYPE} eq "loop") {
$br = "br" . $ifc->{VTAG};
}
else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment