Commit 0bf62b83 authored by Kirk Webb's avatar Kirk Webb

Move application of TaintStates to libossetup.

This is a more appropriate place for applying/inheriting taint states,
and makes it easy to propagate TaintStates from vnodes to their
corresponding physical hosts (which is now done as well).
parent c2d73cb4
......@@ -483,22 +483,6 @@ sub osload ($$) {
my $osid = $rowref->{$partname};
my $vers = $rowref->{$partvers};
if (defined($osid)) {
# Have the node inherit taint states from each OS
# to be loaded on it (or that is already loaded on
# it). This action is additive, i.e. the node
# will end up with the union of taint states
# across all partition OSes. We also retain any
# taint states the node had previously; it's
# important not to clear these existing states
# until OS loading and disk zeroing have been
# performed.
my $osinfo = OSinfo->Lookup($osid, $vers);
if (defined($osinfo) && $osinfo->IsTainted()) {
$nodeobject->InheritTaintStates($osinfo) == 0 or
warn "Node $node could not inherit taint ".
"states from osid $osid\n";
}
my %part = (
'node_id' => $node,
'partition' => $i,
......
......@@ -2103,22 +2103,6 @@ sub UpdatePartitions($$)
my $osid = $rowref->{$partname};
if (defined($osid)) {
# Have the node inherit taint states from each OS
# to be loaded on it (or that is already loaded on
# it). This action is additive, i.e. the node
# will end up with the union of all taint states
# across the OSes set for each disk partition. We
# also retain any taint states the node had
# previously; it's important not to clear these
# existing states until OS loading and disk
# zeroing have been performed.
my $osinfo = OSinfo->Lookup($osid);
if (defined($osinfo) && $osinfo->IsTainted()) {
$nodeobject->InheritTaintStates($osinfo) == 0 or
warn "Node $node_id could not inherit taint ".
"states from osid $osid\n";
}
my %part = (
'node_id' => $node_id,
'partition' => $i,
......
......@@ -489,6 +489,12 @@ sub SetOSAux($$$$$)
$osinfo = $nextosinfo;
}
#
# Have the node inherit any taint states set for the OS. This
# call retains any taint states the node had set previously.
#
$node->InheritTaintStates($osinfo) == 0
or die_noretry("$node could not inherit taint states from $osinfo");
#
# Make sure this OSID is actually loaded on the machine.
#
my $isloaded = $node->IsOSLoaded($osinfo);
......@@ -1554,6 +1560,15 @@ sub AddNode($$)
$pnode->_vnodecount($pnode->_vnodecount() + 1);
# and stash the pnode in case we need it later.
$node->_pnode($pnode);
# Taint the pnode if this vnode was tainted by its OS
# and is not on a shared host. No user access already on
# the latter.
if (($node->IsTainted(TB_TAINTSTATE_USERONLY) ||
$node->IsTainted(TB_TAINTSTATE_BLACKBOX))
&& !$node->_onsharednode()) {
$pnode->AddTaintState(TB_TAINTSTATE_BLACKBOX) == 0
or warn "Could not add blackbox taint state to vnode host!\n";
}
#
# See if a "reload" is required; some virtual nodes can get
......
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