Skip to contentSkip to conversation

vnc: cleanups and fixes

GIT PULL Applied Gerd Hoffmann 3 participants 6 messages Jun 19, 2014 – Aug 27, 2014

lore
Share & tools
lore
#0 lore raw

Hi,

Here is the vnc patch queue, with one bugfix and two cleanups.

please pull,
Gerd

The following changes since commit d279279e2b5cd40dbcc863fb66a695990f304077:

target-mips: implement UserLocal Register (2014-06-18 18:10:47 +0200)

are available in the git repository at:

git://git.kraxel.org/qemu tags/pull-vnc-20140619-1

for you to fetch changes up to eb214ff8ef6cceec348f3ad1643b39443fe07910:

vnc: fix screen updates (2014-06-19 12:48:07 +0200)

----------------------------------------------------------------
vnc: cleanups and fixes

----------------------------------------------------------------
Gerd Hoffmann (1):
vnc: fix screen updates

Markus Armbruster (2):
vnc: Drop superfluous conditionals around g_free()
vnc: Drop superfluous conditionals around g_strdup()

 ui/vnc-tls.c |  6 ++----
 ui/vnc.c     | 18 +++++++-----------
 2 files changed, 9 insertions(+), 15 deletions(-)
#1 lore raw

[Qemu-devel] [PULL 1/3] vnc: Drop superfluous conditionals around g_free()

From: Markus Armbruster <[email protected]>

---
 ui/vnc-tls.c |  6 ++----
 ui/vnc.c     | 12 ++++--------
 2 files changed, 6 insertions(+), 12 deletions(-)
ui/vnc-tls.c +2 -4
index 50275de..6392326 100644
@@ -443,10 +443,8 @@ static int vnc_set_x509_credential(VncDisplay *vd,
 {
     struct stat sb;
 
-    if (*cred) {
-        g_free(*cred);
-        *cred = NULL;
-    }
+    g_free(*cred);
+    *cred = NULL;
 
     *cred = g_malloc(strlen(certdir) + strlen(filename) + 2);
 
ui/vnc.c +4 -8
index 1684206..d771a2c 100644
@@ -2972,10 +2972,8 @@ static void vnc_display_close(DisplayState *ds)
 
     if (!vs)
         return;
-    if (vs->display) {
-        g_free(vs->display);
-        vs->display = NULL;
-    }
+    g_free(vs->display);
+    vs->display = NULL;
     if (vs->lsock != -1) {
         qemu_set_fd_handler2(vs->lsock, NULL, NULL, NULL, NULL);
         close(vs->lsock);
@@ -3010,10 +3008,8 @@ int vnc_display_password(DisplayState *ds, const char *password)
         return -EINVAL;
     }
 
-    if (vs->password) {
-        g_free(vs->password);
-        vs->password = NULL;
-    }
+    g_free(vs->password);
+    vs->password = NULL;
     if (password) {
         vs->password = g_strdup(password);
     }
Signature · 1 line
1.8.3.1
#2 lore raw

[Qemu-devel] [PULL 3/3] vnc: fix screen updates

In reply to Gerd Hoffmann

Bug was added by 38ee14f4f33f8836fc0e209ca59c6ae8c6edf380. vnc_jobs_join call is missing in one code path.

---
 ui/vnc.c | 3 +++
 1 file changed, 3 insertions(+)
ui/vnc.c +3 -0
index 6c9d4f3..aac93f0 100644
@@ -935,6 +935,9 @@ static int vnc_update_client(VncState *vs, int has_dirty, bool sync)
         }
 
         vnc_job_push(job);
+        if (sync) {
+            vnc_jobs_join(vs);
+        }
         vs->force_update = 0;
         return n;
     }
Signature · 1 line
1.8.3.1
#3 lore raw

Re: [Qemu-devel] [PULL 3/3] vnc: fix screen updates

Quoted 25 lines

Bug was added by 38ee14f4f33f8836fc0e209ca59c6ae8c6edf380. vnc_jobs_join call is missing in one code path.

---
ui/vnc.c | 3 +++

1 file changed, 3 insertions(+)
ui/vnc.c +3 -0
index 6c9d4f3..aac93f0 100644
@@ -935,6 +935,9 @@ static int vnc_update_client(VncState *vs, int has_dirty, bool sync)
        }
 
        vnc_job_push(job);
+        if (sync) {
+            vnc_jobs_join(vs);
+        }
        vs->force_update = 0;
        return n;
    }
Signature · 1 line
1.8.3.1

What about below raw patch,
@@ -935,14 +935,13 @@ static int vnc_update_client(VncState *vs, int has_dirty, bool sync)

         }
 
         vnc_job_push(job);
         vs->force_update = 0;
-        return n;
     }

     if (vs->csock == -1) {
         vnc_disconnect_finish(vs);
     } else if (sync) {
         vnc_jobs_join(vs);
     }

- return 0;
+ return n;

Thanks,
Zhang Haoyu

#4 lore raw

[Qemu-devel] [PULL 2/3] vnc: Drop superfluous conditionals around g_strdup()

In reply to Gerd Hoffmann

From: Markus Armbruster <[email protected]>

---
 ui/vnc.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
ui/vnc.c +1 -4
index d771a2c..6c9d4f3 100644
@@ -3009,10 +3009,7 @@ int vnc_display_password(DisplayState *ds, const char *password)
     }
 
     g_free(vs->password);
-    vs->password = NULL;
-    if (password) {
-        vs->password = g_strdup(password);
-    }
+    vs->password = g_strdup(password);
 
     return 0;
 }
Signature · 1 line
1.8.3.1
#5 lore raw
In reply to Gerd Hoffmann
Quoted 13 lines · Gerd Hoffmann

Hi,

Here is the vnc patch queue, with one bugfix and two cleanups.

please pull,
Gerd

The following changes since commit d279279e2b5cd40dbcc863fb66a695990f304077:

target-mips: implement UserLocal Register (2014-06-18 18:10:47 +0200)

are available in the git repository at:

Quoted 8 lines

git://git.kraxel.org/qemu tags/pull-vnc-20140619-1

for you to fetch changes up to eb214ff8ef6cceec348f3ad1643b39443fe07910:

vnc: fix screen updates (2014-06-19 12:48:07 +0200)

----------------------------------------------------------------
vnc: cleanups and fixes

Applied, thanks.

-- PMM