yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-ui-move-disconnecting-check-to-start-of-vnc_update_c.patch

5d360b
From a56b8ac0a5917f0a2d007a9249a4ea299fc5c208 Mon Sep 17 00:00:00 2001
5d360b
From: "Daniel P. Berrange" <berrange@redhat.com>
5d360b
Date: Thu, 8 Feb 2018 17:50:29 +0100
5d360b
Subject: [PATCH 15/27] ui: move disconnecting check to start of
5d360b
 vnc_update_client
5d360b
MIME-Version: 1.0
5d360b
Content-Type: text/plain; charset=UTF-8
5d360b
Content-Transfer-Encoding: 8bit
5d360b
5d360b
RH-Author: Daniel P. Berrange <berrange@redhat.com>
5d360b
Message-id: <20180208175041.5634-16-berrange@redhat.com>
5d360b
Patchwork-id: 78937
5d360b
O-Subject: [RHEL-7.5 qemu-kvm PATCH v1 15/27] ui: move disconnecting check to start of vnc_update_client
5d360b
Bugzilla: 1527405
5d360b
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
5d360b
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
5d360b
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
5d360b
5d360b
This is superficially similar to the combination of
5d360b
5d360b
  commit 5a8be0f73d6f60ff08746377eb09ca459f39deab
5d360b
  Author: Gerd Hoffmann <kraxel@redhat.com>
5d360b
  Date:   Wed Jul 13 12:21:20 2016 +0200
5d360b
5d360b
    vnc: make sure we finish disconnect
5d360b
5d360b
and
5d360b
5d360b
  commit c53df961617736f94731d94b62c2954c261d2bae
5d360b
  Author: Daniel P. Berrange <berrange@redhat.com>
5d360b
  Date:   Mon Dec 18 19:12:17 2017 +0000
5d360b
5d360b
      ui: remove unreachable code in vnc_update_client
5d360b
5d360b
We can't cherry-pick those changes, however, because they depend
5d360b
on the QIOChannel conversion. Thus, this downstream only change
5d360b
is done to make other following changes apply with fewer conflicts
5d360b
during backport.
5d360b
5d360b
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5d360b
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
5d360b
---
5d360b
 ui/vnc.c | 10 ++++++----
5d360b
 1 file changed, 6 insertions(+), 4 deletions(-)
5d360b
5d360b
diff --git a/ui/vnc.c b/ui/vnc.c
5d360b
index ec7bb0c..874900c 100644
5d360b
--- a/ui/vnc.c
5d360b
+++ b/ui/vnc.c
5d360b
@@ -848,8 +848,13 @@ static int find_and_clear_dirty_height(struct VncState *vs,
5d360b
 
5d360b
 static int vnc_update_client(VncState *vs, int has_dirty)
5d360b
 {
5d360b
+    if (vs->csock == -1) {
5d360b
+        vnc_disconnect_finish(vs);
5d360b
+        return 0;
5d360b
+    }
5d360b
+
5d360b
     vs->has_dirty += has_dirty;
5d360b
-    if (vs->need_update && vs->csock != -1) {
5d360b
+    if (vs->need_update) {
5d360b
         VncDisplay *vd = vs->vd;
5d360b
         VncJob *job;
5d360b
         int y;
5d360b
@@ -904,9 +909,6 @@ static int vnc_update_client(VncState *vs, int has_dirty)
5d360b
         return n;
5d360b
     }
5d360b
 
5d360b
-    if (vs->csock == -1)
5d360b
-        vnc_disconnect_finish(vs);
5d360b
-
5d360b
     return 0;
5d360b
 }
5d360b
 
5d360b
-- 
5d360b
1.8.3.1
5d360b