Commit d3622fe8 authored by Kirk Webb's avatar Kirk Webb

Schema update for new blockstore OS features.

parent f25e9de1
......@@ -3050,7 +3050,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','no-usb-boot','egre') default NULL,
`osfeatures` set('ping','ssh','ipod','isup','veths','veth-ne','veth-en','mlinks','linktest','linkdelays','vlans','suboses','ontrustedboot','no-usb-boot','egre','loc-bstore','rem-bstore') default NULL,
`ezid` tinyint(4) NOT NULL default '0',
`shared` tinyint(4) NOT NULL default '0',
`mustclean` tinyint(4) NOT NULL default '1',
......
#
# Add remote and local blockstore os features.
#
use strict;
use libdb;
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','egre','loc-bstore','rem-bstore') default NULL");
return 0;
}
1;
# Local Variables:
# mode:perl
# End:
......@@ -2715,7 +2715,7 @@ sub GenVirtLans($)
# The OS on all nodes in a lan containing remote blockstores
# (sanlan) must support the "rem-bstore" OS feature.
if ($sanlan && $nodesdo{'rem-bstore'} != $realnodes) {
if ($sanlan && $nodesdo{"rem-bstore"} != $realnodes) {
tberror("The OS on all nodes in sanlan $vname must support ".
"remote blockstores.\n");
return -1;
......
......@@ -183,13 +183,7 @@ Blockstore instproc set_fixed {pnode} {
perror "Can only fix blockstores to a node object!"
}
# Deal with some syntactic sugar for 1-to-1 bindings to nodes.
if {[$pnode set type] != "blockstore" && $attributes(class) == "SAN"} {
set node [$self alloc_pseudonode]
uplevel "#0" "set ${self}-link [$sim duplex-link $pnode $node ~ 0ms DropTail]"
} else {
set node $pnode
}
set node $pnode
return
}
......@@ -257,6 +251,13 @@ Blockstore instproc finalize {} {
perror "Placement setting only makes sense with local blockstores: $self"
return -1
}
# Deal with some syntactic sugar for 1-to-1 bindings to nodes.
if {[$node set type] != "blockstore"} {
set pnode $node
set node [$self alloc_pseudonode]
uplevel "#0" "set ${self}-link [$sim duplex-link $pnode $node ~ 0ms DropTail]"
}
${self}-link set sanlan 1
# Die if the user has attempted to connect the blockstore via multiple
# links. We only support one.
if {[llength [$node set portlist]] != 1} {
......
......@@ -559,6 +559,14 @@ Simulator instproc run {} {
uplevel 1 real_source "@prefix@/lib/ns2ir/fw.ns"
}
# Finalize the blockstore objects - last minute initialization and checks
# before they are spit out to the db.
foreach bstore [array names blockstore_list] {
if {[$bstore finalize] != 0} {
break
}
}
# Fill out IPs
if {! $use_ipassign } {
foreach obj [concat [array names lanlink_list]] {
......@@ -605,14 +613,6 @@ Simulator instproc run {} {
}
}
# Finalize the blockstore objects - last minute initialization and checks
# before they are spit out to the db.
foreach bstore [array names blockstore_list] {
if {[$bstore finalize] != 0} {
break
}
}
# If any errors occur stop here.
if {$errors == 1} {return}
......
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