[PATCH virt-viewer 3/3] app: Add comment only when config file has VM group

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Avoid the debug message on close:
virt-viewer-DEBUG: Unable to get comment from key file: Key file does not have group '39cd210d-5d45-478a-91fe-b3680307f2df'
---
 src/virt-viewer-app.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
index 19cc0a0..a6a14c3 100644
--- a/src/virt-viewer-app.c
+++ b/src/virt-viewer-app.c
@@ -259,7 +259,7 @@ virt_viewer_app_save_config(VirtViewerApp *self)
         g_warning("failed to create config directory");
     g_free(dir);
 
-    if (priv->uuid && priv->guest_name) {
+    if (priv->uuid && priv->guest_name && g_key_file_has_group(priv->config, priv->uuid)) {
         // if there's no comment for this uuid settings group, add a comment
         // with the vm name so user can make sense of it later.
         gchar *comment = g_key_file_get_comment(priv->config, priv->uuid, NULL, &error);
-- 
2.5.0

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list



[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux