Commit 5a50cce6 authored by Leigh B Stoller's avatar Leigh B Stoller

Emulab extension for passing node and link attributes through.

parent e41a85fd
......@@ -1493,6 +1493,17 @@ sub GetTicketAuxAux($$$$$$$$$$)
"attrvalue" => $attrvalue });
}
}
#
# Look for general node attributes that pass through to the
# backend.
#
foreach my $attr_ref (GeniXML::GetNodeAttributes($ref)) {
$virtexperiment->NewTableRow("virt_node_attributes",
{"vname" => $node_nickname,
"attrkey" => $attr_ref->{'key'},
"attrvalue" => $attr_ref->{'value'}});
}
#
# Look for interface forward declarations that will be used later
......@@ -1701,6 +1712,17 @@ sub GetTicketAuxAux($$$$$$$$$$)
$encap = (IsTaggedLan($linkref) ? "vlan" : "default");
}
#
# Look for general link attributes that pass through to the
# backend.
#
foreach my $attr_ref (GeniXML::GetLinkAttributes($linkref)) {
$virtexperiment->NewTableRow("virt_lan_settings",
{"vname" => $lanname,
"capkey" => $attr_ref->{'key'},
"capval" => $attr_ref->{'value'} });
}
#
# Sanity check, and determine if the link has any virtnodes
# in it, cause that is going to change the default bandwidth
......
#!/usr/bin/perl -w
#
# Copyright (c) 2010-2013 University of Utah and the Flux Group.
# Copyright (c) 2010-2014 University of Utah and the Flux Group.
#
# {{{GENIPUBLIC-LICENSE
#
......@@ -571,6 +571,24 @@ sub GetServices($)
return @result;
}
sub GetNodeAttributes($)
{
my ($node) = @_;
my @result = ();
my @attributes =
FindNodesNS("n:node_attribute", $node, $EMULAB_NS)->get_nodelist();
foreach my $attr (@attributes) {
my $key = GetText("key", $attr);
my $value = GetText("value", $attr);
if (defined($key) && $key ne "" && defined($value)) {
push(@result, {"key" => $key, "value" => $value});
}
}
return @result;
}
sub GetStartupCommand($)
{
my ($node) = @_;
......@@ -698,6 +716,24 @@ sub SetExclusive($$)
return $result;
}
sub GetLinkAttributes($)
{
my ($link) = @_;
my @result = ();
my @attributes =
FindNodesNS("n:link_attribute", $link, $EMULAB_NS)->get_nodelist();
foreach my $attr (@attributes) {
my $key = GetText("key", $attr);
my $value = GetText("value", $attr);
if (defined($key) && $key ne "" && defined($value)) {
push(@result, {"key" => $key, "value" => $value});
}
}
return @result;
}
sub GetLinkManager($)
{
my ($link) = @_;
......
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