Skip to content
GitLab
Menu
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
fd8d1b13
Commit
fd8d1b13
authored
Mar 25, 2010
by
Leigh B Stoller
Browse files
Add IsOSLoaded() to determine if osinfo loaded. This moves the
partition table lookups here. Used by os_setup, etc.
parent
26495534
Changes
1
Hide whitespace changes
Inline
Side-by-side
db/Node.pm.in
View file @
fd8d1b13
...
...
@@ -2478,5 +2478,32 @@ sub LookupWideArea($$)
return Node->Lookup($node_id);
}
#
# Return the partition that an OSID is loaded on.
#
sub IsOSLoaded($$)
{
my ($self, $osinfo) = @_;
if (!ref($osinfo)) {
my $tmp = OSinfo->Lookup($osinfo);
if (!defined($tmp)) {
print STDERR "Cannot lookup osinfo for $osinfo\n";
return -1;
}
$osinfo = $tmp;
}
my $osid = $osinfo->osid();
my $nodeid = $self->node_id();
my $query_result =
DBQueryWarn("select osid from partitions as p ".
"where p.node_id='
$
nodeid
' and p.osid='
$
osid
'");
return -1
if (!$query_result);
return $query_result->numrows;
}
# _Always_ make sure that this 1 is at the end of the file...
1;
Write
Preview
Supports
Markdown
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