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
9e7294d9
Commit
9e7294d9
authored
Jun 03, 2008
by
Leigh B. Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add set/get allocstate.
parent
f7c59397
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
db/Node.pm.in
db/Node.pm.in
+41
-0
No files found.
db/Node.pm.in
View file @
9e7294d9
...
...
@@ -410,6 +410,47 @@ sub AllocCheck($$)
return $self->NodeAllocCheck($pid);
}
#
# Set alloc state for a node.
#
sub SetAllocState($$)
{
my ($self, $state) = @_;
return -1
if (! (ref($self)));
my $now = time();
my $node_id = $self->node_id();
DBQueryWarn("update nodes set allocstate='
$
state
', " .
" allocstate_timestamp=$now where node_id='
$
node_id
'")
or return -1;
return Refresh($self);
}
#
# Get alloc state for a node.
#
sub GetAllocState($$)
{
my ($self, $pref) = @_;
return -1
if (! (ref($self) && ref($pref)));
my $allocstate = $self->allocstate();
if (defined($allocstate)) {
$$pref = $allocstate;
}
else {
$$pref = TBDB_ALLOCSTATE_UNKNOWN;
}
return 0;
}
#
# Equality test for two experiments.
# Not strictly necessary in perl, but good form.
...
...
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