qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/2] vnc: Fix compile error on x86_64 with -D_VNC_DEBUG=1
@ 2010-05-03 12:31 Corentin Chary
  2010-05-03 12:31 ` [Qemu-devel] [PATCH 2/2] vnc: set the right prefered encoding Corentin Chary
  2010-05-03 17:15 ` [Qemu-devel] [PATCH 1/2] vnc: Fix compile error on x86_64 with -D_VNC_DEBUG=1 Anthony Liguori
  0 siblings, 2 replies; 6+ messages in thread
From: Corentin Chary @ 2010-05-03 12:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Corentin Chary, Anthony Liguori

cc1: warnings being treated as errors
vnc-auth-sasl.c: In function ‘vnc_client_write_sasl’:
vnc-auth-sasl.c:50: error: format ‘%d’ expects type ‘int’, but argument 4 has type ‘size_t’
vnc-auth-sasl.c:50: error: format ‘%d’ expects type ‘int’, but argument 5 has type ‘size_t’
make: *** [vnc-auth-sasl.o] Error 1

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
---
 vnc-auth-sasl.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/vnc-auth-sasl.c b/vnc-auth-sasl.c
index acaac0c..a51ddc8 100644
--- a/vnc-auth-sasl.c
+++ b/vnc-auth-sasl.c
@@ -47,7 +47,8 @@ long vnc_client_write_sasl(VncState *vs)
 {
     long ret;
 
-    VNC_DEBUG("Write SASL: Pending output %p size %d offset %d Encoded: %p size %d offset %d\n",
+    VNC_DEBUG("Write SASL: Pending output %p size %zd offset %zd "
+              "Encoded: %p size %d offset %d\n",
               vs->output.buffer, vs->output.capacity, vs->output.offset,
               vs->sasl.encoded, vs->sasl.encodedLength, vs->sasl.encodedOffset);
 
-- 
1.7.0.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PATCH 2/2] vnc: set the right prefered encoding
  2010-05-03 12:31 [Qemu-devel] [PATCH 1/2] vnc: Fix compile error on x86_64 with -D_VNC_DEBUG=1 Corentin Chary
@ 2010-05-03 12:31 ` Corentin Chary
  2010-05-03 15:25   ` [Qemu-devel] " Anthony Liguori
  2010-05-03 17:15 ` [Qemu-devel] [PATCH 1/2] vnc: Fix compile error on x86_64 with -D_VNC_DEBUG=1 Anthony Liguori
  1 sibling, 1 reply; 6+ messages in thread
From: Corentin Chary @ 2010-05-03 12:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Corentin Chary, Anthony Liguori

>From RFB specs: "The order of the encoding types given in this
message is a hint bby the client as to its preference (the first
encoding specified being most preferred)"

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
---
 vnc.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/vnc.c b/vnc.c
index d332099..ad5b5af 100644
--- a/vnc.c
+++ b/vnc.c
@@ -1767,7 +1767,7 @@ static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings)
 
     vnc_zlib_init(vs);
     vs->features = 0;
-    vs->vnc_encoding = 0;
+    vs->vnc_encoding = -1;
     vs->tight_compression = 9;
     vs->tight_quality = 9;
     vs->absolute = -1;
@@ -1776,18 +1776,21 @@ static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings)
         enc = encodings[i];
         switch (enc) {
         case VNC_ENCODING_RAW:
-            vs->vnc_encoding = enc;
+            if (vs->vnc_encoding != -1)
+                vs->vnc_encoding = enc;
             break;
         case VNC_ENCODING_COPYRECT:
             vs->features |= VNC_FEATURE_COPYRECT_MASK;
             break;
         case VNC_ENCODING_HEXTILE:
             vs->features |= VNC_FEATURE_HEXTILE_MASK;
-            vs->vnc_encoding = enc;
+            if (vs->vnc_encoding != -1)
+                vs->vnc_encoding = enc;
             break;
         case VNC_ENCODING_ZLIB:
             vs->features |= VNC_FEATURE_ZLIB_MASK;
-            vs->vnc_encoding = enc;
+            if (vs->vnc_encoding != -1)
+                vs->vnc_encoding = enc;
             break;
         case VNC_ENCODING_DESKTOPRESIZE:
             vs->features |= VNC_FEATURE_RESIZE_MASK;
-- 
1.7.0.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Qemu-devel] Re: [PATCH 2/2] vnc: set the right prefered encoding
  2010-05-03 12:31 ` [Qemu-devel] [PATCH 2/2] vnc: set the right prefered encoding Corentin Chary
@ 2010-05-03 15:25   ` Anthony Liguori
  2010-05-04 12:01     ` [Qemu-devel] [PATCH] " Corentin Chary
  0 siblings, 1 reply; 6+ messages in thread
From: Anthony Liguori @ 2010-05-03 15:25 UTC (permalink / raw)
  To: Corentin Chary; +Cc: qemu-devel

On 05/03/2010 07:31 AM, Corentin Chary wrote:
> > From RFB specs: "The order of the encoding types given in this
> message is a hint bby the client as to its preference (the first
> encoding specified being most preferred)"
>
> Signed-off-by: Corentin Chary<corentincj@iksaif.net>
> ---
>   vnc.c |   11 +++++++----
>   1 files changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/vnc.c b/vnc.c
> index d332099..ad5b5af 100644
> --- a/vnc.c
> +++ b/vnc.c
> @@ -1767,7 +1767,7 @@ static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings)
>
>       vnc_zlib_init(vs);
>       vs->features = 0;
> -    vs->vnc_encoding = 0;
> +    vs->vnc_encoding = -1;
>       vs->tight_compression = 9;
>       vs->tight_quality = 9;
>       vs->absolute = -1;
> @@ -1776,18 +1776,21 @@ static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings)
>           enc = encodings[i];
>           switch (enc) {
>           case VNC_ENCODING_RAW:
> -            vs->vnc_encoding = enc;
> +            if (vs->vnc_encoding != -1)
> +                vs->vnc_encoding = enc;
>    

Need braces on the if statement (see CODING_STYLE) but otherwise, this 
patch makes sense.

Regards,

Anthony Liguori

>               break;
>           case VNC_ENCODING_COPYRECT:
>               vs->features |= VNC_FEATURE_COPYRECT_MASK;
>               break;
>           case VNC_ENCODING_HEXTILE:
>               vs->features |= VNC_FEATURE_HEXTILE_MASK;
> -            vs->vnc_encoding = enc;
> +            if (vs->vnc_encoding != -1)
> +                vs->vnc_encoding = enc;
>               break;
>           case VNC_ENCODING_ZLIB:
>               vs->features |= VNC_FEATURE_ZLIB_MASK;
> -            vs->vnc_encoding = enc;
> +            if (vs->vnc_encoding != -1)
> +                vs->vnc_encoding = enc;
>               break;
>           case VNC_ENCODING_DESKTOPRESIZE:
>               vs->features |= VNC_FEATURE_RESIZE_MASK;
>    

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH 1/2] vnc: Fix compile error on x86_64 with -D_VNC_DEBUG=1
  2010-05-03 12:31 [Qemu-devel] [PATCH 1/2] vnc: Fix compile error on x86_64 with -D_VNC_DEBUG=1 Corentin Chary
  2010-05-03 12:31 ` [Qemu-devel] [PATCH 2/2] vnc: set the right prefered encoding Corentin Chary
@ 2010-05-03 17:15 ` Anthony Liguori
  1 sibling, 0 replies; 6+ messages in thread
From: Anthony Liguori @ 2010-05-03 17:15 UTC (permalink / raw)
  To: Corentin Chary; +Cc: qemu-devel

On 05/03/2010 07:31 AM, Corentin Chary wrote:
> cc1: warnings being treated as errors
> vnc-auth-sasl.c: In function ‘vnc_client_write_sasl’:
> vnc-auth-sasl.c:50: error: format ‘%d’ expects type ‘int’, but argument 4 has type ‘size_t’
> vnc-auth-sasl.c:50: error: format ‘%d’ expects type ‘int’, but argument 5 has type ‘size_t’
> make: *** [vnc-auth-sasl.o] Error 1
>
> Signed-off-by: Corentin Chary<corentincj@iksaif.net>
>    

Applied 1/2.  Thanks.

Regards,

Anthony Liguori
> ---
>   vnc-auth-sasl.c |    3 ++-
>   1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/vnc-auth-sasl.c b/vnc-auth-sasl.c
> index acaac0c..a51ddc8 100644
> --- a/vnc-auth-sasl.c
> +++ b/vnc-auth-sasl.c
> @@ -47,7 +47,8 @@ long vnc_client_write_sasl(VncState *vs)
>   {
>       long ret;
>
> -    VNC_DEBUG("Write SASL: Pending output %p size %d offset %d Encoded: %p size %d offset %d\n",
> +    VNC_DEBUG("Write SASL: Pending output %p size %zd offset %zd "
> +              "Encoded: %p size %d offset %d\n",
>                 vs->output.buffer, vs->output.capacity, vs->output.offset,
>                 vs->sasl.encoded, vs->sasl.encodedLength, vs->sasl.encodedOffset);
>
>    

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PATCH] vnc: set the right prefered encoding
  2010-05-03 15:25   ` [Qemu-devel] " Anthony Liguori
@ 2010-05-04 12:01     ` Corentin Chary
  2010-05-06  7:00       ` Corentin Chary
  0 siblings, 1 reply; 6+ messages in thread
From: Corentin Chary @ 2010-05-04 12:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: Corentin Chary, Anthony Liguori

>From RFB specs: "The order of the encoding types given in this
message is a hint by the client as to its preference (the first
encoding specified being most preferred)"

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
---
 vnc.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/vnc.c b/vnc.c
index 5241a6a..2d05d8f 100644
--- a/vnc.c
+++ b/vnc.c
@@ -1594,7 +1594,7 @@ static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings)
 
     vnc_zlib_init(vs);
     vs->features = 0;
-    vs->vnc_encoding = 0;
+    vs->vnc_encoding = -1;
     vs->tight_compression = 9;
     vs->tight_quality = 9;
     vs->absolute = -1;
@@ -1603,18 +1603,24 @@ static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings)
         enc = encodings[i];
         switch (enc) {
         case VNC_ENCODING_RAW:
-            vs->vnc_encoding = enc;
+            if (vs->vnc_encoding != -1) {
+                vs->vnc_encoding = enc;
+            }
             break;
         case VNC_ENCODING_COPYRECT:
             vs->features |= VNC_FEATURE_COPYRECT_MASK;
             break;
         case VNC_ENCODING_HEXTILE:
             vs->features |= VNC_FEATURE_HEXTILE_MASK;
-            vs->vnc_encoding = enc;
+            if (vs->vnc_encoding != -1) {
+                vs->vnc_encoding = enc;
+            }
             break;
         case VNC_ENCODING_ZLIB:
             vs->features |= VNC_FEATURE_ZLIB_MASK;
-            vs->vnc_encoding = enc;
+            if (vs->vnc_encoding != -1) {
+                vs->vnc_encoding = enc;
+            }
             break;
         case VNC_ENCODING_DESKTOPRESIZE:
             vs->features |= VNC_FEATURE_RESIZE_MASK;
-- 
1.7.0.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] vnc: set the right prefered encoding
  2010-05-04 12:01     ` [Qemu-devel] [PATCH] " Corentin Chary
@ 2010-05-06  7:00       ` Corentin Chary
  0 siblings, 0 replies; 6+ messages in thread
From: Corentin Chary @ 2010-05-06  7:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: Corentin Chary, Anthony Liguori

On Tue, May 4, 2010 at 2:01 PM, Corentin Chary <corentincj@iksaif.net> wrote:
> From RFB specs: "The order of the encoding types given in this
> message is a hint by the client as to its preference (the first
> encoding specified being most preferred)"
>
> Signed-off-by: Corentin Chary <corentincj@iksaif.net>
> ---
>  vnc.c |   14 ++++++++++----
>  1 files changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/vnc.c b/vnc.c
> index 5241a6a..2d05d8f 100644
> --- a/vnc.c
> +++ b/vnc.c
> @@ -1594,7 +1594,7 @@ static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings)
>
>     vnc_zlib_init(vs);
>     vs->features = 0;
> -    vs->vnc_encoding = 0;
> +    vs->vnc_encoding = -1;
>     vs->tight_compression = 9;
>     vs->tight_quality = 9;
>     vs->absolute = -1;
> @@ -1603,18 +1603,24 @@ static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings)
>         enc = encodings[i];
>         switch (enc) {
>         case VNC_ENCODING_RAW:
> -            vs->vnc_encoding = enc;
> +            if (vs->vnc_encoding != -1) {
> +                vs->vnc_encoding = enc;
> +            }

hum patch is broken, sending a fixed patch today, sorry

should be if (vs->vnc_encoding == -1)

-- 
Corentin Chary
http://xf.iksaif.net

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-05-06  7:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-03 12:31 [Qemu-devel] [PATCH 1/2] vnc: Fix compile error on x86_64 with -D_VNC_DEBUG=1 Corentin Chary
2010-05-03 12:31 ` [Qemu-devel] [PATCH 2/2] vnc: set the right prefered encoding Corentin Chary
2010-05-03 15:25   ` [Qemu-devel] " Anthony Liguori
2010-05-04 12:01     ` [Qemu-devel] [PATCH] " Corentin Chary
2010-05-06  7:00       ` Corentin Chary
2010-05-03 17:15 ` [Qemu-devel] [PATCH 1/2] vnc: Fix compile error on x86_64 with -D_VNC_DEBUG=1 Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).