diff options
author | Fabiano Fidêncio <fidencio@redhat.com> | 2016-03-07 09:25:23 +0100 |
---|---|---|
committer | Fabiano Fidêncio <fidencio@redhat.com> | 2016-03-07 16:03:52 +0100 |
commit | 5f269245356b49bcae0da74c33517fd54466490f (patch) | |
tree | 84724b810a558c4346365c5ac7076094802d5650 /src | |
parent | 4aac5ca55b2ead16f0b12ee24a2a237af827ecff (diff) | |
download | virt-viewer-5f269245356b49bcae0da74c33517fd54466490f.tar.gz virt-viewer-5f269245356b49bcae0da74c33517fd54466490f.tar.xz virt-viewer-5f269245356b49bcae0da74c33517fd54466490f.zip |
app: monitor-config - do it all or nothing
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@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/virt-viewer-app.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c index 660acef..dac2dcc 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("Invalid monitor-mapping configuration: monitor #%i for display #%i does not exist", monitor, display); + goto configerror; + } else { /* config file format is 1-based, not 0-based */ display--; monitor--; |