Commit 7eec7e37 authored by Ryan Jackson's avatar Ryan Jackson
Browse files

Fixes to libvnode_openvz for Fedora 15

Set the hostname for the vnode using vzctl to make sure it gets set
correctly.  Otherwise the vnode will inherit the physical host's
hostname, and since this is not "localhost" or "localhost.localdomain"
the networking scripts inside the container will not set reset it to
the value in /etc/sysconfig/network.

Use the "inside" MAC address rather than the "outside" one when
creating macvlan devices.

Only try to delete interfaces if they still exist when tearing down
the vnode.  The kernel itself automatically deletes "virtual"
interfaces, which includes imq and macvlan.
parent c4dfbae0
......@@ -1054,9 +1054,11 @@ sub vz_vnodeTearDown {
# Delete the ip links
if (exists($private->{'iplinks'})) {
foreach my $iface (keys(%{ $private->{'iplinks'} })) {
if (-e "/sys/class/net/$iface") {
mysystem2("$IP link del dev $iface");
goto badbad
if ($?);
......@@ -1504,6 +1506,7 @@ sub vz_vnodePreConfigControlNetwork {
print FD "DOMAIN=$longdomain\n";
print FD "NOZEROCONF=yes\n";
mysystem("$VZCTL $VZDEBUGOPTS set $vnode_id --hostname $vname.$longdomain --save");
# dhclient-exit-hooks normally writes this stuff on linux, so we'd better
......@@ -1628,6 +1631,7 @@ sub vz_vnodePreConfigExpNetwork {
($ethmac,$vethmac) = (macAddSep($ethmac),macAddSep($vethmac));
print "DEBUG ethmac=$ethmac, vethmac=$vethmac\n";
......@@ -1637,7 +1641,7 @@ sub vz_vnodePreConfigExpNetwork {
my $vname = "mv$vmid.$ifc->{ID}";
if (! -d "/sys/class/net/$vname") {
mysystem("$IP link add link $physdev name $vname ".
" address $vethmac type macvlan mode bridge ");
" address $ethmac type macvlan mode bridge ");
$private->{'iplinks'}->{$vname} = $physdev;
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