From nobody Fri May 3 18:37:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615873117; cv=none; d=zohomail.com; s=zohoarc; b=EYU4OXluvbudW9eyMEnSeaDXgqhfNH0QaSKgcd37dVdFSqxSTiSjXdFneL2M1exP5x2oNVwbxqlrOqFjL/scqyjg+c7gNm7bk1lJHRXt0bpOQx+SNsf869z430gw+MYhsbdNUPT01/4dxSM8CJMeWy7xMr2kUQXWnfm7n5GaqcI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615873117; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=qtFvwJ2Uusl4aWYl7AJp9/hgsHYUPRXKIIANJX76L+c=; b=kSWAQO3qn8uVqWN+pPl3ZP6VrCppP2MFSXE1vgXrZJdrHM1PvJEeXns+pqz/yNGmAXVPyGyl9CsZrw9pvQcNyfwpqMeZBdmbENH0ftC8KQ/Jx2luPAx0mVQHsiTqxclcPKPZKOhTcDrCKMq+5Ban2rED9OHZKQUs0ho4zgSwiv4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1615873117404895.3091785557391; Mon, 15 Mar 2021 22:38:37 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-51-I-dysRPVNNGDhBteBPMxQw-1; Tue, 16 Mar 2021 01:38:33 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6F52A18460E0; Tue, 16 Mar 2021 05:38:27 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 49B296BC2D; Tue, 16 Mar 2021 05:38:27 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 587FB1800848; Tue, 16 Mar 2021 05:38:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12G5cM0a017007 for ; Tue, 16 Mar 2021 01:38:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1FDD19CA0; Tue, 16 Mar 2021 05:38:22 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-141.ams2.redhat.com [10.36.112.141]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C95E25B4BF; Tue, 16 Mar 2021 05:38:14 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 2209A18000AE; Tue, 16 Mar 2021 06:38:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615873116; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=qtFvwJ2Uusl4aWYl7AJp9/hgsHYUPRXKIIANJX76L+c=; b=JAveq+cubyRSIXYzvseLhR7AwQIocaBD+IKUguxBSIh+UJWqXRqncfTJTQcgwrWm79BNM1 3XDgDa1TodCGAb4g2MGAS5AMwodCc0ijpEzJ0b1f+KK38C+9/RpZeVC+ZpUhBimRDvCxR6 CDJ3+6i4xC3kbajQ/lQCvs1ruUW1PRE= X-MC-Unique: I-dysRPVNNGDhBteBPMxQw-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 01/11] ui: introduce "password-secret" option for VNC servers Date: Tue, 16 Mar 2021 06:38:03 +0100 Message-Id: <20210316053813.1719442-2-kraxel@redhat.com> In-Reply-To: <20210316053813.1719442-1-kraxel@redhat.com> References: <20210316053813.1719442-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, Peter Maydell , Gerd Hoffmann X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) From: Daniel P. Berrang=C3=A9 Currently when using VNC the "password" flag turns on password based authentication. The actual password has to be provided separately via the monitor. This introduces a "password-secret" option which lets the password be provided up front. $QEMU --object secret,id=3Dvncsec0,file=3Dpasswd.txt \ --vnc localhost:0,password-secret=3Dvncsec0 Signed-off-by: Daniel P. Berrang=C3=A9 Message-Id: <20210311114343.439820-2-berrange@redhat.com> Signed-off-by: Gerd Hoffmann --- ui/vnc.c | 23 ++++++++++++++++++++++- qemu-options.hx | 5 +++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/ui/vnc.c b/ui/vnc.c index 310abc937812..e8e3426a65c4 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -48,6 +48,7 @@ #include "crypto/tlscredsanon.h" #include "crypto/tlscredsx509.h" #include "crypto/random.h" +#include "crypto/secret_common.h" #include "qom/object_interfaces.h" #include "qemu/cutils.h" #include "qemu/help_option.h" @@ -3459,6 +3460,9 @@ static QemuOptsList qemu_vnc_opts =3D { },{ .name =3D "password", .type =3D QEMU_OPT_BOOL, + },{ + .name =3D "password-secret", + .type =3D QEMU_OPT_STRING, },{ .name =3D "reverse", .type =3D QEMU_OPT_BOOL, @@ -3931,6 +3935,7 @@ void vnc_display_open(const char *id, Error **errp) int lock_key_sync =3D 1; int key_delay_ms; const char *audiodev; + const char *passwordSecret; =20 if (!vd) { error_setg(errp, "VNC display not active"); @@ -3948,7 +3953,23 @@ void vnc_display_open(const char *id, Error **errp) goto fail; } =20 - password =3D qemu_opt_get_bool(opts, "password", false); + + passwordSecret =3D qemu_opt_get(opts, "password-secret"); + if (passwordSecret) { + if (qemu_opt_get(opts, "password")) { + error_setg(errp, + "'password' flag is redundant with 'password-secret= '"); + goto fail; + } + vd->password =3D qcrypto_secret_lookup_as_utf8(passwordSecret, + errp); + if (!vd->password) { + goto fail; + } + password =3D true; + } else { + password =3D qemu_opt_get_bool(opts, "password", false); + } if (password) { if (fips_get_state()) { error_setg(errp, diff --git a/qemu-options.hx b/qemu-options.hx index 622d3bfa5a7d..357fc4596ecc 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2165,6 +2165,11 @@ SRST time to allow password to expire immediately or never expire. =20 + ``password-secret=3D`` + Require that password based authentication is used for client + connections, using the password provided by the ``secret`` + object identified by ``secret-id``. + ``tls-creds=3DID`` Provides the ID of a set of TLS credentials to use to secure the VNC server. They will apply to both the normal VNC server socket --=20 2.29.2 From nobody Fri May 3 18:37:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615873156; cv=none; d=zohomail.com; s=zohoarc; b=b9XNDUTV+pGV+FJHr0gWuknOJb1VL4SmXU485Au6Op7M6AMiVuxgEdna8m+2zQOw4Nj//M7QfhiHXixS/v9qO+y54O/fUri+Q0LhOnKEHtofz1W9g/0CZ3HZvJP9y3HNEc2oUyBzYeEyqmsrFfAqtVrKBEwNYNSADFimimHk+YQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615873156; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9KGiiiLp5Z5E0ZYAJCIa/m1G1l16bJwRHLe52zKtCaw=; b=fNtHOPAwWxHQzYKlD+eJfNOMpfwIe2PThaDSum2Qta9TN7nd2svvcxqGD9sVbKKaDWr2FYOaS7/ELhoF/nNWvBaP9QeVsZ8ZLdLac3zJJPWAGwUS4oqblZUtAy9XEgyL9d8Jld6TWEdxePuYdl75jhZyOqV8vzZ5gEJLF354TVM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1615873156103513.2586443220787; Mon, 15 Mar 2021 22:39:16 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-594-qlRsM8c7NJC8GBHucnggVg-1; Tue, 16 Mar 2021 01:38:57 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0FF00363AC; Tue, 16 Mar 2021 05:38:48 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D244646; Tue, 16 Mar 2021 05:38:47 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 96B9857DC5; Tue, 16 Mar 2021 05:38:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12G5cLIu016990 for ; Tue, 16 Mar 2021 01:38:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id 722F15D9DE; Tue, 16 Mar 2021 05:38:21 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-141.ams2.redhat.com [10.36.112.141]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CD3035D9D3; Tue, 16 Mar 2021 05:38:14 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 2FA11180038A; Tue, 16 Mar 2021 06:38:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615873155; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=9KGiiiLp5Z5E0ZYAJCIa/m1G1l16bJwRHLe52zKtCaw=; b=Zfdx0jPuLzjKnXExTE4Oqti/cT4c9niekyp2nBGGB+/r3SxOmgw5NTagdmRTMNJf/akuQj 1PPBoCnSs71e8ofJQab1Zgd0RPyFCictHOy/NLlNxDfZEeZXfqGM5KjuHiuw2kxJnXQzMW 7bunedlEDl8BbVKu+TPvY6o66agPrzw= X-MC-Unique: qlRsM8c7NJC8GBHucnggVg-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 02/11] ui: introduce "password-secret" option for SPICE server Date: Tue, 16 Mar 2021 06:38:04 +0100 Message-Id: <20210316053813.1719442-3-kraxel@redhat.com> In-Reply-To: <20210316053813.1719442-1-kraxel@redhat.com> References: <20210316053813.1719442-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, Peter Maydell , Gerd Hoffmann X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) From: Daniel P. Berrang=C3=A9 Currently when using SPICE the "password" option provides the password in plain text on the command line. This is insecure as it is visible to all processes on the host. As an alternative, the password can be provided separately via the monitor. This introduces a "password-secret" option which lets the password be provided up front. $QEMU --object secret,id=3Dvncsec0,file=3Dpasswd.txt \ --spice port=3D5901,password-secret=3Dvncsec0 Signed-off-by: Daniel P. Berrang=C3=A9 Message-Id: <20210311114343.439820-3-berrange@redhat.com> Signed-off-by: Gerd Hoffmann --- ui/spice-core.c | 30 ++++++++++++++++++++++++++++-- qemu-options.hx | 9 +++++++-- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/ui/spice-core.c b/ui/spice-core.c index cadec766fe3a..b9d8aced91df 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -34,6 +34,7 @@ #include "qapi/qapi-events-ui.h" #include "qemu/notify.h" #include "qemu/option.h" +#include "crypto/secret_common.h" #include "migration/misc.h" #include "hw/pci/pci_bus.h" #include "ui/spice-display.h" @@ -415,6 +416,9 @@ static QemuOptsList qemu_spice_opts =3D { },{ .name =3D "password", .type =3D QEMU_OPT_STRING, + },{ + .name =3D "password-secret", + .type =3D QEMU_OPT_STRING, },{ .name =3D "disable-ticketing", .type =3D QEMU_OPT_BOOL, @@ -636,7 +640,9 @@ void qemu_spice_display_init_done(void) static void qemu_spice_init(void) { QemuOpts *opts =3D QTAILQ_FIRST(&qemu_spice_opts.head); - const char *password, *str, *x509_dir, *addr, + char *password =3D NULL; + const char *passwordSecret; + const char *str, *x509_dir, *addr, *x509_key_password =3D NULL, *x509_dh_file =3D NULL, *tls_ciphers =3D NULL; @@ -663,7 +669,26 @@ static void qemu_spice_init(void) error_report("spice tls-port is out of range"); exit(1); } - password =3D qemu_opt_get(opts, "password"); + passwordSecret =3D qemu_opt_get(opts, "password-secret"); + if (passwordSecret) { + Error *local_err =3D NULL; + if (qemu_opt_get(opts, "password")) { + error_report("'password' option is mutually exclusive with " + "'password-secret'"); + exit(1); + } + password =3D qcrypto_secret_lookup_as_utf8(passwordSecret, + &local_err); + if (!password) { + error_report_err(local_err); + exit(1); + } + } else { + str =3D qemu_opt_get(opts, "password"); + if (str) { + password =3D g_strdup(str); + } + } =20 if (tls_port) { x509_dir =3D qemu_opt_get(opts, "x509-dir"); @@ -809,6 +834,7 @@ static void qemu_spice_init(void) g_free(x509_key_file); g_free(x509_cert_file); g_free(x509_cacert_file); + g_free(password); =20 #ifdef HAVE_SPICE_GL if (qemu_opt_get_bool(opts, "gl", 0)) { diff --git a/qemu-options.hx b/qemu-options.hx index 357fc4596ecc..a98f8e84a29d 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1899,7 +1899,8 @@ DEF("spice", HAS_ARG, QEMU_OPTION_spice, " [,tls-ciphers=3D]\n" " [,tls-channel=3D[main|display|cursor|inputs|record|playback]]\= n" " [,plaintext-channel=3D[main|display|cursor|inputs|record|playb= ack]]\n" - " [,sasl=3Don|off][,password=3D][,disable-ticketing=3Don= |off]\n" + " [,sasl=3Don|off][,disable-ticketing=3Don|off]\n" + " [,password=3D][,password-secret=3D]\n" " [,image-compression=3D[auto_glz|auto_lz|quic|glz|lz|off]]\n" " [,jpeg-wan-compression=3D[auto|never|always]]\n" " [,zlib-glz-wan-compression=3D[auto|never|always]]\n" @@ -1924,9 +1925,13 @@ SRST ``ipv4=3Don|off``; \ ``ipv6=3Don|off``; \ ``unix=3Don|off`` Force using the specified IP version. =20 - ``password=3D`` + ``password=3D`` Set the password you need to authenticate. =20 + ``password-secret=3D`` + Set the ID of the ``secret`` object containing the password + you need to authenticate. + ``sasl=3Don|off`` Require that the client use SASL to authenticate with the spice. The exact choice of authentication method used is controlled --=20 2.29.2 From nobody Fri May 3 18:37:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615873133; cv=none; d=zohomail.com; s=zohoarc; b=HjdQPCB+/3wmRpYDG73Bw/VRXve6PtKe8HXDoD16w9Gyj3FeVE5hYT7/tdzo/jpn3kNVRLM5j9EPebUnCOkfxUfe7hCqDuV2VIzp0COhrrVzMRc4pbenPCDU+uKa31VRceq/4kQEragDCzeIPkHFeS2HFsJZ2LjKUh7Lc7fZ8Sw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615873133; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xnWvRmNfrXErde5y/FWQrJsa3RhhkW7Z5Kme47hvKZk=; b=oFLvHoreV1FdahylV5ZeIcsBizcGvK6sGHEKi7OYcXX6aMp9/PA5hzOAPTK+CrpgvYbbCDKE3dcbJUqTcmi+3x+OIRavA3hb5iL8FlaqEWfPVzIywE+0EY7bx1MckumFz+8mhkhAy2nGBthLEY05PMKDF/3QJdi+pSHXQ/gImlg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 16158731335731022.0204683134988; Mon, 15 Mar 2021 22:38:53 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-200-jXea879hNnSpt9PCEu2dZQ-1; Tue, 16 Mar 2021 01:38:50 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C7C52881280; Tue, 16 Mar 2021 05:38:44 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 96ACA61F5C; Tue, 16 Mar 2021 05:38:44 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 4EBB21800B9B; Tue, 16 Mar 2021 05:38:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12G5cL4Q016989 for ; Tue, 16 Mar 2021 01:38:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6BA1A19701; Tue, 16 Mar 2021 05:38:21 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-141.ams2.redhat.com [10.36.112.141]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CBFC146; Tue, 16 Mar 2021 05:38:14 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 3DDFA1800612; Tue, 16 Mar 2021 06:38:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615873132; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=xnWvRmNfrXErde5y/FWQrJsa3RhhkW7Z5Kme47hvKZk=; b=A8IYb1mmF/MFqoT1lCReOpL4oM7H1nv76SIgRCKwWdLgT/gmqOxIWbudpwIN6bPPkot7jV CCiYCzvRPtcJ2IoFSbW9GWyZFOLAzoapXve3laoP0gCJpMJcDupgUnqw9WCYbjcDGr/HhG dz/nRDOGQf0MqA3onLlxXaCQs2N6XyI= X-MC-Unique: jXea879hNnSpt9PCEu2dZQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 03/11] ui: deprecate "password" option for SPICE server Date: Tue, 16 Mar 2021 06:38:05 +0100 Message-Id: <20210316053813.1719442-4-kraxel@redhat.com> In-Reply-To: <20210316053813.1719442-1-kraxel@redhat.com> References: <20210316053813.1719442-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, Peter Maydell , Gerd Hoffmann X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) From: Daniel P. Berrang=C3=A9 With the new "password-secret" option, there is no reason to use the old inecure "password" option with -spice, so it can be deprecated. Signed-off-by: Daniel P. Berrang=C3=A9 Message-Id: <20210311114343.439820-4-berrange@redhat.com> Signed-off-by: Gerd Hoffmann --- ui/spice-core.c | 2 ++ docs/system/deprecated.rst | 8 ++++++++ qemu-options.hx | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/ui/spice-core.c b/ui/spice-core.c index b9d8aced91df..272d19b0c152 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -686,6 +686,8 @@ static void qemu_spice_init(void) } else { str =3D qemu_opt_get(opts, "password"); if (str) { + warn_report("'password' option is deprecated and insecure, " + "use 'password-secret' instead"); password =3D g_strdup(str); } } diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst index 5e3a31c12361..8cba672a7b4a 100644 --- a/docs/system/deprecated.rst +++ b/docs/system/deprecated.rst @@ -174,6 +174,14 @@ Input parameters that take a size value should only us= e a size suffix the value is hexadecimal. That is, '0x20M' is deprecated, and should be written either as '32M' or as '0x2000000'. =20 +``-spice password=3Dstring`` (since 6.0) +'''''''''''''''''''''''''''''''''''''' + +This option is insecure because the SPICE password remains visible in +the process listing. This is replaced by the new ``password-secret`` +option which lets the password be securely provided on the command +line using a ``secret`` object instance. + QEMU Machine Protocol (QMP) commands ------------------------------------ =20 diff --git a/qemu-options.hx b/qemu-options.hx index a98f8e84a29d..4da3f4f48c03 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1928,6 +1928,10 @@ SRST ``password=3D`` Set the password you need to authenticate. =20 + This option is deprecated and insecure because it leaves the + password visible in the process listing. Use ``password-secret`` + instead. + ``password-secret=3D`` Set the ID of the ``secret`` object containing the password you need to authenticate. --=20 2.29.2 From nobody Fri May 3 18:37:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615873117; cv=none; d=zohomail.com; s=zohoarc; b=Mwx18o/owZ2hzYKqQanT8ytuKYsf3xHmmLBbd/+arGzpA+Mu8xP/IbYrOORL7hmkPpNZ7eF6hFbse9ZkW4+7FFqlV2tZmN6yUX73CAGAf3odWivTP/q+KCLhoA/GraV60e0UZGPB/3Rwb+epY+JuyMGDSSlDv7bFtS2ID1nCwEI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615873117; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=slQRAQnwb8e497B+A+MYPijsPTYoxhqlaDg2Qs1YWUI=; b=KA81+tSzKxJ6eMp6i0qREAySH2/PzYlSvqng6a1CR0f1k4Rxs/Oi17/86bhoLxqqavHBrLc3JhCqfB6TNstV5KhU4yXcrZlMHMcT3ocdqYI6gpfEdDrh4FfGiA4VEpO5PTMJYasXZJbRE7XdQQWkWabxLlTDa3YpMHYGm063XvQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1615873117885401.454679722068; Mon, 15 Mar 2021 22:38:37 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-433-kL10IowZOvy_8ZHR4bMwng-1; Tue, 16 Mar 2021 01:38:33 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9B4AF1084C8C; Tue, 16 Mar 2021 05:38:27 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2ADA25C261; Tue, 16 Mar 2021 05:38:27 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 4244F57DC1; Tue, 16 Mar 2021 05:38:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12G5cLL0016999 for ; Tue, 16 Mar 2021 01:38:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id 83B955D768; Tue, 16 Mar 2021 05:38:21 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-141.ams2.redhat.com [10.36.112.141]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CE4B762A0C; Tue, 16 Mar 2021 05:38:14 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 489EF180063D; Tue, 16 Mar 2021 06:38:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615873116; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=slQRAQnwb8e497B+A+MYPijsPTYoxhqlaDg2Qs1YWUI=; b=Bf3XkcbrZzgKsdb9t1zYcg7BAo7l4xvLV3+M6b1RbnqL49RzoGumnXlgPgKLwdi18GZyzm bdWs87qKTIzT093ugO5Fwfq8BraJLPZMTyOSOih/tFDusr1Jff1NVpj5Ticf5Jtpx+fL/k Q8oOXNE03eSl9V9sJgEYJhR2LND1WUQ= X-MC-Unique: kL10IowZOvy_8ZHR4bMwng-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 04/11] opengl: Do not convert format with glTexImage2D on OpenGL ES Date: Tue, 16 Mar 2021 06:38:06 +0100 Message-Id: <20210316053813.1719442-5-kraxel@redhat.com> In-Reply-To: <20210316053813.1719442-1-kraxel@redhat.com> References: <20210316053813.1719442-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, Peter Maydell , Gerd Hoffmann , Akihiko Odaki X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Akihiko Odaki OpenGL ES does not support conversion from the given data format to the internal format with glTexImage2D. Use the given data format as the internal format, and ignore the given alpha channels with GL_TEXTURE_SWIZZLE_A in case the format contains alpha channels. Signed-off-by: Akihiko Odaki Message-Id: <20210219094803.90860-1-akihiko.odaki@gmail.com> Signed-off-by: Gerd Hoffmann --- ui/console-gl.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/ui/console-gl.c b/ui/console-gl.c index 0a6478161fed..7c9894a51d99 100644 --- a/ui/console-gl.c +++ b/ui/console-gl.c @@ -73,11 +73,20 @@ void surface_gl_create_texture(QemuGLShader *gls, glBindTexture(GL_TEXTURE_2D, surface->texture); glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, surface_stride(surface) / surface_bytes_per_pixel(surfac= e)); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, - surface_width(surface), - surface_height(surface), - 0, surface->glformat, surface->gltype, - surface_data(surface)); + if (epoxy_is_desktop_gl()) { + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, + surface_width(surface), + surface_height(surface), + 0, surface->glformat, surface->gltype, + surface_data(surface)); + } else { + glTexImage2D(GL_TEXTURE_2D, 0, surface->glformat, + surface_width(surface), + surface_height(surface), + 0, surface->glformat, surface->gltype, + surface_data(surface)); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_ONE); + } =20 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); --=20 2.29.2 From nobody Fri May 3 18:37:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615873134; cv=none; d=zohomail.com; s=zohoarc; b=UTvvMeIgjYbiKhyrciaV5fSWi9qcmThCkTMmA95VhIu14Y85ph2JOAKuIIGDCrcRmh9QpvTlz5rrG7uS+txfSfxinZWDJcd1o25fupIOteFofTYE1pGijR57BPz62LptoCMPAbPFnLK2XCW609YHzr2+x2/Wiq6+SQ6xAZnz8Z0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615873134; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=1bgTBjz/F4v1Gv2UDYz0PLiO8IJC3N0/Nliz+enLVyQ=; b=BkeTaX01sN20CN4c+aW/NnMFeBf9vS0cZZw61+pKqgN4dVO9LNeue5kYGOQ+kjo1COosIprv9NBVvPIkppMoG/ywdeC/A0OtMh0QdPhFGPwNgFtoujFdiv3WGTrq6PHWlD3kO7K/j9xyooFVdDM67qNv9TyOCX6qg325LPjJXaY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1615873134049512.0506731348912; Mon, 15 Mar 2021 22:38:54 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-421-rJ69C0O0OdqLqoF2CZzFdA-1; Tue, 16 Mar 2021 01:38:50 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CDE2C18460E2; Tue, 16 Mar 2021 05:38:44 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9875662A6F; Tue, 16 Mar 2021 05:38:44 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 4E92E1800B9A; Tue, 16 Mar 2021 05:38:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12G5cNq0017016 for ; Tue, 16 Mar 2021 01:38:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1E6B96A039; Tue, 16 Mar 2021 05:38:23 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-141.ams2.redhat.com [10.36.112.141]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D9B7D6EF51; Tue, 16 Mar 2021 05:38:22 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 5399518007BD; Tue, 16 Mar 2021 06:38:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615873133; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=1bgTBjz/F4v1Gv2UDYz0PLiO8IJC3N0/Nliz+enLVyQ=; b=G9cNQnjPi1Bb5pcC/CwmXPK2q2KkzcVBAjIrI3FI9VWM1DuuCsLAoExkI03p4QF5EfBNpM VW4wGf97RdtN1Dz6c+ckmwoO3tkMKdLLQyFwlXbAk85ZgMJ2dw69Fof/EVXbGnq2qIy5pH S9SI6S69NgK402OYADszL5vR7AcmFFk= X-MC-Unique: rJ69C0O0OdqLqoF2CZzFdA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 05/11] ui/cocoa: Do not exit immediately after shutdown Date: Tue, 16 Mar 2021 06:38:07 +0100 Message-Id: <20210316053813.1719442-6-kraxel@redhat.com> In-Reply-To: <20210316053813.1719442-1-kraxel@redhat.com> References: <20210316053813.1719442-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, Peter Maydell , Gerd Hoffmann , Akihiko Odaki X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Akihiko Odaki ui/cocoa used to call exit immediately after calling qemu_system_shutdown_request, which prevents QEMU from actually perfoming system shutdown. Just sleep forever, and wait QEMU to call exit and kill the Cocoa thread. Signed-off-by: Akihiko Odaki Message-Id: <20210219111652.20623-1-akihiko.odaki@gmail.com> Signed-off-by: Gerd Hoffmann --- ui/cocoa.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index a7848ae0a30e..9da0e884b712 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -1115,7 +1115,13 @@ QemuCocoaView *cocoaView; COCOA_DEBUG("QemuCocoaAppController: applicationWillTerminate\n"); =20 qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_UI); - exit(0); + + /* + * Sleep here, because returning will cause OSX to kill us + * immediately; the QEMU main loop will handle the shutdown + * request and terminate the process. + */ + [NSThread sleepForTimeInterval:INFINITY]; } =20 - (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)t= heApplication --=20 2.29.2 From nobody Fri May 3 18:37:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615873145; cv=none; d=zohomail.com; s=zohoarc; b=TtPtFDmOeyfTc6mgYuUEu6UCcx3/4N7OW84cCOwHG5405bwcVJDYyjYVZa0czUqUI3lWw6K5ltOC8Qum0Au2Oe5siwGtqqaY70lCRex1rgVk4xyhhUHPCvfQlW92+b6WpHkj6rit+tQSiUsVsj/LdytCtzXwBZlw8Kx2K2WnYDg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615873145; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3h+DkWCO2qWsmDungvo9al4+6SMrY9LNYHI4IYztbVU=; b=CDl9jKbfhy0gqTXCoJ5Z/unaQ6Eh4WLM+3Z2zF3+T6gi7VmqPJZUBeTn3EH/Br3LthErPHXLdCzTS2Sa0uJI11C6pOUJyvWFPpc53QgIfaMsjRiqQHZ3fYpAThXDt/VO9j31GnrY5L6uO1jEqp7dPn1gJfggstUyP2/7StJ/Byo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1615873145527595.2846053944313; Mon, 15 Mar 2021 22:39:05 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-32-MaIG-l-pNnGy3JwbZEnoyQ-1; Tue, 16 Mar 2021 01:38:58 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 422CB81747B; Tue, 16 Mar 2021 05:38:51 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1B2F850233; Tue, 16 Mar 2021 05:38:51 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D2B6F57DCB; Tue, 16 Mar 2021 05:38:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12G5cX4m017105 for ; Tue, 16 Mar 2021 01:38:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id 845B210023BE; Tue, 16 Mar 2021 05:38:33 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-141.ams2.redhat.com [10.36.112.141]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D66DB100164C; Tue, 16 Mar 2021 05:38:22 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 6078518007BE; Tue, 16 Mar 2021 06:38:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615873144; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=3h+DkWCO2qWsmDungvo9al4+6SMrY9LNYHI4IYztbVU=; b=cNQ68XGpQunM7zEiauRqm2Nx2V/+We+B8FRg+IvQZhQK6O7NpLCZccmzpDNk/bFGAZua2v Sl/FmF4rt1D3O2STprQwlVdVrYdEryG0ucirQwrO32bVlCFLcohCqYYTEXYNT2EEJJ58id snvdGSUpocOd1GwWQ8+apPSu2Cjq4aE= X-MC-Unique: MaIG-l-pNnGy3JwbZEnoyQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 06/11] ui: add more trace points for VNC client/server messages Date: Tue, 16 Mar 2021 06:38:08 +0100 Message-Id: <20210316053813.1719442-7-kraxel@redhat.com> In-Reply-To: <20210316053813.1719442-1-kraxel@redhat.com> References: <20210316053813.1719442-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, Peter Maydell , Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) From: Daniel P. Berrang=C3=A9 This adds trace points for desktop size and audio related messages. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20210311182957.486939-2-berrange@redhat.com> Signed-off-by: Gerd Hoffmann --- ui/vnc.c | 21 +++++++++++++++++++-- ui/trace-events | 9 +++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/ui/vnc.c b/ui/vnc.c index e8e3426a65c4..7291429c04cf 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -659,6 +659,9 @@ void vnc_framebuffer_update(VncState *vs, int x, int y,= int w, int h, =20 static void vnc_desktop_resize_ext(VncState *vs, int reject_reason) { + trace_vnc_msg_server_ext_desktop_resize( + vs, vs->ioc, vs->client_width, vs->client_height, reject_reason); + vnc_lock_output(vs); vnc_write_u8(vs, VNC_MSG_SERVER_FRAMEBUFFER_UPDATE); vnc_write_u8(vs, 0); @@ -705,6 +708,9 @@ static void vnc_desktop_resize(VncState *vs) return; } =20 + trace_vnc_msg_server_desktop_resize( + vs, vs->ioc, vs->client_width, vs->client_height); + vnc_lock_output(vs); vnc_write_u8(vs, VNC_MSG_SERVER_FRAMEBUFFER_UPDATE); vnc_write_u8(vs, 0); @@ -1182,6 +1188,7 @@ static void audio_capture_notify(void *opaque, audcno= tification_e cmd) assert(vs->magic =3D=3D VNC_MAGIC); switch (cmd) { case AUD_CNOTIFY_DISABLE: + trace_vnc_msg_server_audio_end(vs, vs->ioc); vnc_lock_output(vs); vnc_write_u8(vs, VNC_MSG_SERVER_QEMU); vnc_write_u8(vs, VNC_MSG_SERVER_QEMU_AUDIO); @@ -1191,6 +1198,7 @@ static void audio_capture_notify(void *opaque, audcno= tification_e cmd) break; =20 case AUD_CNOTIFY_ENABLE: + trace_vnc_msg_server_audio_begin(vs, vs->ioc); vnc_lock_output(vs); vnc_write_u8(vs, VNC_MSG_SERVER_QEMU); vnc_write_u8(vs, VNC_MSG_SERVER_QEMU_AUDIO); @@ -1210,6 +1218,7 @@ static void audio_capture(void *opaque, const void *b= uf, int size) VncState *vs =3D opaque; =20 assert(vs->magic =3D=3D VNC_MAGIC); + trace_vnc_msg_server_audio_data(vs, vs->ioc, buf, size); vnc_lock_output(vs); if (vs->output.offset < vs->throttle_output_offset) { vnc_write_u8(vs, VNC_MSG_SERVER_QEMU); @@ -2454,9 +2463,11 @@ static int protocol_client_msg(VncState *vs, uint8_t= *data, size_t len) =20 switch (read_u16 (data, 2)) { case VNC_MSG_CLIENT_QEMU_AUDIO_ENABLE: + trace_vnc_msg_client_audio_enable(vs, vs->ioc); audio_add(vs); break; case VNC_MSG_CLIENT_QEMU_AUDIO_DISABLE: + trace_vnc_msg_client_audio_disable(vs, vs->ioc); audio_del(vs); break; case VNC_MSG_CLIENT_QEMU_AUDIO_SET_FORMAT: @@ -2492,6 +2503,8 @@ static int protocol_client_msg(VncState *vs, uint8_t = *data, size_t len) break; } vs->as.freq =3D freq; + trace_vnc_msg_client_audio_format( + vs, vs->ioc, vs->as.fmt, vs->as.nchannels, vs->as.freq= ); break; default: VNC_DEBUG("Invalid audio message %d\n", read_u8(data, 4)); @@ -2510,6 +2523,7 @@ static int protocol_client_msg(VncState *vs, uint8_t = *data, size_t len) { size_t size; uint8_t screens; + int w, h; =20 if (len < 8) { return 8; @@ -2520,12 +2534,15 @@ static int protocol_client_msg(VncState *vs, uint8_= t *data, size_t len) if (len < size) { return size; } + w =3D read_u16(data, 2); + h =3D read_u16(data, 4); =20 + trace_vnc_msg_client_set_desktop_size(vs, vs->ioc, w, h, screens); if (dpy_ui_info_supported(vs->vd->dcl.con)) { QemuUIInfo info; memset(&info, 0, sizeof(info)); - info.width =3D read_u16(data, 2); - info.height =3D read_u16(data, 4); + info.width =3D w; + info.height =3D h; dpy_set_ui_info(vs->vd->dcl.con, &info); vnc_desktop_resize_ext(vs, 4 /* Request forwarded */); } else { diff --git a/ui/trace-events b/ui/trace-events index 0ffcdb4408a6..bd8f8a9d186a 100644 --- a/ui/trace-events +++ b/ui/trace-events @@ -37,6 +37,15 @@ vnc_key_event_ext(bool down, int sym, int keycode, const= char *name) "down %d, s vnc_key_event_map(bool down, int sym, int keycode, const char *name) "down= %d, sym 0x%x -> keycode 0x%x [%s]" vnc_key_sync_numlock(bool on) "%d" vnc_key_sync_capslock(bool on) "%d" +vnc_msg_server_audio_begin(void *state, void *ioc) "VNC server msg audio b= egin state=3D%p ioc=3D%p" +vnc_msg_server_audio_end(void *state, void *ioc) "VNC server msg audio end= state=3D%p ioc=3D%p" +vnc_msg_server_audio_data(void *state, void *ioc, const void *buf, size_t = len) "VNC server msg audio data state=3D%p ioc=3D%p buf=3D%p len=3D%zd" +vnc_msg_server_desktop_resize(void *state, void *ioc, int width, int heigh= t) "VNC server msg ext resize state=3D%p ioc=3D%p size=3D%dx%d" +vnc_msg_server_ext_desktop_resize(void *state, void *ioc, int width, int h= eight, int reason) "VNC server msg ext resize state=3D%p ioc=3D%p size=3D%d= x%d reason=3D%d" +vnc_msg_client_audio_enable(void *state, void *ioc) "VNC client msg audio = enable state=3D%p ioc=3D%p" +vnc_msg_client_audio_disable(void *state, void *ioc) "VNC client msg audio= disable state=3D%p ioc=3D%p" +vnc_msg_client_audio_format(void *state, void *ioc, int fmt, int channels,= int freq) "VNC client msg audio format state=3D%p ioc=3D%p fmt=3D%d channe= ls=3D%d freq=3D%d" +vnc_msg_client_set_desktop_size(void *state, void *ioc, int width, int hei= ght, int screens) "VNC client msg set desktop size state=3D%p ioc=3D%p siz= e=3D%dx%d screens=3D%d" vnc_client_eof(void *state, void *ioc) "VNC client EOF state=3D%p ioc=3D%p" vnc_client_io_error(void *state, void *ioc, const char *msg) "VNC client I= /O error state=3D%p ioc=3D%p errmsg=3D%s" vnc_client_connect(void *state, void *ioc) "VNC client connect state=3D%p = ioc=3D%p" --=20 2.29.2 From nobody Fri May 3 18:37:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615873210; cv=none; d=zohomail.com; s=zohoarc; b=V+eSkdwh1NYMa1sVKnlzOnuEdjwcN2LbyVSoZGXJQP67VUvqKj4hVpyK1ZQYgv8w7BTqjPV9uvcTFji77YRL1h1VleLwvM99Rs9EfSnKo24BySIm2fPNrHD5hJsBiB07arLKbHky14H0bA08kLNtVLyhDIUtowili7K9isPiyMI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615873210; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=anE2ivEZrOaAsrwcDX5OEL5gPRBQCj53cB0m7iPzBPI=; b=aqosFcgCRceZ0iuls0sDcLKD7jC1u6cwchsQuWWf6Qox4uRNIQo00u1mfqlveLdxYJOuYHCxMZyjT/eNWp85qO6GSV9n/xEMrFgKH+wgA8Y8snRDcsq2NlojW+hGUh+UnqozNZUY47tk+gnAecC65ahoouYsL3AEbZt/3wiVKYE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1615873210669377.9590653015433; Mon, 15 Mar 2021 22:40:10 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-32-cpekHUvmNz-hnPRU3AF54g-1; Tue, 16 Mar 2021 01:38:58 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 413911846117; Tue, 16 Mar 2021 05:38:51 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0D7801F04E; Tue, 16 Mar 2021 05:38:51 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C25F7180223D; Tue, 16 Mar 2021 05:38:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12G5cQHJ017050 for ; Tue, 16 Mar 2021 01:38:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 79F783805; Tue, 16 Mar 2021 05:38:26 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-141.ams2.redhat.com [10.36.112.141]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DE52861F5C; Tue, 16 Mar 2021 05:38:22 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 6DA0718007BF; Tue, 16 Mar 2021 06:38:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615873209; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=anE2ivEZrOaAsrwcDX5OEL5gPRBQCj53cB0m7iPzBPI=; b=BYY++VUMiLDxCQH12Gbe8QxTVtnChy8Yu7Pg+wgsHpVjl3wSeL/k+z0iQ5dxmn4BxV5ZRg 7ddiIyctrE83qVF8qcPsaKtePlcB80/gGQG1Hi7ER4U8YOI7JXqDOUCmt/XzRPPOI7kyap VaGN44RoMkmWeB131v0nM/56j1qekWU= X-MC-Unique: cpekHUvmNz-hnPRU3AF54g-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 07/11] ui: avoid sending framebuffer updates outside client desktop bounds Date: Tue, 16 Mar 2021 06:38:09 +0100 Message-Id: <20210316053813.1719442-8-kraxel@redhat.com> In-Reply-To: <20210316053813.1719442-1-kraxel@redhat.com> References: <20210316053813.1719442-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, Peter Maydell , Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) From: Daniel P. Berrang=C3=A9 We plan framebuffer update rects based on the VNC server surface. If the client doesn't support desktop resize, then the client bounds may differ from the server surface bounds. VNC clients may become upset if we then send an update message outside the bounds of the client desktop. This takes the approach of clamping the rectangles from the worker thread immediately before sending them. This may sometimes results in sending a framebuffer update message with zero rectangles. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20210311182957.486939-3-berrange@redhat.com> Signed-off-by: Gerd Hoffmann --- ui/vnc-jobs.c | 44 ++++++++++++++++++++++++++++++++++++++++---- ui/trace-events | 5 +++++ 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/ui/vnc-jobs.c b/ui/vnc-jobs.c index dbbfbefe5619..4562bf89288e 100644 --- a/ui/vnc-jobs.c +++ b/ui/vnc-jobs.c @@ -32,6 +32,7 @@ #include "qemu/sockets.h" #include "qemu/main-loop.h" #include "block/aio.h" +#include "trace.h" =20 /* * Locking: @@ -94,6 +95,8 @@ int vnc_job_add_rect(VncJob *job, int x, int y, int w, in= t h) { VncRectEntry *entry =3D g_new0(VncRectEntry, 1); =20 + trace_vnc_job_add_rect(job->vs, job, x, y, w, h); + entry->rect.x =3D x; entry->rect.y =3D y; entry->rect.w =3D w; @@ -190,6 +193,8 @@ static void vnc_async_encoding_start(VncState *orig, Vn= cState *local) local->zlib =3D orig->zlib; local->hextile =3D orig->hextile; local->zrle =3D orig->zrle; + local->client_width =3D orig->client_width; + local->client_height =3D orig->client_height; } =20 static void vnc_async_encoding_end(VncState *orig, VncState *local) @@ -202,6 +207,34 @@ static void vnc_async_encoding_end(VncState *orig, Vnc= State *local) orig->lossy_rect =3D local->lossy_rect; } =20 +static bool vnc_worker_clamp_rect(VncState *vs, VncJob *job, VncRect *rect) +{ + trace_vnc_job_clamp_rect(vs, job, rect->x, rect->y, rect->w, rect->h); + + if (rect->x >=3D vs->client_width) { + goto discard; + } + rect->w =3D MIN(vs->client_width - rect->x, rect->w); + if (rect->w =3D=3D 0) { + goto discard; + } + + if (rect->y >=3D vs->client_height) { + goto discard; + } + rect->h =3D MIN(vs->client_height - rect->y, rect->h); + if (rect->h =3D=3D 0) { + goto discard; + } + + trace_vnc_job_clamped_rect(vs, job, rect->x, rect->y, rect->w, rect->h= ); + return true; + + discard: + trace_vnc_job_discard_rect(vs, job, rect->x, rect->y, rect->w, rect->h= ); + return false; +} + static int vnc_worker_thread_loop(VncJobQueue *queue) { VncJob *job; @@ -260,14 +293,17 @@ static int vnc_worker_thread_loop(VncJobQueue *queue) goto disconnected; } =20 - n =3D vnc_send_framebuffer_update(&vs, entry->rect.x, entry->rect.= y, - entry->rect.w, entry->rect.h); + if (vnc_worker_clamp_rect(&vs, job, &entry->rect)) { + n =3D vnc_send_framebuffer_update(&vs, entry->rect.x, entry->r= ect.y, + entry->rect.w, entry->rect.h); =20 - if (n >=3D 0) { - n_rectangles +=3D n; + if (n >=3D 0) { + n_rectangles +=3D n; + } } g_free(entry); } + trace_vnc_job_nrects(&vs, job, n_rectangles); vnc_unlock_display(job->vs->vd); =20 /* Put n_rectangles at the beginning of the message */ diff --git a/ui/trace-events b/ui/trace-events index bd8f8a9d186a..3838ae2d849a 100644 --- a/ui/trace-events +++ b/ui/trace-events @@ -59,6 +59,11 @@ vnc_client_throttle_audio(void *state, void *ioc, size_t= offset) "VNC client thr vnc_client_unthrottle_forced(void *state, void *ioc) "VNC client unthrottl= e forced offset state=3D%p ioc=3D%p" vnc_client_unthrottle_incremental(void *state, void *ioc, size_t offset) "= VNC client unthrottle incremental state=3D%p ioc=3D%p offset=3D%zu" vnc_client_output_limit(void *state, void *ioc, size_t offset, size_t thre= shold) "VNC client output limit state=3D%p ioc=3D%p offset=3D%zu threshold= =3D%zu" +vnc_job_add_rect(void *state, void *job, int x, int y, int w, int h) "VNC = add rect state=3D%p job=3D%p offset=3D%d,%d size=3D%dx%d" +vnc_job_discard_rect(void *state, void *job, int x, int y, int w, int h) "= VNC job discard rect state=3D%p job=3D%p offset=3D%d,%d size=3D%dx%d" +vnc_job_clamp_rect(void *state, void *job, int x, int y, int w, int h) "VN= C job clamp rect state=3D%p job=3D%p offset=3D%d,%d size=3D%dx%d" +vnc_job_clamped_rect(void *state, void *job, int x, int y, int w, int h) "= VNC job clamp rect state=3D%p job=3D%p offset=3D%d,%d size=3D%dx%d" +vnc_job_nrects(void *state, void *job, int nrects) "VNC job state=3D%p job= =3D%p nrects=3D%d" vnc_auth_init(void *display, int websock, int auth, int subauth) "VNC auth= init state=3D%p websock=3D%d auth=3D%d subauth=3D%d" vnc_auth_start(void *state, int method) "VNC client auth start state=3D%p = method=3D%d" vnc_auth_pass(void *state, int method) "VNC client auth passed state=3D%p = method=3D%d" --=20 2.29.2 From nobody Fri May 3 18:37:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615873213; cv=none; d=zohomail.com; s=zohoarc; b=fTnruyj+3vUROS8JvRCkeeFndzr3KSlMRhooSTUdksS1l0xG/AhWeSY7uZqWEJQkF/LPv8Y+ZhYfgppPpDoKin8STv+ia0CTYqU/n/p1uNj/f1ngw3/8fpvWh5p47h2n1R1B2JfggXxKeMH0GAOGSROC7rP2Iskn+Az+hBuP29g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615873213; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=o3kJ2GjefkHzv+6HrtD0bv6/iSo2KdLQZCkMYpJ23Vk=; b=Gmr+TD3OYBM39Zv7OXkELYzP8pH/+Dg/vpNmIY22Iv0KjJYWlCLJey04oYpMBwrJkEu4nAXcxJmlCAGD+tp0rmEa5I45OXmTHl99apM1W90ZW71abE1b7G+e8mIVK/aajkdyxaMvGWYkLKl7QsGKXeWjmlt1zdEjGSdLJoxXqVs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1615873213197347.03443838276655; Mon, 15 Mar 2021 22:40:13 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-455-Wso_cys7OS-_MTdAoUYd2g-1; Tue, 16 Mar 2021 01:38:57 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 36FB6100C62C; Tue, 16 Mar 2021 05:38:51 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 128E46C32F; Tue, 16 Mar 2021 05:38:51 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C751357DCA; Tue, 16 Mar 2021 05:38:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12G5cQcJ017049 for ; Tue, 16 Mar 2021 01:38:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 775121992D; Tue, 16 Mar 2021 05:38:26 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-141.ams2.redhat.com [10.36.112.141]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E9B671F04B; Tue, 16 Mar 2021 05:38:22 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 787F41800840; Tue, 16 Mar 2021 06:38:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615873212; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=o3kJ2GjefkHzv+6HrtD0bv6/iSo2KdLQZCkMYpJ23Vk=; b=UQu6jzTV64f5Hnt+Epd4nukf0c7VmBXwbqtEuU22x6xTExS6y15Ji7NaAa7DA/zQonkiyK HKecgOG+s9fWLNQsu5hbq7y5hsVFD1czr6voqOgSlwQ6UlSyxIeV04MUFw0eI5yTPmc9hD p7IPdTX6HP/64QpTqazOMSyCwjMtwDs= X-MC-Unique: Wso_cys7OS-_MTdAoUYd2g-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 08/11] ui: use client width/height in WMVi message Date: Tue, 16 Mar 2021 06:38:10 +0100 Message-Id: <20210316053813.1719442-9-kraxel@redhat.com> In-Reply-To: <20210316053813.1719442-1-kraxel@redhat.com> References: <20210316053813.1719442-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, Peter Maydell , Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) From: Daniel P. Berrang=C3=A9 The WMVi message is supposed to provide the same width/height information as the regular desktop resize and extended desktop resize messages. There can be times where the client width and height are different from the pixman surface dimensions. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20210311182957.486939-4-berrange@redhat.com> Signed-off-by: Gerd Hoffmann --- ui/vnc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/vnc.c b/ui/vnc.c index 7291429c04cf..8c9890b3cdc4 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -2319,8 +2319,8 @@ static void vnc_colordepth(VncState *vs) vnc_write_u8(vs, 0); vnc_write_u16(vs, 1); /* number of rects */ vnc_framebuffer_update(vs, 0, 0, - pixman_image_get_width(vs->vd->server), - pixman_image_get_height(vs->vd->server), + vs->client_width, + vs->client_height, VNC_ENCODING_WMVi); pixel_format_message(vs); vnc_unlock_output(vs); --=20 2.29.2 From nobody Fri May 3 18:37:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615873145; cv=none; d=zohomail.com; s=zohoarc; b=XkTUah/Df7Ehh76Iopv3gtO47Xo464qrXUP2is1/Rh/N9V8lTZDbgbJ069X7VKYS/OmoR0hkt+1GTDV0XK/cku3VWW4iG9vPFbM3A/ezoI8ToLp9xfpPmqo8/41S12pdI2Ge36PnPyCCIUVWQFMHODRWBgix1UXaC+JumKE8UhM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615873145; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=eT73Zv6nbeUUWWKYtRetEVwL1cjukwGLaIyWzLuBOoM=; b=SgNHGMdbidFQRHxblaNlPgIYuylUZCvwXDMEy//ZtYbrQWlTA0DaSxePXR/7zya6hU2+fF0M3AyQBGvRM7IFJGmZac3jjjhz/hvMCw9ikrWC/I64ELLe5RCMg+QL+ZQ9bekSL0hX+IfJUUvBQl0El1qfUhp8VbUoOQ1tJfe5EtY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1615873145915230.10301652560668; Mon, 15 Mar 2021 22:39:05 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-362-iDGjZ2jkNTqwNP6vAC_Rlg-1; Tue, 16 Mar 2021 01:39:01 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 48EDE184610E; Tue, 16 Mar 2021 05:38:54 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1984A100164C; Tue, 16 Mar 2021 05:38:54 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id CBBE657DD0; Tue, 16 Mar 2021 05:38:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12G5cQx7017059 for ; Tue, 16 Mar 2021 01:38:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id A1FF646; Tue, 16 Mar 2021 05:38:26 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-141.ams2.redhat.com [10.36.112.141]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EA2B91F04E; Tue, 16 Mar 2021 05:38:22 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 871891800841; Tue, 16 Mar 2021 06:38:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615873144; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=eT73Zv6nbeUUWWKYtRetEVwL1cjukwGLaIyWzLuBOoM=; b=IK7H6VOabLER/UywtZUyE2mgQeTj0IVyGsVBvny9ebIqOIp1iaHvOjPi2HI8ulzt3Wc6EQ afgutFJf+ecMq4Hjnz5uqhXjjsVVBhdhrKg4kkU4H5MKn1Ed+ib7HAbAU1bP/qSiQtvrwg PS18h3nN8yZ+y/sCMaqeeDLAC/moTGA= X-MC-Unique: iDGjZ2jkNTqwNP6vAC_Rlg-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 09/11] ui: honour the actual guest display dimensions without rounding Date: Tue, 16 Mar 2021 06:38:11 +0100 Message-Id: <20210316053813.1719442-10-kraxel@redhat.com> In-Reply-To: <20210316053813.1719442-1-kraxel@redhat.com> References: <20210316053813.1719442-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, Peter Maydell , Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) From: Daniel P. Berrang=C3=A9 A long time ago the VNC server code had some memory corruption fixes done in: commit bea60dd7679364493a0d7f5b54316c767cf894ef Author: Peter Lieven Date: Mon Jun 30 10:57:51 2014 +0200 ui/vnc: fix potential memory corruption issues One of the implications of the fix was that the VNC server would have a thin black bad down the right hand side if the guest desktop width was not a multiple of 16. In practice this was a non-issue since the VNC server was always honouring a guest specified resolution and guests essentially always pick from a small set of sane resolutions likely in real world hardware. We recently introduced support for the extended desktop resize extension and as a result the VNC client has ability to specify an arbitrary desktop size and the guest OS may well honour it exactly. As a result we no longer have any guarantee that the width will be a multiple of 16, and so when resizing the desktop we have a 93% chance of getting the black bar on the right hand size. The VNC server maintains three different desktop dimensions 1. The guest surface 2. The server surface 3. The client desktop The requirement for the width to be a multiple of 16 only applies to item 2, the server surface, for the purpose of doing dirty bitmap tracking. Normally we will set the client desktop size to always match the server surface size, but that's not a strict requirement. In order to cope with clients that don't support the desktop size encoding, we already allow for the client desktop to be a different size that the server surface. Thus we can trivially eliminate the black bar, but setting the client desktop size to be the un-rounded server surface size - the so called "true width". Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20210311182957.486939-5-berrange@redhat.com> Signed-off-by: Gerd Hoffmann --- ui/vnc.h | 1 + ui/vnc.c | 23 +++++++++++++++++++---- ui/trace-events | 2 ++ 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/ui/vnc.h b/ui/vnc.h index 116463d5f099..d4f3e1555809 100644 --- a/ui/vnc.h +++ b/ui/vnc.h @@ -164,6 +164,7 @@ struct VncDisplay =20 struct VncSurface guest; /* guest visible surface (aka ds->surface) = */ pixman_image_t *server; /* vnc server surface */ + int true_width; /* server surface width before rounding up */ =20 const char *id; QTAILQ_ENTRY(VncDisplay) next; diff --git a/ui/vnc.c b/ui/vnc.c index 8c9890b3cdc4..9c004a11f495 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -608,6 +608,11 @@ static int vnc_width(VncDisplay *vd) VNC_DIRTY_PIXELS_PER_BIT)); } =20 +static int vnc_true_width(VncDisplay *vd) +{ + return MIN(VNC_MAX_WIDTH, surface_width(vd->ds)); +} + static int vnc_height(VncDisplay *vd) { return MIN(VNC_MAX_HEIGHT, surface_height(vd->ds)); @@ -691,16 +696,16 @@ static void vnc_desktop_resize(VncState *vs) !vnc_has_feature(vs, VNC_FEATURE_RESIZE_EXT)))= { return; } - if (vs->client_width =3D=3D pixman_image_get_width(vs->vd->server) && + if (vs->client_width =3D=3D vs->vd->true_width && vs->client_height =3D=3D pixman_image_get_height(vs->vd->server)) { return; } =20 - assert(pixman_image_get_width(vs->vd->server) < 65536 && - pixman_image_get_width(vs->vd->server) >=3D 0); + assert(vs->vd->true_width < 65536 && + vs->vd->true_width >=3D 0); assert(pixman_image_get_height(vs->vd->server) < 65536 && pixman_image_get_height(vs->vd->server) >=3D 0); - vs->client_width =3D pixman_image_get_width(vs->vd->server); + vs->client_width =3D vs->vd->true_width; vs->client_height =3D pixman_image_get_height(vs->vd->server); =20 if (vnc_has_feature(vs, VNC_FEATURE_RESIZE_EXT)) { @@ -774,6 +779,7 @@ static void vnc_update_server_surface(VncDisplay *vd) =20 width =3D vnc_width(vd); height =3D vnc_height(vd); + vd->true_width =3D vnc_true_width(vd); vd->server =3D pixman_image_create_bits(VNC_SERVER_FB_FORMAT, width, height, NULL, 0); @@ -809,13 +815,22 @@ static void vnc_dpy_switch(DisplayChangeListener *dcl, vd->guest.fb =3D pixman_image_ref(surface->image); vd->guest.format =3D surface->format; =20 + if (pageflip) { + trace_vnc_server_dpy_pageflip(vd, + surface_width(surface), + surface_height(surface), + surface_format(surface)); vnc_set_area_dirty(vd->guest.dirty, vd, 0, 0, surface_width(surface), surface_height(surface)); return; } =20 + trace_vnc_server_dpy_recreate(vd, + surface_width(surface), + surface_height(surface), + surface_format(surface)); /* server surface */ vnc_update_server_surface(vd); =20 diff --git a/ui/trace-events b/ui/trace-events index 3838ae2d849a..5d1da6f23668 100644 --- a/ui/trace-events +++ b/ui/trace-events @@ -59,6 +59,8 @@ vnc_client_throttle_audio(void *state, void *ioc, size_t = offset) "VNC client thr vnc_client_unthrottle_forced(void *state, void *ioc) "VNC client unthrottl= e forced offset state=3D%p ioc=3D%p" vnc_client_unthrottle_incremental(void *state, void *ioc, size_t offset) "= VNC client unthrottle incremental state=3D%p ioc=3D%p offset=3D%zu" vnc_client_output_limit(void *state, void *ioc, size_t offset, size_t thre= shold) "VNC client output limit state=3D%p ioc=3D%p offset=3D%zu threshold= =3D%zu" +vnc_server_dpy_pageflip(void *dpy, int w, int h, int fmt) "VNC server dpy = pageflip dpy=3D%p size=3D%dx%d fmt=3D%d" +vnc_server_dpy_recreate(void *dpy, int w, int h, int fmt) "VNC server dpy = recreate dpy=3D%p size=3D%dx%d fmt=3D%d" vnc_job_add_rect(void *state, void *job, int x, int y, int w, int h) "VNC = add rect state=3D%p job=3D%p offset=3D%d,%d size=3D%dx%d" vnc_job_discard_rect(void *state, void *job, int x, int y, int w, int h) "= VNC job discard rect state=3D%p job=3D%p offset=3D%d,%d size=3D%dx%d" vnc_job_clamp_rect(void *state, void *job, int x, int y, int w, int h) "VN= C job clamp rect state=3D%p job=3D%p offset=3D%d,%d size=3D%dx%d" --=20 2.29.2 From nobody Fri May 3 18:37:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615873139; cv=none; d=zohomail.com; s=zohoarc; b=E8dbqPcy5joQyNMKQoUNsc9v2VX+IKy2chLaGbqJ9pTdnb1+bjrXsR+Hi/a/UQ1XB7en00XD/TFmlUaYzIb+FGQrzREd/e20w8P6XCPjS+VKw6z96+AMyVujGaAfDN3XzQ15OVLXgdnB4UnklOGTJ2miujIN/lWt9oQiF4II1gI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615873139; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=uxm2oYa9/b0DbvGOaOtp67nls0xtqR5IsXvhpJats2o=; b=XzDej+XxoW62ljpuU9i0bVvfTU4MoJcQS2u1F7wTrhPOqw6jr7vNJBy7z/MQ0lHTb+LLZHj1w0YiJsSpcSYzm+nkW3/L0DTL3VigZg5kLWFA8bOxsS12fGYoDUe1uiB6xJtytQJah3W7ad8ZLr7v4YOc6F639ucOxUknHqSzNiU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1615873139454251.69201485350186; Mon, 15 Mar 2021 22:38:59 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-68-k1LgxS-uMCSe750rsEofBQ-1; Tue, 16 Mar 2021 01:38:55 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EEB8018460E8; Tue, 16 Mar 2021 05:38:47 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C3A8E690F1; Tue, 16 Mar 2021 05:38:47 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 635071800FF2; Tue, 16 Mar 2021 05:38:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12G5cQDv017044 for ; Tue, 16 Mar 2021 01:38:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 501D56A039; Tue, 16 Mar 2021 05:38:26 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-141.ams2.redhat.com [10.36.112.141]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EB0C46F130; Tue, 16 Mar 2021 05:38:22 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 91BCC1800842; Tue, 16 Mar 2021 06:38:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615873138; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=uxm2oYa9/b0DbvGOaOtp67nls0xtqR5IsXvhpJats2o=; b=E48JjR/Yr+M3KlcG3T7sVbyjyEzXlu4H87oQvuYZLCaFHjrlwl51QIW1Y2I5PW/F4xM3XP hAbb37zTg+UR3AbgqDUSldfm0JHEPiSv4SSrX4UmA6X6N19Ethk+69Q35v5dh651QAQXx2 2vn41Ys5wit3sEJ4XggPbIRC3mSNLsw= X-MC-Unique: k1LgxS-uMCSe750rsEofBQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 10/11] ui: fold qemu_alloc_display in only caller Date: Tue, 16 Mar 2021 06:38:12 +0100 Message-Id: <20210316053813.1719442-11-kraxel@redhat.com> In-Reply-To: <20210316053813.1719442-1-kraxel@redhat.com> References: <20210316053813.1719442-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, Peter Maydell , Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) From: Marc-Andr=C3=A9 Lureau A minor code simplification. Signed-off-by: Marc-Andr=C3=A9 Lureau Message-Id: <20210312100108.2706195-2-marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann --- ui/console.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/ui/console.c b/ui/console.c index c2fdf975b6b3..2de5f4105b59 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1386,26 +1386,18 @@ static QemuConsole *new_console(DisplayState *ds, c= onsole_type_t console_type, return s; } =20 -static void qemu_alloc_display(DisplaySurface *surface, int width, int hei= ght) +DisplaySurface *qemu_create_displaysurface(int width, int height) { - qemu_pixman_image_unref(surface->image); - surface->image =3D NULL; + DisplaySurface *surface =3D g_new0(DisplaySurface, 1); =20 + trace_displaysurface_create(surface, width, height); surface->format =3D PIXMAN_x8r8g8b8; surface->image =3D pixman_image_create_bits(surface->format, width, height, NULL, width * 4); assert(surface->image !=3D NULL); - surface->flags =3D QEMU_ALLOCATED_FLAG; -} =20 -DisplaySurface *qemu_create_displaysurface(int width, int height) -{ - DisplaySurface *surface =3D g_new0(DisplaySurface, 1); - - trace_displaysurface_create(surface, width, height); - qemu_alloc_display(surface, width, height); return surface; } =20 --=20 2.29.2 From nobody Fri May 3 18:37:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615873138; cv=none; d=zohomail.com; s=zohoarc; b=P72Z1E+TbYiYsI/xmx6KYl7V4meWxKPwlKRXM0cvbSLV0E2h0NUn8zs8GrQOvC8m0PEJ1FTBumnq844vSVCxFH2NBcF0p/QZaFqXqzoyKcjBlsPuSgXamQZr84FgJtE8ZWKWC4yjeF6nNzqqr4wX2Mmf3G5R19W0FIF4TfG/CCo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615873138; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Oqdpqg9I4PZSbZGu3CZuLugaZxHwMJD0Jpla0CqGCno=; b=JUjTOMJiP/IpWOjmD/ZsK5J+Y2uoQ55oWQMFLjQhMY4xWoGi9G3FpwFKw2FhPlih8Abqu5UZuhgVgiCmZe95sFczvQ6wqs509yRhVwARvAEuo9HVhaS2VNGlD/0aEt3jN1w6w9ikEkcELpHzMdHo85S/1myZUOFq12A5MEQPsBE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1615873138985195.96858011849122; Mon, 15 Mar 2021 22:38:58 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-408-OzUoYiGMM4SoZlt7fTMDeg-1; Tue, 16 Mar 2021 01:38:55 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0CB0A18460E9; Tue, 16 Mar 2021 05:38:48 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DC1336F965; Tue, 16 Mar 2021 05:38:47 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A091857DC6; Tue, 16 Mar 2021 05:38:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12G5cTFI017085 for ; Tue, 16 Mar 2021 01:38:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 763EE18BBF; Tue, 16 Mar 2021 05:38:29 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-141.ams2.redhat.com [10.36.112.141]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F0D2A60C0F; Tue, 16 Mar 2021 05:38:22 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 9C6541800843; Tue, 16 Mar 2021 06:38:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615873137; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Oqdpqg9I4PZSbZGu3CZuLugaZxHwMJD0Jpla0CqGCno=; b=PWwgZK+f6/agwMnBOqjNmqOh//dzPglI7ElKuTkOYdzt6gYQPk/Om9yNroF4ZB/FR5joI3 jMazBoEsR+mTZGYBXdnMYRXTMSJGIEawvYrFl0u9awT+kOfKiEacO2nruWeHxQRzsqQOZv oCBVLutSx2ZTrNGCkHrN8uQsu8+h5/w= X-MC-Unique: OzUoYiGMM4SoZlt7fTMDeg-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 11/11] ui/cocoa: Comment about modifier key input quirks Date: Tue, 16 Mar 2021 06:38:13 +0100 Message-Id: <20210316053813.1719442-12-kraxel@redhat.com> In-Reply-To: <20210316053813.1719442-1-kraxel@redhat.com> References: <20210316053813.1719442-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, Peter Maydell , Gerd Hoffmann , Akihiko Odaki X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Akihiko Odaki Based-on: <20210310042348.21931-1-akihiko.odaki@gmail.com> Signed-off-by: Akihiko Odaki Message-Id: <20210312133212.3131-1-akihiko.odaki@gmail.com> Signed-off-by: Gerd Hoffmann --- ui/cocoa.m | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index 9da0e884b712..37e1fb52eb4d 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -690,7 +690,43 @@ QemuCocoaView *cocoaView; NSPoint p =3D [self screenLocationOfEvent:event]; NSUInteger modifiers =3D [event modifierFlags]; =20 - // emulate caps lock keydown and keyup + /* + * Check -[NSEvent modifierFlags] here. + * + * There is a NSEventType for an event notifying the change of + * -[NSEvent modifierFlags], NSEventTypeFlagsChanged but these operati= ons + * are performed for any events because a modifier state may change wh= ile + * the application is inactive (i.e. no events fire) and we don't want= to + * wait for another modifier state change to detect such a change. + * + * NSEventModifierFlagCapsLock requires a special treatment. The other= flags + * are handled in similar manners. + * + * NSEventModifierFlagCapsLock + * --------------------------- + * + * If CapsLock state is changed, "up" and "down" events will be fired = in + * sequence, effectively updates CapsLock state on the guest. + * + * The other flags + * --------------- + * + * If a flag is not set, fire "up" events for all keys which correspon= d to + * the flag. Note that "down" events are not fired here because the fl= ags + * checked here do not tell what exact keys are down. + * + * If one of the keys corresponding to a flag is down, we rely on + * -[NSEvent keyCode] of an event whose -[NSEvent type] is + * NSEventTypeFlagsChanged to know the exact key which is down, which = has + * the following two downsides: + * - It does not work when the application is inactive as described ab= ove. + * - It malfactions *after* the modifier state is changed while the + * application is inactive. It is because -[NSEvent keyCode] does no= t tell + * if the key is up or down, and requires to infer the current state= from + * the previous state. It is still possible to fix such a malfanctio= n by + * completely leaving your hands from the keyboard, which hopefully = makes + * this implementation usable enough. + */ if (!!(modifiers & NSEventModifierFlagCapsLock) !=3D qkbd_state_modifier_get(kbd, QKBD_MOD_CAPSLOCK)) { qkbd_state_key_event(kbd, Q_KEY_CODE_CAPS_LOCK, true); --=20 2.29.2