Skip to content
GitLab
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
f72e7bc6
Commit
f72e7bc6
authored
Nov 15, 2012
by
Jonathon Duerig
Browse files
Include openvz images when advertising the emulab-openvz sliver_type.
parent
8666fcfc
Changes
1
Hide whitespace changes
Inline
Side-by-side
tbsetup/ptopgen.in
View file @
f72e7bc6
...
...
@@ -615,6 +615,8 @@ our %node_countries;
our
%node_latitudes
;
our
%node_longitudes
;
our
$openvzid
;
$result
=
DBQueryFatal
(
$osidquery
);
processOs
(
$result
);
...
...
@@ -626,6 +628,9 @@ sub processOs
my
$result
=
shift
(
@
_
);
while
(
my
(
$osid
,
$type
,
$osname
,
$ospid
,
$osos
,
$osversion
,
$osdescription
,
$geni
,
$osfeatures
)
=
$result
->
fetchrow
())
{
if
(
$osname
eq
"
OPENVZ-STD
")
{
$openvzid
=
$osid
;
}
if
(
$typemap
{
$type
})
{
my
$default
=
$typemap
{
$type
}
->
{'
OSID
'};
if
(
$geni
eq
1
||
...
...
@@ -673,9 +678,12 @@ while (my ($subosid,$osid) = $result->fetchrow()) {
# We also have to resolve the 'generic' OSIDs, which use the nextosid field to
# redirect to another OSID
#
$result
=
DBQueryFatal
("
select osid from os_info where
"
.
$result
=
DBQueryFatal
("
select osid
,nextosid
from os_info where
"
.
"
nextosid is not null
");
while
(
my
(
$osid
)
=
$result
->
fetchrow
())
{
while
(
my
(
$osid
,
$nextosid
)
=
$result
->
fetchrow
())
{
if
(
defined
(
$openvzid
)
&&
$osid
==
$openvzid
)
{
$openvzid
=
$nextosid
;
}
#
# Check to see if they were allowed to use the real OSID
#
...
...
@@ -2081,7 +2089,7 @@ sub print_node
}
print
"
>
\n
";
if
(
defined
(
$mainType
)
&&
$genimode
eq
$V_0_2
)
{
print_osids
(
$mainType
);
print_
raw_
osids
(
$mainType
);
}
print_node_types
(
$mainType
,
@$types
);
my
$avail
=
"
false
";
...
...
@@ -2156,24 +2164,32 @@ sub add_stitch_point
}
}
sub
print_raw_osids
{
my
(
$type
)
=
@_
;
print_osids
(
$typemap
{
$type
}
->
{'
OSLIST
'},
$typemap
{
$type
}
->
{'
OSID
'});
}
# Print osids
sub
print_osids
{
my
(
$type
)
=
@_
;
my
@osids
=
@
{
$typemap
{
$type
}
->
{'
OSLIST
'}
};
my
$default
=
$typemap
{
$type
}
->
{'
OSID
'};
foreach
$os
(
@osids
)
{
my
$urn
=
GeniHRN::
Generate
(
$OURDOMAIN
,
"
image
",
$osid_pid
{
$os
}
.
"
//
"
.
$osid_name
{
$os
});
print
"
<disk_image
";
print
"
name=
\"
"
.
$urn
.
"
\"
";
print
"
os=
\"
"
.
$osid_os
{
$os
}
.
"
\"
";
print
"
version=
\"
"
.
$osid_version
{
$os
}
.
"
\"
";
print
"
description=
\"
"
.
$osid_description
{
$os
}
.
"
\"
";
if
(
$os
eq
$default
)
{
print
"
default=
\"
true
\"
";
my
(
$osids_arg
,
$default
)
=
@_
;
my
@osids
=
@
{
$osids_arg
};
foreach
my
$os
(
@osids
)
{
if
(
defined
(
$osid_name
{
$os
}))
{
my
$urn
=
GeniHRN::
Generate
(
$OURDOMAIN
,
"
image
",
$osid_pid
{
$os
}
.
"
//
"
.
$osid_name
{
$os
});
print
"
<disk_image
";
print
"
name=
\"
"
.
$urn
.
"
\"
";
print
"
os=
\"
"
.
$osid_os
{
$os
}
.
"
\"
";
print
"
version=
\"
"
.
$osid_version
{
$os
}
.
"
\"
";
print
"
description=
\"
"
.
$osid_description
{
$os
}
.
"
\"
";
if
(
defined
(
$default
)
&&
$os
eq
$default
)
{
print
"
default=
\"
true
\"
";
}
print
"
/>
\n
";
}
print
"
/>
\n
";
}
}
...
...
@@ -2233,12 +2249,16 @@ sub print_node_types
if
(
$name
eq
"
pc
"
||
$name
eq
"
pcRemote
")
{
print
"
<sliver_type name=
\"
raw-pc
\"
>
\n
";
if
(
defined
(
$mainType
))
{
print_osids
(
$mainType
);
print_
raw_
osids
(
$mainType
);
}
print
"
</sliver_type>
\n
";
}
if
(
$name
eq
"
pcvm
")
{
print
"
<sliver_type name=
\"
emulab-openvz
\"
/>
\n
";
print
"
<sliver_type name=
\"
emulab-openvz
\"
>
\n
";
if
(
defined
(
$openvzid
))
{
print_osids
(
$osid_subosids
{
$openvzid
},
undef
);
}
print
"
</sliver_type>
\n
";
}
print
"
<hardware_type name=
\"
$name
\"
>
\n
";
if
(
$count
eq
"
*
")
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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