Revision 637ce7f9 lib/hypervisor/hv_kvm.py

b/lib/hypervisor/hv_kvm.py
576 576

  
577 577
    return result
578 578

  
579
  @staticmethod
580
  def GetShellCommandForConsole(instance):
579
  @classmethod
580
  def GetShellCommandForConsole(cls, instance):
581 581
    """Return a command for connecting to the console of an instance.
582 582

  
583 583
    """
584
    # TODO: we can either try the serial socket or suggest vnc
585
    return "echo Console not available for the kvm hypervisor yet"
584
    # FIXME: The socat shell is not perfect. In particular the way we start
585
    # it ctrl+c will close it, rather than being passed to the other end.
586
    # On the other hand if we pass the option 'raw' (or ignbrk=1) there
587
    # will be no way of exiting socat (except killing it from another shell)
588
    # and ctrl+c doesn't work anyway, printing ^C rather than being
589
    # interpreted by kvm. For now we'll leave it this way, which at least
590
    # allows a minimal interaction and changes on the machine.
591
    socat_shell = ("%s STDIO,echo=0,icanon=0 UNIX-CONNECT:%s" %
592
                   (constants.SOCAT_PATH,
593
                    utils.ShellQuote(cls._InstanceSerial(instance.name))))
594

  
595
    return socat_shell
586 596

  
587 597
  def Verify(self):
588 598
    """Verify the hypervisor.

Also available in: Unified diff