[virt-tools-list] [PATCH 1 of 2] console: add spice password support

Marc-André Lureau marcandre.lureau at redhat.com
Fri Jan 7 19:53:12 UTC 2011


# HG changeset patch
# User Marc-André Lureau <marcandre.lureau at redhat.com>
# Date 1294409673 -3600
# Node ID 34ba155f908fd3fa666935fdd4a0e931c53b963b
# Parent  5dd7342a65b1a2e11a9e4003062664f8e8d15309
console: add spice password support

diff -r 5dd7342a65b1 -r 34ba155f908f src/virtManager/console.py
--- a/src/virtManager/console.py	Wed Dec 22 02:13:25 2010 +0100
+++ b/src/virtManager/console.py	Fri Jan 07 15:14:33 2011 +0100
@@ -368,6 +368,8 @@
     def _main_channel_event_cb(self, channel, event):
         if event == spice.CHANNEL_CLOSED:
             self.console.disconnected()
+        elif event == spice.CHANNEL_ERROR_AUTH:
+            self.console.activate_auth_page()
 
     def _channel_open_fd_request(self, channel, tls_ignore):
         if not self.console.tunnels:
@@ -417,6 +419,11 @@
 
     def set_credential_password(self, cred):
         self.spice_session.set_property("password", cred)
+        if self.console.tunnels:
+            fd = self.console.tunnels.open_new()
+            self.spice_session.open_fd(fd)
+        else:
+            self.spice_session.connect()
 
     def get_scaling(self):
         return self.display.get_property("resize-guest")
diff -r 5dd7342a65b1 -r 34ba155f908f src/virtManager/details.py
--- a/src/virtManager/details.py	Wed Dec 22 02:13:25 2010 +0100
+++ b/src/virtManager/details.py	Fri Jan 07 15:14:33 2011 +0100
@@ -2264,17 +2264,15 @@
             port  = port_to_string(gfx.port)
             address = (gfx.listen or "127.0.0.1")
             keymap  = (gfx.keymap or None)
-
+            passwd  = gfx.passwd or ""
+
+            show_text("password", passwd)
             show_text("port", port)
             show_text("address", address)
 
             show_row("keymap", "-box")
             self.set_combo_label("gfx-keymap", 0, keymap)
 
-        if is_vnc:
-            passwd  = gfx.passwd or ""
-            show_text("password", passwd)
-
         if is_spice:
             tlsport = port_to_string(gfx.tlsPort)
             show_text("tlsport", tlsport)




More information about the virt-tools-list mailing list