Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
3723bbac
Commit
3723bbac
authored
Apr 17, 2011
by
Jonathon Duerig
Browse files
Bugfix: tunnels, virtualization_types, bandwidth, vlantags for rspecv2
parent
195d87c8
Changes
5
Hide whitespace changes
Inline
Side-by-side
protogeni/lib/GeniAggregate.pm.in
View file @
3723bbac
...
...
@@ -1474,8 +1474,8 @@ sub Create($$$$$$)
my $iface2ref = $interfaces[1];
# These are the ips of the tunnel.
my $ip1 = GeniXML::Get
Text("tunnel_ip", $iface1ref
);
my $ip2 = GeniXML::Get
Text("tunnel_ip", $iface2ref
);
my $ip1 = GeniXML::Get
Ip($iface1ref, $node1rspec
);
my $ip2 = GeniXML::Get
Ip($iface2ref, $node2rspec
);
my $virtid1 = GeniXML::GetInterfaceNodeId($iface1ref);
my $virtid2 = GeniXML::GetInterfaceNodeId($iface2ref);
my $ctrlip1;
...
...
protogeni/lib/GeniCM.pm.in
View file @
3723bbac
...
...
@@ -872,7 +872,7 @@ sub GetTicketAuxAux($$$$$$$$$)
goto bad;
}
$exclusive = 1;
if (! GeniXML::SetVirtualization
T
ype($ref, "raw")) {
if (! GeniXML::SetVirtualization
Subt
ype($ref, "raw")) {
$response = GeniResponse->Create(GENIRESPONSE_BADARGS,
undef,
"Malformed rspec: Cannot set virtualization_type to raw");
...
...
@@ -1318,8 +1318,9 @@ sub GetTicketAuxAux($$$$$$$$$)
my $member = "$node_nickname:$iface_vport";
my $bandwidth = 100000;
# TODO: Allow asymmetric bandwidths
# Let user override.
my $user_bandwidth = GeniXML::Get
Text("b
andwidth
",
$linkref);
my $user_bandwidth = GeniXML::Get
B
andwidth
(
$linkref);
if (defined($user_bandwidth)) {
$bandwidth = $user_bandwidth;
}
...
...
@@ -2530,10 +2531,25 @@ sub SliverWorkAux($$$$$$$)
$iface1ref);
my $node2_id = GeniXML::GetText("virtual_node_id",
$iface2ref);
my $node1sliver = $nodemap{$node1_id};
my $node2sliver = $nodemap{$node2_id};
my $node1rspec = $rspecmap{$node1_id};
my $node2rspec = $rspecmap{$node2_id};
if (! GeniXML::IsVersion0($linkref)) {
my $iface1_id = GeniXML::GetInterfaceId($iface1ref);
$node1_id = $iface2node{$iface1_id}
if (defined($iface1_id));
my $iface2_id = GeniXML::GetInterfaceId($iface2ref);
$node2_id = $iface2node{$iface2_id}
if (defined($iface2_id));
}
my $node1sliver;
my $node2sliver;
my $node1rspec;
my $node2rspec;
if (defined($node1_id) && defined($node2_id)) {
$node1sliver = $nodemap{$node1_id};
$node2sliver = $nodemap{$node2_id};
$node1rspec = $rspecmap{$node1_id};
$node2rspec = $rspecmap{$node2_id};
}
if (! (defined($node1sliver) || (defined($node2sliver)))) {
$message = "$linkname: No local nodes for tunnel";
...
...
protogeni/lib/GeniSliver.pm.in
View file @
3723bbac
...
...
@@ -940,7 +940,7 @@ sub ProcessManifest($$)
my $sliver_urn = GeniXML::GetSliverId($ref);
if (defined($sliver_urn) && $sliver_urn eq $self->sliver_urn()) {
# startup command.
my $startupcmd = GeniXML::Get
Text("s
tartup
_c
ommand
",
$ref);
my $startupcmd = GeniXML::Get
S
tartup
C
ommand
(
$ref);
if (defined($startupcmd)) {
if (! TBcheck_dbslot($startupcmd, "virt_nodes",
"startupcmd",
...
...
protogeni/lib/GeniXML.pm.in
View file @
3723bbac
...
...
@@ -13,10 +13,10 @@ use vars qw(@ISA @EXPORT);
@
ISA
=
"Exporter"
;
@
EXPORT
=
qw
(
Parse
ParseFile
IsVersion0
FindNodes
FindNodesNS
FindFirst
FindElement
FindAttr
GetNodeByVirtualId
GetLinkByVirtualId
IsLanNode
IsLocalNode
IsTunnel
GetExpires
IsLanNode
IsLocalNode
IsTunnel
GetExpires
GetBandwidth
GetIp
GetNodeId
GetVirtualId
GetInterfaceId
GetInterfaceNodeId
GetSliverId
GetManagerId
GetColocate
GetSubnodeOf
GetStartupCommand
GetTarball
GetVirtualizationType
SetVirtualization
T
ype
GetVirtualizationSubtype
GetVirtualizationType
SetVirtualization
Subt
ype
GetVirtualizationSubtype
GetExclusive
SetExclusive
GetLinkManager
SetText
GetText
Serialize
CreateDocument
AddElement
RemoveChild
PolicyExists
);
...
...
@@ -300,6 +300,42 @@ sub SetExpires($$)
}
}
sub GetBandwidth($)
{
my ($link) = @_;
my $result = undef;
if (IsVersion0($link)) {
$result = GeniXML::GetText("bandwidth", $link);
} else {
my $prop = FindFirst("n:property", $link);
$result = GeniXML::GetText("capacity", $prop);
}
return $result;
}
sub GetIp($$)
{
my ($ifaceref, $node) = @_;
my $result = undef;
if (IsVersion0($ifaceref)) {
$result = GetText("tunnel_ip", $ifaceref);
} else {
my $id = GetInterfaceId($ifaceref);
my @ifaces = FindNodes("n:interface", $node)->get_nodelist();
foreach my $iface (@ifaces) {
my $testid = GetInterfaceId($iface);
if (defined($id) && defined($testid) && $testid eq $id) {
my $ip = FindFirst("n:ip", $iface);
if (defined($ip)) {
$result = GetText("address", $ip);
}
last;
}
}
}
return $result;
}
# Returns the uuid or urn of an RSpec node or undef if it is not a node.
sub GetNodeId($)
{
...
...
@@ -426,12 +462,18 @@ sub GetVirtualizationType($)
return
$
result
;
}
sub
SetVirtualization
T
ype
($$)
sub
SetVirtualization
Subt
ype
($$)
{
my
($
node
,
$
arg
)
=
@
_
;
my
$
result
=
1
;
if
(
IsVersion0
($
node
))
{
$
result
=
SetText
(
"virtualization_type"
,
$
node
,
$
arg
);
$
result
=
SetText
(
"virtualization_subtype"
,
$
node
,
$
arg
);
}
else
{
my
$
type
=
FindFirst
(
"n:sliver_type"
,
$
node
);
if
(
! defined($type)) {
$
type
=
AddElement
(
"sliver_type"
,
$
node
);
}
SetText
(
"name"
,
$
type
,
$
arg
);
}
return
$
result
;
}
...
...
protogeni/rspec/2/manifest.rnc
View file @
3723bbac
...
...
@@ -14,7 +14,9 @@ NodeContents &=
attribute sliver_id { text }
LinkContents &=
attribute sliver_id { text }
attribute sliver_id { text } &
# vlan tag number used for stitching
attribute vlantag { text }
InterfaceContents &=
attribute mac_address { text } ?
...
...
Write
Preview
Supports
Markdown
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