Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
1517a803
Commit
1517a803
authored
Jan 25, 2006
by
Robert Ricci
Browse files
When reverting, fix the case of links whose endpoints are unassigned
vnodes.
parent
02e338d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
assign/anneal.cc
View file @
1517a803
...
...
@@ -1232,6 +1232,8 @@ NOTQUITEDONE:
tie
(
vedge_it
,
end_vedge_it
)
=
edges
(
VG
);
for
(;
vedge_it
!=
end_vedge_it
;
++
vedge_it
)
{
tb_vlink
*
vlink
=
get
(
vedge_pmap
,
*
vedge_it
);
tb_vnode
*
src_vnode
=
get
(
vvertex_pmap
,
vlink
->
src
);
tb_vnode
*
dst_vnode
=
get
(
vvertex_pmap
,
vlink
->
dst
);
if
(
best_solution
.
link_is_assigned
(
*
vedge_it
))
{
// XXX: It's crappy that I have to do all this work here - something
// needs re-organzing
...
...
@@ -1240,8 +1242,6 @@ NOTQUITEDONE:
*/
vlink
->
link_info
=
best_solution
.
get_link_assignment
(
*
vedge_it
);
tb_vnode
*
src_vnode
=
get
(
vvertex_pmap
,
vlink
->
src
);
tb_vnode
*
dst_vnode
=
get
(
vvertex_pmap
,
vlink
->
dst
);
if
(
!
dst_vnode
->
assigned
||
!
src_vnode
->
assigned
)
{
// This shouldn't happen, but don't try to score links which
// don't have both endpoints assigned.
...
...
@@ -1261,7 +1261,16 @@ NOTQUITEDONE:
*/
score_link_info
(
*
vedge_it
,
src_pnode
,
dst_pnode
,
src_vnode
,
dst_vnode
);
}
else
{
mark_vlink_unassigned
(
vlink
);
/*
* If one endpoint or the other was unmapped, we just note that
* the link wasn't mapped - however, if both endpoints were
* mapped, then we have to make sure the score reflects that.
*/
if
(
!
dst_vnode
->
assigned
||
!
src_vnode
->
assigned
)
{
vlink
->
link_info
.
type_used
=
tb_link_info
::
LINK_UNMAPPED
;
}
else
{
mark_vlink_unassigned
(
vlink
);
}
}
}
}
// End of reverting code
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment