Blame SOURCES/0003-Set-guest-name-at-the-same-time-as-uuid.patch

140d58
From 4c253ab87dff0ce65071a36fd1b79b617567f1d8 Mon Sep 17 00:00:00 2001
140d58
From: Pavel Grunt <pgrunt@redhat.com>
140d58
Date: Mon, 2 Jan 2017 16:32:31 +0100
140d58
Subject: [PATCH 03/26] Set guest name at the same time as uuid
140d58
140d58
Avoid showing the "Unknown" name in the guest detail dialog when
140d58
waiting for the domain to be started.
140d58
140d58
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
140d58
---
140d58
 src/virt-viewer.c | 7 +++++--
140d58
 1 file changed, 5 insertions(+), 2 deletions(-)
140d58
140d58
diff --git a/src/virt-viewer.c b/src/virt-viewer.c
140d58
index 3a3b64d..1121146 100644
140d58
--- a/src/virt-viewer.c
140d58
+++ b/src/virt-viewer.c
140d58
@@ -601,8 +601,6 @@ virt_viewer_update_display(VirtViewer *self, virDomainPtr dom, GError **error)
140d58
     virt_viewer_app_trace(app, "Guest %s is running, determining display",
140d58
                           priv->domkey);
140d58
 
140d58
-    g_object_set(app, "guest-name", virDomainGetName(dom), NULL);
140d58
-
140d58
     if (virt_viewer_app_has_session(app))
140d58
         return TRUE;
140d58
 
140d58
@@ -801,6 +799,7 @@ virt_viewer_initial_connect(VirtViewerApp *app, GError **error)
140d58
     VirtViewer *self = VIRT_VIEWER(app);
140d58
     VirtViewerPrivate *priv = self->priv;
140d58
     char uuid_string[VIR_UUID_STRING_BUFLEN];
140d58
+    const char *guest_name;
140d58
     GError *err = NULL;
140d58
 
140d58
     g_debug("initial connect");
140d58
@@ -836,6 +835,10 @@ virt_viewer_initial_connect(VirtViewerApp *app, GError **error)
140d58
     } else {
140d58
         g_object_set(app, "uuid", uuid_string, NULL);
140d58
     }
140d58
+    guest_name = virDomainGetName(dom);
140d58
+    if (guest_name != NULL) {
140d58
+        g_object_set(app, "guest-name", guest_name, NULL);
140d58
+    }
140d58
 
140d58
     virt_viewer_app_show_status(app, _("Checking guest domain status"));
140d58
     if (virDomainGetInfo(dom, &info) < 0) {
140d58
-- 
140d58
2.12.0
140d58