-Change xen console and backend plugin relationship to use a specific command

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2014 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2008-08-12 17:15:48 +00:00
parent 6239f76d54
commit aa07dbc4e5
2 changed files with 18 additions and 10 deletions

View File

@ -44,7 +44,7 @@ sub handled_commands {
return {
rpower => 'nodehm:power,mgt',
rmigrate => 'nodehm:mgt',
getvmcons => 'nodehm:mgt',
getxencons => 'nodehm:mgt',
#rvitals => 'nodehm:mgt',
#rinv => 'nodehm:mgt',
rbeacon => 'nodehm:mgt',
@ -191,7 +191,11 @@ sub getvmcons {
if ($hmhash) {
$serialspeed=$hmhash->{$node}->[0]->{serialspeed};
}
return (0,'tty@'.$hyper.": ".$consdata->{textconsole}."@".$serialspeed);
my $sconsparms = {node=>[{name=>[$node]}]};
$sconsparms->{node}->[0]->{sshhost}=[$hyper];
$sconsparms->{node}->[0]->{psuedotty}=[$consdata->{textconsole}];
$sconsparms->{node}->[0]->{baudrate}=[$serialspeed];
return (0,$sconsparms);
} elsif ($type eq "vnc") {
return (0,'ssh+vnc@'.$hyper.": ".$consdata->{vncport});
}
@ -303,7 +307,7 @@ sub guestcmd {
return power(@args);
} elsif ($command eq "rmigrate") {
return migrate($node,@args);
} elsif ($command eq "getvmcons") {
} elsif ($command eq "getxencons") {
return getvmcons($node,@args);
}
=cut
@ -559,6 +563,13 @@ sub dohyp {
foreach(@output) {
my %output;
if (ref($_)) {
print $out freeze([$_]);
print $out "\nENDOFFREEZE6sK4ci\n";
yield();
waitforack($out);
next;
}
(my $desc,my $text) = split (/:/,$_,2);
unless ($text) {

View File

@ -17,7 +17,7 @@ import File::Basename;
my $scriptname = $0;
my $cmdref={
command=>"getvmcons",
command=>"getxencons",
arg=>"text",
noderange=>$ARGV[0]
};
@ -28,12 +28,9 @@ my $speed;
sub getans {
my $rsp = shift;
if ($rsp->{node}) {
$dsthost = $rsp->{node}->[0]->{data}->[0]->{desc}->[0];
$dsthost=~s/.*@//;
$dstty = $rsp->{node}->[0]->{data}->[0]->{contents}->[0];
$speed=$dstty;
$dstty =~ s/@.*$//;
$speed =~ s/^.*@//;
$dsthost = $rsp->{node}->[0]->{sshhost}->[0];
$dstty = $rsp->{node}->[0]->{psuedotty}->[0];
$speed = $rsp->{node}->[0]->{baudrate}->[0];
}
}
xCAT::Client::submit_request($cmdref,\&getans);