enhancement of syspowerinterval for powering on CECs within one frame. If there is just a sleep , it will be interrupted bye the child's signal. So enhance it

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11321 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jjhua 2011-12-30 09:04:04 +00:00
parent 3db2c1817b
commit 7baa523b9c

View File

@ -452,7 +452,7 @@ sub process_command {
#print Dumper($one_d);
if($$one_d[4] =~ /^fsp$/ || $$one_d[4] =~ /^cec$/) {
if( $request->{syspowerinterval} > 0) {
Time::HiRes::sleep($request->{syspowerinterval});
no_interrupt_sleep($request->{syspowerinterval});
}
}
}
@ -575,6 +575,16 @@ ENDOFFORK:
return(0);
}
sub no_interrupt_sleep {
my $sleep_time = shift;
my $sleep_end = time + $sleep_time;
while (1) {
my $sleep_duration = $sleep_end - time;
last if $sleep_duration <= 0;
Time::HiRes::sleep($sleep_duration);
}
}
sub kill_children_by_pid {
my $pid = shift;
my @pids = `ps -o pid,ppid -e`;
@ -1347,7 +1357,7 @@ sub handle_find_hw_children {
if (!defined($mtms)) {
return undef;
}
my @nodearray = $vpdtab->getAttribs({serial=>$mtms->{serial}, mtm=>$mtms->{mtm}}, qw(node side));
my @nodearray = $vpdtab->getAttribs({serial=>$mtms->{serial}, mtm=>$mtms->{mtm}}, qw(node side)); # need regx
if (!defined(@nodearray)) {
return undef;
}