Bug 1006737

Summary: virt-viewer should not pop up debug message about couldn't load configuration by default
Product: Red Hat Enterprise Linux 6 Reporter: Cui Lei <lcui>
Component: virt-viewerAssignee: Marc-Andre Lureau <marcandre.lureau>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 6.5CC: cfergeau, codong, dblechte, dyuan, gkong, jjongsma, lcui, marcandre.lureau, mzhan, rbalakri, tzheng, zsong
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: virt-viewer-0.6.0-11.el6 Doc Type: Bug Fix
Doc Text:
no doc required
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-14 06:29:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Cui Lei 2013-09-11 08:24:09 UTC
Description of problem:
In RHEL6.5, when use virt-viewer/remote-viewer, such as #virt-viewer vm, which always popup a debug message first by default.
"(virt-viewer:7959): virt-viewer-DEBUG: Couldn't load configuration: File is empty", it is incorrect, because:

1. The configuration file in .config/virt-viewer/settings is optional, not must have.
2. As there is no "--debug" option added, there should not pop up debug messages.
3. For user experience, as a GUI tool for virt-viewer, should not design that require user first edit configuration files before using. And most user do not know where the configuration file is.

In RHEL6.4 and RHEL7, no debug message like this popup by default settings for virt-viewer.

Version-Release number of selected component (if applicable):
virt-viewer-0.5.6-7.el6.x86_64
libvirt-0.10.2-24.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Fresh install a virt-viewer in OS. (after installation, there should exist .config/virt-viewer/settings bug empty)
2. open a vm by virt-viewer, #virt-viewer vm
3. Check the popup message


Actual results:
"(virt-viewer:7959): virt-viewer-DEBUG: Couldn't load configuration: File is empty" pop up

Expected results:
No debug message popup

Additional info:
Add a emtpy line in .config/virt-viewer/settings could solve this issue.

Comment 2 Jonathon Jongsma 2014-02-03 22:23:43 UTC
This debug message does not appear in upstream

Comment 4 Marc-Andre Lureau 2014-03-12 13:42:16 UTC
the debug message is still here, working on a fix

Comment 5 Marc-Andre Lureau 2014-03-12 14:00:16 UTC
I sent a patch to fix the debug message when the file is missing:

https://www.redhat.com/archives/virt-tools-list/2014-March/msg00057.html

However, when the file is empty, this is considered an error by glib, until v2.32:
commit fcffe6abbb1363b4645752ef2f06c098767f2194
Author: Jürg Billeter <j>
Date:   Fri Nov 4 22:48:56 2011 +0100

    GKeyFile: Accept empty files
    
    It already accepts files consisting solely of whitespace.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=663432

I think it is reasonable to keep the g_debug() when the file is empty (as it should not be by default)

Comment 7 Cui Lei 2014-06-05 03:32:27 UTC
I can reproduce this issue with virt-viewer-0.5.6-7.el6.x86_64 as description.

Verify this issue with virt-viewer-0.6.0-4.el6:

1. open a vm by virt-viewer, #virt-viewer vm
2. Check the popup message

There is no "...couldn't load configuration ..." message pop up.

So change the status from 'ON_QA' to 'VERIFIED'

Comment 8 Cui Lei 2014-07-11 05:45:48 UTC
Reopen the bug, as the issue still existed in some scenario.

1. Fresh install a RHEL OS which include virt-viewer package, when login OS, first check the folder .config/virt-viewer/, there is no 'settings' file

2. Use virt-viewer connect a guest, the warning message "...couldn't load configuration ..." pop up, check the folder .config/virt-viewer/, the 'settings' was created but empty.

3. Quit virt-viewer first time, the hint message “xxx Don't ask again?” would pop up, click 'yes'. Then check the settings file, which has contents as:

[virt-viewer]
ask-quit=true

4. Keep the settings file, re-call #virt-viewer $guest, the warning message "...couldn't load configuration ..." would not pop up.

5. Delete the content of step3, connect the guest, the warning message would pop up again.

So the root cause is there should be a 'settings' file and file has conntent like step3.
Please consider to fix the issue scenario.

Comment 10 Cui Lei 2014-07-29 03:11:24 UTC
Verify the issue with virt-viewer-0.6.0-11.el6:

1. Clear the ENV, rm -rf .config/virt-viewer/settings, remove old version of virt-viewer.
2. Install the latest virt-viewer-0.6.0-11.el6, open the virt-viewer normally. No configuration related message pop up.
3. Check the folder .config/virt-viewer, the folder existed. which include a settings file.
[virt-viewer]
ask-quit=true

So change the status from 'ON_QA' to 'VERIFIED'

Comment 11 errata-xmlrpc 2014-10-14 06:29:37 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-1379.html