Commit 0618a739 authored by Robert Ricci's avatar Robert Ricci

Fix up reporting for desires that have no matching features - I had

borken the code that helps assign figure out which desire was not
matched.

Also remove some old dead code while I'm in here.
parent 204b9b31
...@@ -457,20 +457,7 @@ int mapping_precheck() { ...@@ -457,20 +457,7 @@ int mapping_precheck() {
bool potential_match = true; bool potential_match = true;
// Grab the first node of the pclass as a representative sample // Grab the first node of the pclass as a representative sample
tb_pnode *pnode = *((*it)->members[this_type]->L.begin()); tb_pnode *pnode = *((*it)->members[this_type]->L.begin());
#if 0
// Check the number of interfaces - if the pnode is a switch,
// for now, we don't check this, since it can end up with more
// 'interfaces' due to the fact that it can have interswitch
// links
if ((pnode->total_interfaces >= v->num_links) ||
(!pnode->current_type.compare("switch"))) {
matched_links++;
} else {
potential_match = false;
}
#endif
// Check to see if any of the link that this pnode has are of // Check to see if any of the link that this pnode has are of
// the correct type for the virtual node // the correct type for the virtual node
...@@ -497,7 +484,6 @@ int mapping_precheck() { ...@@ -497,7 +484,6 @@ int mapping_precheck() {
/* /*
* Check features and desires * Check features and desires
*/ */
tb_featuredesire_set_iterator tb_featuredesire_set_iterator
fdit(v->desires.begin(),v->desires.end(), fdit(v->desires.begin(),v->desires.end(),
pnode->features.begin(),pnode->features.end()); pnode->features.begin(),pnode->features.end());
...@@ -509,22 +495,26 @@ int mapping_precheck() { ...@@ -509,22 +495,26 @@ int mapping_precheck() {
// Only check for FDs that would result in a violation if // Only check for FDs that would result in a violation if
// unmatched. // unmatched.
if (fdit.either_violateable()) { if (fdit.either_violateable()) {
if (fdit.membership() !=
tb_featuredesire_set_iterator::BOTH) {
potential_match = false;
}
// We look for violateable desires on vnodes so that we // We look for violateable desires on vnodes so that we
// can report them to the user // can report them to the user
if (fdit.membership() == if ((fdit.membership() ==
tb_featuredesire_set_iterator::BOTH && tb_featuredesire_set_iterator::FIRST_ONLY ||
fdit.membership() == fdit.membership() ==
tb_featuredesire_set_iterator::FIRST_ONLY && tb_featuredesire_set_iterator::BOTH)
fdit.first_iterator()->is_violateable() && && fdit.first_iterator()->is_violateable()) {
matched_desires.find(fdit->name()) if (matched_desires.find(fdit->name()) ==
== matched_desires.end()) { matched_desires.end()) {
matched_desires[fdit->name()] = 0; matched_desires[fdit->name()] = 0;
}
} }
if (fdit.membership() == if (fdit.membership() ==
tb_featuredesire_set_iterator::BOTH) { tb_featuredesire_set_iterator::BOTH) {
matched_desires[fdit->name()]++; matched_desires[fdit->name()]++;
} else {
potential_match = false;
} }
} }
} }
......
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