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
a78357c4
Commit
a78357c4
authored
Aug 06, 2010
by
Jonathon Duerig
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git-public.flux.utah.edu:/flux/git/emulab-devel
parents
5876166c
fdf56a9b
Changes
58
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
58 changed files
with
2270 additions
and
1528 deletions
+2270
-1528
.gitignore
.gitignore
+0
-8
account/mksyscert.in
account/mksyscert.in
+2
-2
apache/httpd.conf.in
apache/httpd.conf.in
+2
-7
db/Experiment.pm.in
db/Experiment.pm.in
+19
-23
db/Interface.pm.in
db/Interface.pm.in
+30
-3
db/Node.pm.in
db/Node.pm.in
+18
-3
db/emdbi.pm.in
db/emdbi.pm.in
+0
-1
db/libGeni.pm.in
db/libGeni.pm.in
+106
-42
db/libdb.pm.in
db/libdb.pm.in
+2
-0
event/lib/event.c
event/lib/event.c
+4
-4
install/updates/5/7
install/updates/5/7
+53
-0
mfs/linux_mfs/Makefile
mfs/linux_mfs/Makefile
+11
-15
mfs/linux_mfs/scripts/misc_fixup.sh
mfs/linux_mfs/scripts/misc_fixup.sh
+13
-0
mfs/linux_mfs/source/e2fsprogs/Makefile
mfs/linux_mfs/source/e2fsprogs/Makefile
+14
-2
mfs/linux_mfs/source/jove/Makefile
mfs/linux_mfs/source/jove/Makefile
+56
-0
mfs/linux_mfs/source/jove/jove.mk
mfs/linux_mfs/source/jove/jove.mk
+673
-0
mfs/linux_mfs/source/jove/jove_getline.patch
mfs/linux_mfs/source/jove/jove_getline.patch
+96
-0
mfs/linux_mfs/source/ncurses/Makefile
mfs/linux_mfs/source/ncurses/Makefile
+118
-0
mfs/linux_mfs/source/openssl/Makefile
mfs/linux_mfs/source/openssl/Makefile
+17
-13
mfs/linux_mfs/source/openssl/openssl.patch
mfs/linux_mfs/source/openssl/openssl.patch
+2
-119
mfs/linux_mfs/source/target_template/template/bin/tcsh.fake
mfs/linux_mfs/source/target_template/template/bin/tcsh.fake
+0
-0
mfs/linux_mfs/source/target_template/template/etc/shells
mfs/linux_mfs/source/target_template/template/etc/shells
+1
-1
mfs/linux_mfs/source/tcsh/Makefile
mfs/linux_mfs/source/tcsh/Makefile
+76
-0
mfs/linux_mfs/source/tcsh/configure_cross_compile.patch
mfs/linux_mfs/source/tcsh/configure_cross_compile.patch
+149
-0
mfs/linux_mfs/source/toolchain/uClibc-0.9.30.config
mfs/linux_mfs/source/toolchain/uClibc-0.9.30.config
+2
-0
protogeni/lib/GeniCM.pm.in
protogeni/lib/GeniCM.pm.in
+11
-5
protogeni/lib/GeniCredential.pm.in
protogeni/lib/GeniCredential.pm.in
+4
-1
protogeni/lib/GeniResource.pm.in
protogeni/lib/GeniResource.pm.in
+8
-1
protogeni/lib/GeniSA.pm.in
protogeni/lib/GeniSA.pm.in
+2
-5
protogeni/lib/GeniTicket.pm.in
protogeni/lib/GeniTicket.pm.in
+2
-2
protogeni/lib/GeniUser.pm.in
protogeni/lib/GeniUser.pm.in
+8
-2
protogeni/scripts/createcerts.in
protogeni/scripts/createcerts.in
+0
-89
protogeni/test/delegate.py
protogeni/test/delegate.py
+12
-8
protogeni/test/getticket.py
protogeni/test/getticket.py
+3
-1
protogeni/xmlrpc/GNUmakefile.in
protogeni/xmlrpc/GNUmakefile.in
+12
-17
protogeni/xmlrpc/geni-am.pl.in
protogeni/xmlrpc/geni-am.pl.in
+0
-290
protogeni/xmlrpc/geni-am.pm.in
protogeni/xmlrpc/geni-am.pm.in
+68
-0
protogeni/xmlrpc/protogeni-ch.pl.in
protogeni/xmlrpc/protogeni-ch.pl.in
+0
-230
protogeni/xmlrpc/protogeni-ch.pm.in
protogeni/xmlrpc/protogeni-ch.pm.in
+40
-0
protogeni/xmlrpc/protogeni-cm.pm.in
protogeni/xmlrpc/protogeni-cm.pm.in
+81
-0
protogeni/xmlrpc/protogeni-sa.pl.in
protogeni/xmlrpc/protogeni-sa.pl.in
+0
-249
protogeni/xmlrpc/protogeni-sa.pm.in
protogeni/xmlrpc/protogeni-sa.pm.in
+37
-0
protogeni/xmlrpc/protogeni-ses.pl.in
protogeni/xmlrpc/protogeni-ses.pl.in
+0
-206
protogeni/xmlrpc/protogeni-ses.pm.in
protogeni/xmlrpc/protogeni-ses.pm.in
+28
-0
protogeni/xmlrpc/protogeni-wrapper.pl.in
protogeni/xmlrpc/protogeni-wrapper.pl.in
+133
-91
ssl/GNUmakefile.in
ssl/GNUmakefile.in
+5
-3
ssl/ca.cnf.in
ssl/ca.cnf.in
+5
-0
ssl/updatecert.in
ssl/updatecert.in
+179
-0
tbsetup/libossetup.pm.in
tbsetup/libossetup.pm.in
+13
-0
tbsetup/libvtop.pm.in
tbsetup/libvtop.pm.in
+94
-66
tbsetup/pool_daemon.in
tbsetup/pool_daemon.in
+1
-1
tbsetup/swapexp.in
tbsetup/swapexp.in
+11
-6
tbsetup/tbprerun.in
tbsetup/tbprerun.in
+2
-6
tbsetup/tbreport.in
tbsetup/tbreport.in
+3
-0
tmcd/tmcd.c
tmcd/tmcd.c
+23
-6
www/defs.php3.in
www/defs.php3.in
+5
-0
www/pub_defs.php
www/pub_defs.php
+2
-0
www/pubs.html
www/pubs.html
+14
-0
No files found.
.gitignore
deleted
100644 → 0
View file @
5876166c
event/trafgen/tg2.0
event/linktest/iperf/iperf-2.0.2
event/linktest/rude/rude-0.70
sensors/nfstrace/nfsdump2/Makefile
sensors/nfstrace/nfsdump2/config.h
sensors/nfstrace/nfsdump2/config.log
protogeni/demo/.metadata
protogeni/demo/map/.metadata
account/mksyscert.in
View file @
a78357c4
#!/usr/bin/perl -w
#!/usr/bin/perl -w
#
#
# EMULAB-COPYRIGHT
# EMULAB-COPYRIGHT
# Copyright (c) 2000-200
9
University of Utah and the Flux Group.
# Copyright (c) 2000-20
1
0 University of Utah and the Flux Group.
# All rights reserved.
# All rights reserved.
#
#
use
strict
;
use
strict
;
...
@@ -271,7 +271,6 @@ system("$OPENSSL ca -batch -policy policy_sslxmlrpc ".
...
@@ -271,7 +271,6 @@ system("$OPENSSL ca -batch -policy policy_sslxmlrpc ".
"
-infiles syscert_req.pem
$outline
")
==
0
"
-infiles syscert_req.pem
$outline
")
==
0
or
fatal
("
Could not sign certificate request
");
or
fatal
("
Could not sign certificate request
");
$UID
=
$SAVEUID
;
$UID
=
$SAVEUID
;
TBScriptUnlock
();
#
#
# Combine the key and the certificate into one file
# Combine the key and the certificate into one file
...
@@ -288,6 +287,7 @@ else {
...
@@ -288,6 +287,7 @@ else {
system
("
cat syscert_key.pem syscert_cert.pem
")
==
0
system
("
cat syscert_key.pem syscert_cert.pem
")
==
0
or
fatal
("
Could not combine cert and key
");
or
fatal
("
Could not combine cert and key
");
}
}
TBScriptUnlock
();
exit
(
0
);
exit
(
0
);
sub
fatal
($)
{
sub
fatal
($)
{
...
...
apache/httpd.conf.in
View file @
a78357c4
...
@@ -1344,13 +1344,8 @@ SSLVerifyDepth 10
...
@@ -1344,13 +1344,8 @@ SSLVerifyDepth 10
SSLRequire ( %{SSL_CLIENT_S_DN_OU} ne "sslxmlrpc" )
SSLRequire ( %{SSL_CLIENT_S_DN_OU} ne "sslxmlrpc" )
</Location>
</Location>
ScriptAlias /protogeni/xmlrpc/ch @prefix@/protogeni/xmlrpc/protogeni-ch.pl
ScriptAlias /protogeni/xmlrpc @prefix@/protogeni/xmlrpc/protogeni-wrapper.pl
ScriptAlias /protogeni/xmlrpc/cm @prefix@/protogeni/xmlrpc/protogeni-cm.pl
ScriptAlias /protogeni/xmlrpc/sa @prefix@/protogeni/xmlrpc/protogeni-sa.pl
ScriptAlias /protogeni/xmlrpc/ses @prefix@/protogeni/xmlrpc/protogeni-ses.pl
<IfDefine GENI_AM>
ScriptAlias /protogeni/xmlrpc/am @prefix@/protogeni/xmlrpc/geni-am.pl
</IfDefine>
<Directory "@prefix@/www/protogeni">
<Directory "@prefix@/www/protogeni">
SSLRequireSSL
SSLRequireSSL
Order deny,allow
Order deny,allow
...
...
db/Experiment.pm.in
View file @
a78357c4
...
@@ -2076,6 +2076,8 @@ sub PreSwap($$$$)
...
@@ -2076,6 +2076,8 @@ sub PreSwap($$$$)
$swapper->BumpActivity();
$swapper->BumpActivity();
$self->GetProject()->BumpActivity();
$self->GetProject()->BumpActivity();
$self->GetGroup()->BumpActivity();
$self->GetGroup()->BumpActivity();
$self->Refresh() == 0
or goto failed;
return 0;
return 0;
failed:
failed:
...
@@ -2157,16 +2159,7 @@ sub SwapFail($$$$;$)
...
@@ -2157,16 +2159,7 @@ sub SwapFail($$$$;$)
"where idx='
$
rsrcidx
'")
"where idx='
$
rsrcidx
'")
or return -1;
or return -1;
if ($which eq $EXPT_SWAPMOD &&
# Delete it.
$self->state() eq libdb::EXPTSTATE_ACTIVE()) {
DBQueryWarn("update experiment_resources set ".
($flags & libdb::TBDB_STATS_FLAGS_MODHOSED() ?
"swapout_time=swapmod_time, " : " ") .
"swapmod_time=0 ".
"where idx='
$
lastrsrc
'")
or return -1;
}
DBQueryWarn("delete from experiment_resources ".
DBQueryWarn("delete from experiment_resources ".
"where idx=$rsrcidx")
"where idx=$rsrcidx")
or return -1;
or return -1;
...
@@ -2225,6 +2218,21 @@ sub PostSwap($$$$)
...
@@ -2225,6 +2218,21 @@ sub PostSwap($$$$)
my $prev_swapper = $swapper;
my $prev_swapper = $swapper;
my $query_result;
my $query_result;
#
# Need to update the previous record with the swapmod_time.
#
if ($which eq $EXPT_SWAPMOD) {
my $when = "UNIX_TIMESTAMP(now())";
# unless its active, in which case pick up swapin time.
$when = $self->swapin_time()
if ($self->state() eq libdb::EXPTSTATE_ACTIVE());
DBQueryWarn("update experiment_resources set ".
" swapmod_time=$when ".
"where idx='
$
lastrsrc
'")
or return -1;
}
if ($which eq $EXPT_SWAPOUT ||
if ($which eq $EXPT_SWAPOUT ||
($which eq $EXPT_SWAPMOD &&
($which eq $EXPT_SWAPMOD &&
$self->state() eq libdb::EXPTSTATE_ACTIVE())) {
$self->state() eq libdb::EXPTSTATE_ACTIVE())) {
...
@@ -2246,7 +2254,7 @@ sub PostSwap($$$$)
...
@@ -2246,7 +2254,7 @@ sub PostSwap($$$$)
DBQueryWarn("select r.pnodes,r.vnodes,r.uid_idx, ".
DBQueryWarn("select r.pnodes,r.vnodes,r.uid_idx, ".
" r.swapmod_time - r.swapin_time ".
" r.swapmod_time - r.swapin_time ".
" from experiment_resources as r ".
" from experiment_resources as r ".
"where r.idx='
$
rsrc
idx
'");
"where r.idx='
$
last
rsrc
'");
}
}
return -1
return -1
if (!$query_result);
if (!$query_result);
...
@@ -2264,18 +2272,6 @@ sub PostSwap($$$$)
...
@@ -2264,18 +2272,6 @@ sub PostSwap($$$$)
}
}
}
}
if ($which eq $EXPT_SWAPMOD) {
my $when = "UNIX_TIMESTAMP(now())";
# unless its active, in which case pick up swapin time.
$when = $self->swapin_time()
if ($self->state() eq libdb::EXPTSTATE_ACTIVE());
DBQueryWarn("update experiment_resources set ".
" swapmod_time=$when ".
"where idx='
$
lastrsrc
'")
or return -1;
}
# Special case for initial record. Needs to be fixed.
# Special case for initial record. Needs to be fixed.
if ($which eq $EXPT_SWAPIN && !$self->lastidx()) {
if ($which eq $EXPT_SWAPIN && !$self->lastidx()) {
DBQueryWarn("update experiment_resources set byswapin=1 ".
DBQueryWarn("update experiment_resources set byswapin=1 ".
...
...
db/Interface.pm.in
View file @
a78357c4
...
@@ -322,14 +322,38 @@ sub Create($$$)
...
@@ -322,14 +322,38 @@ sub Create($$$)
print
STDERR
Dumper
($
argref
);
print
STDERR
Dumper
($
argref
);
return
undef
;
return
undef
;
}
}
DBQueryWarn
(
"insert into interfaces set "
.
#
#
Lock
the
tables
to
prevent
concurrent
creation
#
DBQueryWarn
(
"lock tables interfaces write, "
.
" interface_state write, "
.
" wires write"
)
or
return
undef
;
#
#
See
if
we
have
a
record
;
if
we
do
,
we
can
stop
now
.
This
is
#
not
actually
correct
,
since
creating
a
node
is
not
atomic
.
#
my
$
query_result
=
DBQueryWarn
(
"select node_id from interfaces "
.
"where node_id='$node_id' and "
.
" card='$card' and port='$port'"
);
if
($
query_result
->
numrows
)
{
DBQueryWarn
(
"unlock tables"
);
return
Interface
->
Lookup
($
node_id
,
$
card
,
$
port
);
}
if
(
!DBQueryWarn("insert into interfaces set ".
" node_id='$node_id', "
.
" node_id='$node_id', "
.
" card=$card, port=$port, role='$ifrole', "
.
" card=$card, port=$port, role='$ifrole', "
.
" mac='$MAC', IP='$IP', mask='$mask', "
.
" mac='$MAC', IP='$IP', mask='$mask', "
.
" interface_type='$iftype', iface='$iface', "
.
" interface_type='$iftype', iface='$iface', "
.
" current_speed='$max_speed', duplex='$duplex', "
.
" current_speed='$max_speed', duplex='$duplex', "
.
" uuid='$uuid'"
)
" uuid='$uuid'"
))
{
or
return
undef
;
DBQueryWarn
(
"unlock tables"
);
return
undef
;
}
if
(
!DBQueryWarn("insert into interface_state set ".
if
(
!DBQueryWarn("insert into interface_state set ".
" node_id='$node_id', "
.
" node_id='$node_id', "
.
...
@@ -337,6 +361,7 @@ sub Create($$$)
...
@@ -337,6 +361,7 @@ sub Create($$$)
DBQueryWarn
(
"delete from interfaces "
.
DBQueryWarn
(
"delete from interfaces "
.
"where node_id='$node_id' and card='$card' "
.
"where node_id='$node_id' and card='$card' "
.
" and port='$port'"
);
" and port='$port'"
);
DBQueryWarn
(
"unlock tables"
);
return
undef
;
return
undef
;
}
}
...
@@ -359,9 +384,11 @@ sub Create($$$)
...
@@ -359,9 +384,11 @@ sub Create($$$)
DBQueryWarn
(
"delete from interfaces "
.
DBQueryWarn
(
"delete from interfaces "
.
"where node_id='$node_id' and card='$card' "
.
"where node_id='$node_id' and card='$card' "
.
" and port='$port'"
);
" and port='$port'"
);
DBQueryWarn
(
"unlock tables"
);
return
undef
;
return
undef
;
}
}
}
}
DBQueryWarn
(
"unlock tables"
);
return
Interface
->
Lookup
($
node_id
,
$
card
,
$
port
);
return
Interface
->
Lookup
($
node_id
,
$
card
,
$
port
);
}
}
...
...
db/Node.pm.in
View file @
a78357c4
...
@@ -338,8 +338,11 @@ sub Create($$$$)
...
@@ -338,8 +338,11 @@ sub Create($$$$)
#
#
#
Lock
the
tables
to
prevent
concurrent
creation
#
Lock
the
tables
to
prevent
concurrent
creation
#
#
DBQueryWarn
(
"lock tables nodes write, widearea_nodeinfo write"
)
DBQueryWarn
(
"lock tables nodes write, widearea_nodeinfo write, "
.
or
return
-
1
;
"node_hostkeys write, node_status write, "
.
"node_utilization write, "
.
"node_activity write, reserved write, node_auxtypes write"
)
or
return
undef
;
#
#
#
Make
up
a
priority
(
just
used
for
sorting
)
#
Make
up
a
priority
(
just
used
for
sorting
)
...
@@ -351,6 +354,17 @@ sub Create($$$$)
...
@@ -351,6 +354,17 @@ sub Create($$$$)
$
priority
=
1
;
$
priority
=
1
;
}
}
#
#
See
if
we
have
a
record
;
if
we
do
,
we
can
stop
now
and
get
the
#
existing
record
.
#
my
$
query_result
=
DBQueryWarn
(
"select node_id from nodes where node_id='$node_id'"
);
if
($
query_result
->
numrows
)
{
DBQueryWarn
(
"unlock tables"
);
return
Node
->
Lookup
($
node_id
);
}
if
(
!DBQueryWarn("insert into nodes set ".
if
(
!DBQueryWarn("insert into nodes set ".
" node_id='$node_id', type='$type', "
.
" node_id='$node_id', type='$type', "
.
" phys_nodeid='$node_id', role='$role', "
.
" phys_nodeid='$node_id', role='$role', "
.
...
@@ -378,7 +392,6 @@ sub Create($$$$)
...
@@ -378,7 +392,6 @@ sub Create($$$$)
return
undef
;
return
undef
;
}
}
}
}
DBQueryWarn
(
"unlock tables"
);
if
($
role
eq
"testnode"
)
{
if
($
role
eq
"testnode"
)
{
DBQueryWarn
(
"insert into node_hostkeys (node_id) "
.
DBQueryWarn
(
"insert into node_hostkeys (node_id) "
.
...
@@ -435,12 +448,14 @@ sub Create($$$$)
...
@@ -435,12 +448,14 @@ sub Create($$$$)
"type='$vtype', count=$virtnode_capacity"
)
"type='$vtype', count=$virtnode_capacity"
)
or
goto
bad
;
or
goto
bad
;
}
}
DBQueryWarn
(
"unlock tables"
);
return
Node
->
Lookup
($
node_id
);
return
Node
->
Lookup
($
node_id
);
bad
:
bad
:
foreach
my
$
table
(@
cleantables
)
{
foreach
my
$
table
(@
cleantables
)
{
DBQueryWarn
(
"delete from $table where node_id='$node_id'"
);
DBQueryWarn
(
"delete from $table where node_id='$node_id'"
);
}
}
DBQueryWarn
(
"unlock tables"
);
return
undef
;
return
undef
;
}
}
...
...
db/emdbi.pm.in
View file @
a78357c4
...
@@ -193,7 +193,6 @@ sub TBDBDisconnect()
...
@@ -193,7 +193,6 @@ sub TBDBDisconnect()
for (my $i = 0; $i < @DB; $i++) {
for (my $i = 0; $i < @DB; $i++) {
undef($DB[$i]);
undef($DB[$i]);
}
}
select(undef, undef, undef, 0.2);
}
}
# Create a new DB handle and return the handle number
# Create a new DB handle and return the handle number
...
...
db/libGeni.pm.in
View file @
a78357c4
...
@@ -76,22 +76,49 @@ sub MapResources($$$$)
...
@@ -76,22 +76,49 @@ sub MapResources($$$$)
or
return
-
1
;
or
return
-
1
;
foreach
my
$
ref
(@{
$
rspec
->{
'node'
}
})
{
foreach
my
$
ref
(@{
$
rspec
->{
'node'
}
})
{
my
$
resource
;
my
%
copy
=
%{
$
ref
};
my
%
copy
=
%{
$
ref
};
my
$
copy
=
\%
copy
;
my
$
copy
=
\%
copy
;
my
$
node_urn
=
$
copy
->{
'
componen
t_urn'
};
my
$
node_urn
=
$
copy
->{
'
reques
t_urn'
};
my
($
auth
,$
type
,$
node_id
)
=
GeniHRN
::
Parse
($
node_urn
);
my
($
auth
,$
type
,$
node_id
)
=
GeniHRN
::
Parse
($
node_urn
);
my
$
cm
=
GeniHRN
::
Generate
($
auth
,
"authority"
,
"cm"
);
my
$
cm
=
GeniHRN
::
Generate
($
auth
,
"authority"
,
"cm"
);
$
copy
->{
'component_manager_uuid'
}
=
$
cm
;
$
copy
->{
'component_manager_uuid'
}
=
$
cm
;
if
($
node_id
eq
"*"
)
{
#
assign
will
use
this
,
but
its
format
is
bogus
.
Kill
it
.
#
delete
($
copy
->{
'component_urn'
});
#
Get
the
resource
object
.
#
if
(
!exists($cm_urns{$cm})) {
$
resource
=
GeniResource
->
Lookup
($
experiment
->
idx
(),
$
cm
);
if
(
!defined($resource)) {
$
resource
=
GeniResource
->
Create
($
experiment
,
$
cm
);
if
(
!defined($resource)) {
print
STDERR
"Could not create GeniResource for $cm
\n
"
;
return
-
1
;
}
}
$
cm_urns
{$
cm
}
=
$
resource
;
}
}
else
{
$
resource
=
$
cm_urns
{$
cm
};
$
copy
->{
'component_uuid'
}
=
$
node_urn
;
#
#
request_urn
means
nothing
to
assign
;
kill
that
from
the
copy
.
#
delete
($
copy
->{
'request_urn'
});
#
Ditto
delete
($
copy
->{
'tarfiles'
});
#
#
If
already
have
the
ticket
,
then
leave
the
urn
alone
.
#
We
do
not
run
assign
again
,
but
we
need
the
rspec
to
be
#
complete
for
loops
below
.
#
if
(
!$resource->HaveTicket()) {
if
($
node_id
ne
"*"
)
{
$
copy
->{
'component_uuid'
}
=
$
node_urn
;
$
copy
->{
'component_urn'
}
=
$
node_urn
;
}
}
}
$
cm_urns
{$
cm
}
=
$
cm
;
#
#
#
The
point
of
this
is
to
split
the
rspec
apart
,
since
at
present
#
The
point
of
this
is
to
split
the
rspec
apart
,
since
at
present
...
@@ -125,6 +152,9 @@ sub MapResources($$$$)
...
@@ -125,6 +152,9 @@ sub MapResources($$$$)
foreach
my
$
ref
(@{
$
rspec
->{
'link'
}
})
{
foreach
my
$
ref
(@{
$
rspec
->{
'link'
}
})
{
my
$
linkname
=
$
ref
->{
'virtual_id'
};
my
$
linkname
=
$
ref
->{
'virtual_id'
};
#
means
nothing
to
assign
;
added
again
below
.
delete
($
ref
->{
'component_manager'
});
#
Skip
tunnels
until
rspec
stitching
in
place
.
#
Skip
tunnels
until
rspec
stitching
in
place
.
next
next
if
(
exists
($
ref
->{
'link_type'
})
&&
if
(
exists
($
ref
->{
'link_type'
})
&&
...
@@ -156,21 +186,6 @@ sub MapResources($$$$)
...
@@ -156,21 +186,6 @@ sub MapResources($$$$)
}
}
}
}
#
#
Get
the
resource
objects
.
#
foreach
my
$
cm
(
keys
(%
cm_urns
))
{
my
$
resource
=
GeniResource
->
Lookup
($
experiment
->
idx
(),
$
cm
);
if
(
!defined($resource)) {
$
resource
=
GeniResource
->
Create
($
experiment
,
$
cm
);
if
(
!defined($resource)) {
print
STDERR
"Could not create GeniResource for $cm
\n
"
;
return
-
1
;
}
}
$
cm_urns
{$
cm
}
=
$
resource
;
}
#
#
#
Discover
resources
at
the
component
and
run
assign
.
#
Discover
resources
at
the
component
and
run
assign
.
#
#
...
@@ -179,6 +194,14 @@ sub MapResources($$$$)
...
@@ -179,6 +194,14 @@ sub MapResources($$$$)
my
$
fragment
=
$
fragments
{$
cm
};
my
$
fragment
=
$
fragments
{$
cm
};
my
$
advertisement
;
my
$
advertisement
;
#
#
We
got
the
ticket
on
a
previous
loop
.
#
if
($
resource
->
HaveTicket
())
{
print
STDERR
"Already have a ticket for $resource; skipping ...
\n
"
;
next
;
}
print
STDERR
"Asking for resource list from $resource
\n
"
;
print
STDERR
"Asking for resource list from $resource
\n
"
;
if
($
resource
->
Discover
($
user
,
\$
advertisement
))
{
if
($
resource
->
Discover
($
user
,
\$
advertisement
))
{
print
STDERR
"Could not get resource list for $resource
\n
"
;
print
STDERR
"Could not get resource list for $resource
\n
"
;
...
@@ -316,6 +339,7 @@ sub GetTickets($$$$)
...
@@ -316,6 +339,7 @@ sub GetTickets($$$$)
{
{
my
($
experiment
,
$
verbose
,
$
user
,
$
rspec
)
=
@
_
;
my
($
experiment
,
$
verbose
,
$
user
,
$
rspec
)
=
@
_
;
my
%
cm_urns
=
();
my
%
cm_urns
=
();
my
%
nodemap
=
();
Register
($
experiment
,
$
user
)
==
0
Register
($
experiment
,
$
user
)
==
0
or
return
-
1
;
or
return
-
1
;
...
@@ -331,33 +355,39 @@ sub GetTickets($$$$)
...
@@ -331,33 +355,39 @@ sub GetTickets($$$$)
$
ref
->{
'node_type'
}->{
'type_name'
}
eq
"lan"
)
{
$
ref
->{
'node_type'
}->{
'type_name'
}
eq
"lan"
)
{
next
;
next
;
}
}
my
$
virtual_id
=
$
ref
->{
'virtual_id'
};
my
$
node_urn
=
$
ref
->{
'component_urn'
};
my
$
node_urn
=
$
ref
->{
'component_urn'
};
my
($
auth
,$
type
,$
node_id
)
=
GeniHRN
::
Parse
($
node_urn
);
my
($
auth
,$
type
,$
node_id
)
=
GeniHRN
::
Parse
($
node_urn
);
my
$
cm
=
GeniHRN
::
Generate
($
auth
,
"authority"
,
"cm"
);
my
$
cm
=
GeniHRN
::
Generate
($
auth
,
"authority"
,
"cm"
);
$
cm_urns
{$
cm
}
=
$
cm
;
#
#
#
This
is
how
we
get
the
client
side
to
do
cooked
mode
properly
.
#
Get
the
resource
objects
for
below
.
#
#
$
ref
->{
'tarfiles'
}
=
"/usr/local/etc/emulab "
.
if
(
!exists($cm_urns{$cm})) {
"$TBDOCBASE/downloads/geniclient.tar"
;
my
$
resource
=
GeniResource
->
Lookup
($
experiment
->
idx
(),
$
cm
);
}
#
#
Get
the
resource
objects
.
#
foreach
my
$
cm
(
keys
(%
cm_urns
))
{
my
$
resource
=
GeniResource
->
Lookup
($
experiment
->
idx
(),
$
cm
);
if
(
!defined($resource)) {
$
resource
=
GeniResource
->
Create
($
experiment
,
$
cm
);
if
(
!defined($resource)) {
if
(
!defined($resource)) {
print
STDERR
"Could not
create
GeniResource for $cm
\n
"
;
print
STDERR
"Could not
get
GeniResource for $cm
\n
"
;
return
-
1
;
return
-
1
;
}
}
$
nodemap
{$
virtual_id
}
=
$
resource
;
#
#
We
got
the
ticket
on
a
previous
loop
.
#
next
if
($
resource
->
HaveTicket
());
$
cm_urns
{$
cm
}
=
$
resource
;
}
}
$
cm_urns
{$
cm
}
=
$
resource
;
#
#
This
is
how
we
get
the
client
side
to
do
cooked
mode
properly
.
#
$
ref
->{
'tarfiles'
}
=
"/usr/local/etc/emulab "
.
"$TBDOCBASE/downloads/geniclient.tar"
;
}
}
#
No
tickets
needed
,
return
now
.
return
0
if
(
! scalar(keys(%cm_urns)));
#
#
#
XXX
Convert
to
a
proper
XML
looking
thing
.
This
is
just
a
temporay
#
XXX
Convert
to
a
proper
XML
looking
thing
.
This
is
just
a
temporay
...
@@ -390,6 +420,9 @@ sub GetTickets($$$$)
...
@@ -390,6 +420,9 @@ sub GetTickets($$$$)
$
resource
->
last_rpc_value
())
{
$
resource
->
last_rpc_value
())
{
print
STDERR
$
resource
->
last_rpc_value
()
.
"
\n
"
;
print
STDERR
$
resource
->
last_rpc_value
()
.
"
\n
"
;
}
}
#
Return
indicator
of
possible
forward
progress
.
return
1
if
($
resource
->
last_rpc_output
()
=~
/
Could
not
map
to
/
i
);
return
-
1
;
return
-
1
;
}
}
return
0
;
return
0
;
...
@@ -409,8 +442,9 @@ sub GetTickets($$$$)
...
@@ -409,8 +442,9 @@ sub GetTickets($$$$)
#
#
#
Check
the
exit
codes
.
Eventually
return
specific
error
info
.
#
Check
the
exit
codes
.
Eventually
return
specific
error
info
.
#
#
my
$
errors
=
0
;
my
$
errors
=
0
;
my
$
count
=
0
;
my
$
count
=
0
;
my
$
progress
=
0
;
foreach
my
$
result
(@
results
)
{
foreach
my
$
result
(@
results
)
{
my
$
resource
=
$
resources
[$
count
];
my
$
resource
=
$
resources
[$
count
];
...
@@ -425,11 +459,41 @@ sub GetTickets($$$$)
...
@@ -425,11 +459,41 @@ sub GetTickets($$$$)
elsif
($
result
!= 0) {
elsif
($
result
!= 0) {
print
STDERR
"*** Error getting ticket for $resource
\n
"
;
print
STDERR
"*** Error getting ticket for $resource
\n
"
;
$
errors
++;
$
errors
++;
#
Watch
for
forward
progress
.
Not
being
able
to
map
actually
#
means
forward
progress
since
we
want
to
try
again
with
#
different
resources
.
The
mapper
will
try
a
few
times
before
$
progress
++
if
($
result
>
1
);
}
else
{
$
progress
++;
#
#
Got
a
ticket
;
mark
the
proxy
nodes
so
that
libvtop
knows
.
#
Failure
to
get
a
ticket
means
we
need
to
release
the
node
#
up
in
libvtop
.
Probably
need
a
state
variable
instead
.
#
foreach
my
$
virtual_id
(
keys
(%
nodemap
))
{
next
if
(
!$resource->SameResource($nodemap{$virtual_id}));
my
$
node
=
$
experiment
->
VnameToNode
($
virtual_id
);
if
(
defined
($
node
))
{
$
node
->
ModifyReservation
({
"external_resource_index"
=>
$
resource
->
idx
()})
==
0
or
return
-
1
;