diff --git a/xCAT-server/lib/xcat/plugins/xen.pm b/xCAT-server/lib/xcat/plugins/xen.pm index f284d5578..e16fbf320 100644 --- a/xCAT-server/lib/xcat/plugins/xen.pm +++ b/xCAT-server/lib/xcat/plugins/xen.pm @@ -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) { diff --git a/xCAT-server/share/xcat/cons/xen b/xCAT-server/share/xcat/cons/xen index d6d17a670..7b8d7db74 100755 --- a/xCAT-server/share/xcat/cons/xen +++ b/xCAT-server/share/xcat/cons/xen @@ -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);