[virt-viewer 1/2] app: monitor-config - do it all or nothing

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

 



Don't keep trying to use a monitor config when it already failed for one
monitor, otherwise virt-viewer can end up in a situation where none of
the displays are enabled but the program is still running.
So, in case of any failure, let's skip the whole monitor config, forcing
virt-viewer to use the "fallback" one instead.

Resolves: rhbz#1315206

Signed-off-by: Fabiano Fidêncio <fidencio@xxxxxxxxxx>
---
 src/virt-viewer-app.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
index 660acef..bbb4928 100644
--- a/src/virt-viewer-app.c
+++ b/src/virt-viewer-app.c
@@ -404,9 +404,10 @@ virt_viewer_app_parse_monitor_mappings(gchar **mappings, gsize nmappings)
         }
         g_strfreev(tokens);
 
-        if (monitor > nmonitors)
-            g_warning("Initial monitor #%i for display #%i does not exist, skipping...", monitor, display);
-        else {
+        if (monitor > nmonitors) {
+            g_warning("Initial monitor #%i for display #%i does not exist", monitor, display);
+            goto configerror;
+        } else {
             /* config file format is 1-based, not 0-based */
             display--;
             monitor--;
-- 
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