[virt-tools-list] [PATCH virt-viewer v2 4/7] Rename session-auth-failed to session-auth-unsupported

Jonathon Jongsma jjongsma at redhat.com
Thu Jun 18 20:15:27 UTC 2015


Now that VNC and Spice both return the same signal on normal
authentication failures ('session-auth-refused'), the
'session-auth-failed' signal is too confusingly similar. Rename it to
-unsupported to make it obvious that it's a different type of
(unrecoverable) error.
---
 src/virt-viewer-app.c         | 10 +++++-----
 src/virt-viewer-session-vnc.c |  2 +-
 src/virt-viewer-session.c     |  4 ++--
 src/virt-viewer-session.h     |  2 +-
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
index 96afc78..3643fec 100644
--- a/src/virt-viewer-app.c
+++ b/src/virt-viewer-app.c
@@ -80,8 +80,8 @@ static void virt_viewer_app_disconnected(VirtViewerSession *session,
 static void virt_viewer_app_auth_refused(VirtViewerSession *session,
                                          const char *msg,
                                          VirtViewerApp *self);
-static void virt_viewer_app_auth_failed(VirtViewerSession *session,
-                                        const char *msg,
+static void virt_viewer_app_auth_unsupported(VirtViewerSession *session,
+                                             const char *msg,
                                         VirtViewerApp *self);
 static void virt_viewer_app_usb_failed(VirtViewerSession *session,
                                        const char *msg,
@@ -1117,8 +1117,8 @@ virt_viewer_app_create_session(VirtViewerApp *self, const gchar *type, GError **
                      G_CALLBACK(virt_viewer_app_channel_open), self);
     g_signal_connect(priv->session, "session-auth-refused",
                      G_CALLBACK(virt_viewer_app_auth_refused), self);
-    g_signal_connect(priv->session, "session-auth-failed",
-                     G_CALLBACK(virt_viewer_app_auth_failed), self);
+    g_signal_connect(priv->session, "session-auth-unsupported",
+                     G_CALLBACK(virt_viewer_app_auth_unsupported), self);
     g_signal_connect(priv->session, "session-usb-failed",
                      G_CALLBACK(virt_viewer_app_usb_failed), self);
     g_signal_connect(priv->session, "session-display-added",
@@ -1523,7 +1523,7 @@ static void virt_viewer_app_auth_refused(VirtViewerSession *session,
     }
 }
 
-static void virt_viewer_app_auth_failed(VirtViewerSession *session G_GNUC_UNUSED,
+static void virt_viewer_app_auth_unsupported(VirtViewerSession *session G_GNUC_UNUSED,
                                         const char *msg,
                                         VirtViewerApp *self)
 {
diff --git a/src/virt-viewer-session-vnc.c b/src/virt-viewer-session-vnc.c
index e6189c5..ff6d906 100644
--- a/src/virt-viewer-session-vnc.c
+++ b/src/virt-viewer-session-vnc.c
@@ -152,7 +152,7 @@ virt_viewer_session_vnc_auth_unsupported(VncDisplay *vnc G_GNUC_UNUSED,
 {
     gchar *msg = g_strdup_printf(_("Unsupported authentication type %d"),
                                  authType);
-    g_signal_emit_by_name(session, "session-auth-failed", msg);
+    g_signal_emit_by_name(session, "session-auth-unsupported", msg);
     g_free(msg);
 }
 
diff --git a/src/virt-viewer-session.c b/src/virt-viewer-session.c
index 67fa0fd..9405281 100644
--- a/src/virt-viewer-session.c
+++ b/src/virt-viewer-session.c
@@ -305,10 +305,10 @@ virt_viewer_session_class_init(VirtViewerSessionClass *class)
                  1,
                  G_TYPE_STRING);
 
-    g_signal_new("session-auth-failed",
+    g_signal_new("session-auth-unsupported",
                  G_OBJECT_CLASS_TYPE(object_class),
                  G_SIGNAL_RUN_LAST | G_SIGNAL_NO_HOOKS,
-                 G_STRUCT_OFFSET(VirtViewerSessionClass, session_auth_failed),
+                 G_STRUCT_OFFSET(VirtViewerSessionClass, session_auth_unsupported),
                  NULL,
                  NULL,
                  g_cclosure_marshal_VOID__STRING,
diff --git a/src/virt-viewer-session.h b/src/virt-viewer-session.h
index ea64bae..85f17cc 100644
--- a/src/virt-viewer-session.h
+++ b/src/virt-viewer-session.h
@@ -80,7 +80,7 @@ struct _VirtViewerSessionClass {
     void (*session_initialized)(VirtViewerSession *session);
     void (*session_disconnected)(VirtViewerSession *session, const gchar *msg);
     void (*session_auth_refused)(VirtViewerSession *session, const gchar *msg);
-    void (*session_auth_failed)(VirtViewerSession *session, const gchar *msg);
+    void (*session_auth_unsupported)(VirtViewerSession *session, const gchar *msg);
     void (*session_usb_failed)(VirtViewerSession *session, const gchar *msg);
 
     void (*session_channel_open)(VirtViewerSession *session, VirtViewerSessionChannel *channel);
-- 
2.1.0




More information about the virt-tools-list mailing list