Commit 8145ccff authored by Kirk Webb's avatar Kirk Webb

Merge remote-tracking branch 'central/master' into win7devel

parents 78aa8531 02283879
......@@ -520,7 +520,7 @@ if (! -e "$VNDIR/vnode.info") {
#
$vmtype = GENVNODETYPE();
($ret,$err) = safeLibOp('vnodeCreate',0,0);
($ret,$err) = safeLibOp('vnodeCreate',0,0, \%vnconfig);
if ($err) {
MyFatal("vnodeCreate failed");
}
......
......@@ -2904,7 +2904,7 @@ CREATE TABLE `os_info` (
`path` tinytext,
`magic` tinytext,
`machinetype` varchar(30) NOT NULL default '',
`osfeatures` set('ping','ssh','ipod','isup','veths','veth-ne','veth-en','mlinks','linktest','linkdelays','vlans','suboses','ontrustedboot') default NULL,
`osfeatures` set('ping','ssh','ipod','isup','veths','veth-ne','veth-en','mlinks','linktest','linkdelays','vlans','suboses','ontrustedboot','no-usb-boot') default NULL,
`ezid` tinyint(4) NOT NULL default '0',
`shared` tinyint(4) NOT NULL default '0',
`mustclean` tinyint(4) NOT NULL default '1',
......
#
# Add no-usb-boot as a possible osfeature.
#
use strict;
use libdb;
my $impotent = 0;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
DBQueryFatal("alter table os_info modify ".
" `osfeatures` set('ping','ssh','ipod','isup','veths','veth-ne','veth-en','mlinks','linktest','linkdelays','vlans','suboses','ontrustedboot','no-usb-boot') default NULL");
return 0;
}
1;
......@@ -411,6 +411,15 @@ while (my ($class,$type,$isvirt) = $result->fetchrow_array) {
$permissions{$type} = 1;
}
# Figure out which nodes will use a USB dongle to boot. As a proxy, we
# look for the pxe_boot_path pointing to the tpm version of grub.
our %node_usb;
$result = DBQueryFatal("select node_id from node_attributes where attrkey='pxe_boot_path' and attrvalue='/tftpboot/pxeboot_tpm'");
while (($node) = $result->fetchrow_array) {
$node_usb{$node} = 1;
}
# Read node_startloc
$result = DBQueryFatal("select node_id,building from node_startloc");
while (($node,$building) = $result->fetchrow_array) {
......@@ -490,7 +499,7 @@ if (defined($pid)) {
# 1) To avoid an explosion in the number of features for nodes
# 2) To avoid information leaks, allowing projects to see each other's images
#
my $osidquery = "select distinct o.osid, oi.type, o.osname, o.pid, o.OS, o.version, o.description,o.protogeni_export from os_info as o " .
my $osidquery = "select distinct o.osid, oi.type, o.osname, o.pid, o.OS, o.version, o.description,o.protogeni_export, o.osfeatures from os_info as o " .
"left join osidtoimageid as oi on o.osid = oi.osid " .
"left join images as i on oi.imageid = i.imageid ";
if ($pid) {
......@@ -503,7 +512,7 @@ if ($pid) {
" or (g.pid is not null and g.pid='$pid')";
}
my $defaultosidquery = 'select distinct o.osid, t.type, o.osname, o.pid, o.OS, o.version, o.description, o.protogeni_export '.
my $defaultosidquery = 'select distinct o.osid, t.type, o.osname, o.pid, o.OS, o.version, o.description, o.protogeni_export, o.osfeatures '.
'from os_info as o left join node_type_attributes as t '.
'on (o.osid=t.attrvalue) where t.attrkey="default_osid"';
......@@ -534,6 +543,7 @@ our %osid_pid;
our %osid_os;
our %osid_version;
our %osid_description;
our %osid_avoid_usb;
our %node_countries;
our %node_latitudes;
our %node_longitudes;
......@@ -547,8 +557,8 @@ processOs($result);
sub processOs
{
my $result = shift(@_);
while (my ($osid,$type,$osname,$ospid,$osos,
$osversion,$osdescription,$geni) = $result->fetchrow()) {
while (my ($osid,$type,$osname,$ospid,$osos, $osversion,
$osdescription,$geni,$osfeatures) = $result->fetchrow()) {
if ($typemap{$type}) {
my $default = $typemap{$type}->{'OSID'};
if ($geni eq 1 ||
......@@ -566,6 +576,9 @@ sub processOs
} else {
$node_type_osids{$type} = [$osid];
}
if (defined($osfeatures) && $osfeatures =~ /no-usb-boot/) {
$osid_avoid_usb{$osid} = 1;
}
#
# We have to maintain a data structure telling us which types an OSID could
# be on for use below with generic OSIDs
......@@ -1074,9 +1087,11 @@ foreach $node (@nodenames) {
# evidenced by its type) can support
#
foreach my $o1 (@{$node_type_osids{$type}}) {
push @features, "OS-$o1:0";
foreach my $o2 (@{$osid_subosids{$o1}}) {
push @features, "OS-$o1-$o2:0";
if (! exists($node_usb{$node}) || ! exists($osid_avoid_usb{$o1})) {
push @features, "OS-$o1:0";
foreach my $o2 (@{$osid_subosids{$o1}}) {
push @features, "OS-$o1-$o2:0";
}
}
}
}
......
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