ui/vnc: fix enabling of VNC_FEATURE_XVP
PATCH 1/1 ui/vnc: fix enabling of VNC_FEATURE_XVP
VNC_FEATURE_XVP was not shifted left before adding it to vs->features, so it was never enabled.
--- ui/vnc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
ui/vnc.c +1 -1
@@ -2205,7 +2205,7 @@ static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings)break ;case VNC_ENCODING_XVP :if (vs->vd->power_control) { - vs->features |=VNC_FEATURE_XVP ; + vs->features |=VNC_FEATURE_XVP_MASK ;send_xvp_message (vs,VNC_XVP_CODE_INIT ); }break ;
Signature · 1 line
2.41.0
Quoted 7 lines · Paolo Bonzini
VNC_FEATURE_XVPwas not shifted left before adding it tovs->features, so it was never enabled.Signed-off-by Paolo Bonzini <[email protected]>--- ui/vnc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
/facepalm
I definitely tested this code, because I had to use QEMU to validate the GTK-VNC client implementation....
Quoted 6 lines
ui/vnc.c +0
-0
ui/vnc.c static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings) · line 2211
Quoted 8 lines
ui/vnc.c +1
-1@@ -2205,7 +2205,7 @@ static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings)break ;case VNC_ENCODING_XVP :if (vs->vd->power_control) { - vs->features |=VNC_FEATURE_XVP ; + vs->features |=VNC_FEATURE_XVP_MASK ;send_xvp_message (vs,VNC_XVP_CODE_INIT ); }break ;
....I made the same screwup when processing messages:
case VNC_MSG_CLIENT_XVP:
if (!(vs->features & VNC_FEATURE_XVP)) {
error_report("vnc: xvp client message while disabled");
vnc_client_error(vs);
break;
}so the bugs (kinda) cancelled out. So you'll need to fix both places
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Quoted 40 lines · Daniel P. Berrangé
Quoted 7 lines · Paolo Bonzini
VNC_FEATURE_XVPwas not shifted left before adding it tovs->features, so it was never enabled.Signed-off-by Paolo Bonzini <[email protected]>--- ui/vnc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)/facepalm
I definitely tested this code, because I had to use QEMU to validate the GTK-VNC client implementation....
Quoted 6 lines
ui/vnc.c +0
-0ui/vnc.c static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings) · line 2211
Quoted 8 lines
ui/vnc.c +1
-1@@ -2205,7 +2205,7 @@ static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings)break ;case VNC_ENCODING_XVP :if (vs->vd->power_control) { - vs->features |=VNC_FEATURE_XVP ; + vs->features |=VNC_FEATURE_XVP_MASK ;send_xvp_message (vs,VNC_XVP_CODE_INIT ); }break ;....I made the same screwup when processing messages:
case VNC_MSG_CLIENT_XVP: if (!(vs->features & VNC_FEATURE_XVP)) { error_report("vnc: xvp client message while disabled"); vnc_client_error(vs); break; }
Quoted 2 lines
so the bugs (kinda) cancelled out. So you'll need to fix both places
Doh, I "assumed" it was a thinko coming from usage of vnc_has_feature elsewhere. I will send v2.
Paolo