Revision 637ce7f9
b/lib/hypervisor/hv_base.py | ||
---|---|---|
84 | 84 |
""" |
85 | 85 |
raise NotImplementedError |
86 | 86 |
|
87 |
@staticmethod
|
|
88 |
def GetShellCommandForConsole(instance): |
|
87 |
@classmethod
|
|
88 |
def GetShellCommandForConsole(cls, instance):
|
|
89 | 89 |
"""Return a command for connecting to the console of an instance. |
90 | 90 |
|
91 | 91 |
""" |
b/lib/hypervisor/hv_fake.py | ||
---|---|---|
203 | 203 |
|
204 | 204 |
return result |
205 | 205 |
|
206 |
@staticmethod
|
|
207 |
def GetShellCommandForConsole(instance): |
|
206 |
@classmethod
|
|
207 |
def GetShellCommandForConsole(cls, instance):
|
|
208 | 208 |
"""Return a command for connecting to the console of an instance. |
209 | 209 |
|
210 | 210 |
""" |
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. |
b/lib/hypervisor/hv_xen.py | ||
---|---|---|
232 | 232 |
|
233 | 233 |
return result |
234 | 234 |
|
235 |
@staticmethod
|
|
236 |
def GetShellCommandForConsole(instance): |
|
235 |
@classmethod
|
|
236 |
def GetShellCommandForConsole(cls, instance):
|
|
237 | 237 |
"""Return a command for connecting to the console of an instance. |
238 | 238 |
|
239 | 239 |
""" |
Also available in: Unified diff