virt-manager

changeset 1964:80756615a211

console: add spice password support
author Marc-André Lureau <marcandre.lureau@redhat.com>
date Fri Jan 07 15:14:33 2011 +0100 (2011-01-07)
parents ce7563f06a06
children adf773626633
files src/virtManager/console.py src/virtManager/details.py
line diff
     1.1 --- a/src/virtManager/console.py	Mon Feb 28 21:22:48 2011 -0500
     1.2 +++ b/src/virtManager/console.py	Fri Jan 07 15:14:33 2011 +0100
     1.3 @@ -404,6 +404,8 @@
     1.4      def _main_channel_event_cb(self, channel, event):
     1.5          if event == spice.CHANNEL_CLOSED:
     1.6              self.console.disconnected()
     1.7 +        elif event == spice.CHANNEL_ERROR_AUTH:
     1.8 +            self.console.activate_auth_page()
     1.9  
    1.10      def _channel_open_fd_request(self, channel, tls_ignore):
    1.11          if not self.console.tunnels:
    1.12 @@ -459,6 +461,11 @@
    1.13  
    1.14      def set_credential_password(self, cred):
    1.15          self.spice_session.set_property("password", cred)
    1.16 +        if self.console.tunnels:
    1.17 +            fd = self.console.tunnels.open_new()
    1.18 +            self.spice_session.open_fd(fd)
    1.19 +        else:
    1.20 +            self.spice_session.connect()
    1.21  
    1.22      def get_scaling(self):
    1.23          return self.display.get_property("resize-guest")
     2.1 --- a/src/virtManager/details.py	Mon Feb 28 21:22:48 2011 -0500
     2.2 +++ b/src/virtManager/details.py	Fri Jan 07 15:14:33 2011 +0100
     2.3 @@ -2257,17 +2257,15 @@
     2.4              port  = port_to_string(gfx.port)
     2.5              address = (gfx.listen or "127.0.0.1")
     2.6              keymap  = (gfx.keymap or None)
     2.7 -
     2.8 +            passwd  = gfx.passwd or ""
     2.9 +
    2.10 +            show_text("password", passwd)
    2.11              show_text("port", port)
    2.12              show_text("address", address)
    2.13  
    2.14              show_row("keymap", "-box")
    2.15              self.set_combo_label("gfx-keymap", 0, keymap)
    2.16  
    2.17 -        if is_vnc:
    2.18 -            passwd  = gfx.passwd or ""
    2.19 -            show_text("password", passwd)
    2.20 -
    2.21          if is_spice:
    2.22              tlsport = port_to_string(gfx.tlsPort)
    2.23              show_text("tlsport", tlsport)