Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
8db75899
Commit
8db75899
authored
Feb 27, 2014
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Brutal hack for Nick, to pass a nomac_learning directive through
to the XEN backend. Not worth describing, its terrible.
parent
272550cb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
81 additions
and
14 deletions
+81
-14
clientside/tmcc/common/libsetup.pm
clientside/tmcc/common/libsetup.pm
+62
-5
clientside/tmcc/common/mkvnode.pl
clientside/tmcc/common/mkvnode.pl
+6
-0
clientside/tmcc/linux/xen/libvnode_xen.pm
clientside/tmcc/linux/xen/libvnode_xen.pm
+3
-3
protogeni/lib/GeniCM.pm.in
protogeni/lib/GeniCM.pm.in
+10
-6
No files found.
clientside/tmcc/common/libsetup.pm
View file @
8db75899
#!/usr/bin/perl -w
#
# Copyright (c) 2000-201
3
University of Utah and the Flux Group.
# Copyright (c) 2000-201
4
University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
...
...
@@ -42,7 +42,7 @@ use Exporter;
getlinkdelayconfig
getloadinfo
getbootwhat
getnodeattributes
copyfilefromnfs
getnodeuuid
getarpinfo
getstorageconfig
getmanifest
fetchmanifestblobs
runbootscript
runhooks
build_fake_macs
build_fake_macs
getenvvars
TBDebugTimeStamp
TBDebugTimeStampWithDate
TBDebugTimeStampsOn
TBDebugTimeStampsOff
...
...
@@ -1800,13 +1800,38 @@ sub calcroutes ($)
# Gather up all the link info from the topomap
my
%lans
=
();
my
$nnodes
=
0
;
my
%noroute
=
();
#
# Prepass the lans section to see which lans are not routed.
#
foreach
my
$lanref
(
@
{
$topomap
->
{"
lans
"}
})
{
#
# look for no-route flag. They are in the topomap cause of
# hostnames generation, but we do not want to run them through
# the route calculator. Shared vlans are the only current
# usage case.
#
if
(
exists
(
$lanref
->
{"
noroute
"})
&&
$lanref
->
{"
noroute
"})
{
$noroute
{
$lanref
->
{"
vname
"}}
=
1
;
}
}
# The nodes section tells us the name of each node, and all its links.
foreach
my
$noderef
(
@
{
$topomap
->
{"
nodes
"}
})
{
my
$vname
=
$noderef
->
{"
vname
"};
my
$links
=
$noderef
->
{"
links
"};
my
@links
=
();
# Cull out non routable networks.
if
(
defined
(
$noderef
->
{"
links
"}))
{
foreach
my
$link
(
split
("
",
$noderef
->
{"
links
"}))
{
my
(
$lan
,
$ip
)
=
split
("
:
",
$link
);
push
(
@links
,
$link
)
if
(
!
exists
(
$noroute
{
$lan
}));
}
}
if
(
!
defined
(
$
links
)
)
{
if
(
!
@
links
)
{
# If we have no links, there are no routes to compute.
if
(
$vname
eq
$myname
)
{
@$rptr
=
();
...
...
@@ -1816,7 +1841,7 @@ sub calcroutes ($)
}
# Links is a string of "$lan1:$ip1 $lan2:$ip2 ..."
foreach
my
$link
(
split
("
",
$
links
)
)
{
foreach
my
$link
(
@
links
)
{
my
(
$lan
,
$ip
)
=
split
("
:
",
$link
);
if
(
!
defined
(
$lans
{
$lan
}))
{
...
...
@@ -3237,6 +3262,38 @@ sub getnodeattributes($)
return
0
;
}
#
# Return the environment variables in a key/value array.
#
sub
getenvvars
($)
{
my
(
$rptr
)
=
@_
;
my
@tmccresults
=
();
my
%result
=
();
my
$issharedhost
=
SHAREDHOST
();
my
%tmccopts
=
();
if
(
$issharedhost
)
{
$tmccopts
{"
nocache
"}
=
1
;
}
if
(
tmcc
(
TMCCCMD_USERENV
,
undef
,
\
@tmccresults
,
%tmccopts
)
<
0
)
{
warn
("
*** WARNING: Could not get environment vars from server!
\n
");
%$rptr
=
();
return
-
1
;
}
foreach
my
$line
(
@tmccresults
)
{
if
(
$line
=~
/^(.*)="(.*)"$/
||
$line
=~
/^(.*)=(.+)$/
)
{
$result
{
$
1
}
=
$
2
;
}
}
%$rptr
=
%result
;
return
0
;
}
#
# Return the hostname or IP to use for a local event server.
# Defaults to "localhost" for most nodes or the physical host IP for Xen VMs.
...
...
clientside/tmcc/common/mkvnode.pl
View file @
8db75899
...
...
@@ -299,6 +299,7 @@ my %vnconfig = ( "vnodeid" => $vnodeid,
"
ldconfig
"
=>
undef
,
"
tunconfig
"
=>
undef
,
"
attributes
"
=>
undef
,
"
environment
"
=>
undef
,
"
storageconfig
"
=>
undef
,
);
sub
VNCONFIG
($)
{
return
$vnconfig
{'
config
'}
->
{
$_
[
0
]};
}
...
...
@@ -332,6 +333,7 @@ my %tmp;
my
@tmp
;
my
$tmp
;
my
%attrs
;
my
%envvars
;
fatal
("
Could not get vnode config for
$vnodeid
")
if
(
getgenvnodeconfig
(
\
%tmp
));
...
...
@@ -357,6 +359,10 @@ fatal("getstorageconfig($vnodeid): $!")
if
(
getstorageconfig
(
\
@tmp
));
$vnconfig
{"
storageconfig
"}
=
[
@tmp
];
fatal
("
getenvvars(): $!
")
if
(
getenvvars
(
\
%envvars
));
$vnconfig
{"
environment
"}
=
\
%envvars
;
if
(
$debug
)
{
print
"
VN Config:
\n
";
print
Dumper
(
\
%vnconfig
);
...
...
clientside/tmcc/linux/xen/libvnode_xen.pm
View file @
8db75899
...
...
@@ -1516,9 +1516,9 @@ sub vnodePreConfigExpNetwork($$$$)
};
# Prototyping hack for Nick.
if
(
exists
(
$interface
->
{'
SETTINGS
'})
&&
exists
(
$
interface
->
{'
SETTINGS
'}
->
{'
nomac_learning
'
})
&&
$
interface
->
{'
SETTINGS
'}
->
{'
nomac_learning
'
})
{
my
$envvar
=
$interface
->
{"
LAN
"}
.
"
_nomac_learning
";
if
(
exists
(
$
vnconfig
->
{'
environment
'}
->
{
$envvar
})
&&
$
vnconfig
->
{'
environment
'}
->
{
$envvar
})
{
$link
->
{'
nomac_learning
'}
=
1
;
}
push
@links
,
$link
;
...
...
protogeni/lib/GeniCM.pm.in
View file @
8db75899
...
...
@@ -1713,14 +1713,18 @@ sub GetTicketAuxAux($$$$$$$$$$)
}
#
#
Look
for
general
link
attributes
that
pass
through
to
the
#
backend
.
#
Look
for
general
link
attributes
.
We
cannot
use
the
#
virt_lan_settings
here
,
we
do
not
pass
them
through
for
#
regular
lans
.
That
needs
to
be
fixed
.
At
the
moment
,
#
I
just
need
this
for
Nick
zero
aging
stuff
,
so
make
it
#
an
environment
variable
instead
.
Yuck
.
#
foreach
my
$
attr_ref
(
GeniXML
::
GetLinkAttributes
($
linkref
))
{
$
virtexperiment
->
NewTableRow
(
"virt_lan_settings"
,
{
"vname"
=>
$
lanname
,
"capkey"
=>
$
attr_ref
->{
'key'
},
"capval"
=>
$
attr_ref
->{
'value'
}
});
if
($
attr_ref
->{
'key'
}
eq
"nomac_learning"
)
{
$
virtexperiment
->
NewTableRow
(
"virt_user_environment"
,
{
"name"
=>
$
lanname
.
"_"
.
"nomac_learning"
,
"value"
=>
$
attr_ref
->{
'value'
}
});
}
}
#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment