Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
1cfc4a28
Commit
1cfc4a28
authored
May 16, 2005
by
Timothy Stack
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
For robots, reset anything related to physical location
(nodes.destination_x,location_info.loc_x, ...).
parent
6c82bc23
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
db/nfree.in
db/nfree.in
+27
-0
No files found.
db/nfree.in
View file @
1cfc4a28
...
...
@@ -316,6 +316,33 @@ foreach my $n (@freed_nodes) {
# Clean the interface_settings table for this node.
DBQueryWarn
("
delete from interface_settings where node_id='
$n
'
")
||
$error
++
;
# If it's a robot, we need to reset its physical location.
$result
=
DBQueryFatal
("
select building,floor,loc_x,loc_y,orientation
"
.
"
from node_startloc where node_id='
$n
'
");
if
(
$result
->
num_rows
())
{
while
(
my
(
$bldg
,
$floor
,
$x
,
$y
,
$o
)
=
$result
->
fetchrow_array
())
{
my
$subresult
=
DBQueryFatal
("
select pixels_per_meter from floorimages
"
.
"
where building='
$bldg
'
");
if
(
$subresult
->
num_rows
())
{
my
(
$pixels_per_meter
)
=
$subresult
->
fetchrow_array
();
$x
=
int
(
$x
*
$pixels_per_meter
);
$y
=
int
(
$y
*
$pixels_per_meter
);
DBQueryWarn
("
update location_info set
"
.
"
loc_x=
$x
,loc_y=
$y
,orientation=
$o
"
.
"
where node_id='
$n
' and building='
$bldg
'
"
.
"
and floor=
$floor
")
||
$error
++
;
}
else
{
warn
"
No building named
$bldg
in floorimages
";
}
}
}
DBQueryWarn
("
update nodes set destination_x=NULL,destination_y=NULL,
"
.
"
destination_orientation=NULL where node_id='
$n
'
")
||
$error
++
;
# Now its safe to change the reservation.
# If the node has a next_reserve entry, change the reservation.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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