diff --git a/sql/database-create.sql b/sql/database-create.sql index 364d59d5b28381bcc74ee897e0698fc9b94891d8..99a7720a3ee498760fc09c83872f40e0e8bc8c28 100644 --- a/sql/database-create.sql +++ b/sql/database-create.sql @@ -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', diff --git a/sql/updates/4/356 b/sql/updates/4/356 new file mode 100644 index 0000000000000000000000000000000000000000..e374d65c4626527d892ae857733ca6edd12c4c2b --- /dev/null +++ b/sql/updates/4/356 @@ -0,0 +1,21 @@ +# +# 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: diff --git a/tbsetup/libvtop_test.pm.in b/tbsetup/libvtop_test.pm.in index 6f29e9509953679cacbc36c5a661103529efacef..9e6c977864049ca56ab365ee26a8e6a13a9462a8 100755 --- a/tbsetup/libvtop_test.pm.in +++ b/tbsetup/libvtop_test.pm.in @@ -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; diff --git a/tbsetup/ns2ir/blockstore.tcl b/tbsetup/ns2ir/blockstore.tcl index c3433a035c5687bf55ed45a30cdebcb0ebe35dd0..5924e93978bbdf2998158d0700f3e7061103884e 100644 --- a/tbsetup/ns2ir/blockstore.tcl +++ b/tbsetup/ns2ir/blockstore.tcl @@ -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} { diff --git a/tbsetup/ns2ir/sim.tcl.in b/tbsetup/ns2ir/sim.tcl.in index b2026fcac649fbe713de418100cedf3e4bc5ffda..ffcc6999e4ba7882d3b74265dbd39cae9bb03f71 100644 --- a/tbsetup/ns2ir/sim.tcl.in +++ b/tbsetup/ns2ir/sim.tcl.in @@ -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}