From: Paolo Bonzini Date: Mon, 25 Sep 2023 11:05:58 +0000 (+0200) Subject: ui/vnc: fix handling of VNC_FEATURE_XVP X-Git-Tag: v8.1.2~40 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3b86b92bfbbebbc8f6801588dafce7d76c1782d9;p=thirdparty%2Fqemu.git ui/vnc: fix handling of VNC_FEATURE_XVP VNC_FEATURE_XVP was not shifted left before adding it to vs->features, so it was never enabled; but it was also checked the wrong way with a logical AND instead of vnc_has_feature. Fix both places. Signed-off-by: Paolo Bonzini (cherry picked from commit 477b301000d665313217f65e3a368d2cb7769c42) Signed-off-by: Michael Tokarev --- diff --git a/ui/vnc.c b/ui/vnc.c index 538581929a4..293ba5db5fa 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -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; @@ -2454,7 +2454,7 @@ static int protocol_client_msg(VncState *vs, uint8_t *data, size_t len) vnc_client_cut_text(vs, read_u32(data, 4), data + 8); break; case VNC_MSG_CLIENT_XVP: - if (!(vs->features & VNC_FEATURE_XVP)) { + if (!vnc_has_feature(vs, VNC_FEATURE_XVP)) { error_report("vnc: xvp client message while disabled"); vnc_client_error(vs); break;