From nobody Fri Dec 19 22:05:49 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1744042968; cv=none; d=zohomail.com; s=zohoarc; b=ns+DeoG8yh/YMyoGXP74eSYLh+JJKoqC7Ia6xqJauN6AlZOR3ply+Rp3CGEDFytCAbRAN1exPlC1vAiTmx0gX6xdGdoXKdktM1Bvdin0SlL7d3kb6gNLwS+I2hwiHqC/iiFyis7joyy8K/gAGIZ01nlG8Mx5wCB6bqD2sR4t5j4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1744042968; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:Subject:Subject:To:To:Message-Id; bh=Dw+G73uKi+TcqxL9cKvP3MTBWQgg2PNucIKbuaFDQMY=; b=QnWoSkKkgA3Fk/cr07QiRQVZHFj73IeqZBvoxYAsGmSlcRKx/DMTvOvMnt5w8J0ZuvqPowqfJmRpL6FRWPKuPmxjovOLrntFC1kWeXWSBt/5gZyxVZEZElI/fMmQLxcr1w9xnjrNKgq23FWT75pLykEh9P+d/eQ4ebH2M/qtiCU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1744042968842365.1342537203742; Mon, 7 Apr 2025 09:22:48 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 36077166B; Mon, 7 Apr 2025 12:22:48 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 1AD91166F; Mon, 7 Apr 2025 12:22:30 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id CB35E1659; Mon, 7 Apr 2025 12:22:26 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id B34DED47 for ; Mon, 7 Apr 2025 12:22:25 -0400 (EDT) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-77-So86oGftNcOu7XNYTqIhrg-1; Mon, 07 Apr 2025 12:22:24 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 705BB1809CA3 for ; Mon, 7 Apr 2025 16:22:23 +0000 (UTC) Received: from speedmetal.lan (unknown [10.44.22.8]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id CF5DC1828AA8; Mon, 7 Apr 2025 16:22:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1744042945; h=from:from: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; bh=U/B7VMe9fjx7cJMm0Ii3QKMEfPNBl1IZtK82S93kHEc=; b=Apbrj6oHjDI65s4JXYhbzUT4Wfifh788/LhAG4OCo/nOyH4cv9bSWjb0dRjlhsnMvi3b7z XWaadZTVSIb60/3BHsXQkOTKKK55vq85f4stAMmv50bgUAJaIkWSrnmkJnQbuusfhyxZlm 1FtuhhaHwCw4qONYOJVUg1etoEp1hc0= X-MC-Unique: So86oGftNcOu7XNYTqIhrg-1 X-Mimecast-MFC-AGG-ID: So86oGftNcOu7XNYTqIhrg_1744042943 To: devel@lists.libvirt.org Subject: [PATCH] qemu: rdp: Fix 'qemuRdpAvailable()' Date: Mon, 7 Apr 2025 18:22:19 +0200 Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: HMSH-M7JK8Ns5dUi4kK0TObuJfmNxZmWT4he5Tzg8gs_1744042943 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: MMVHKMFVFJNYC442K43XLZV3IMPDUONH X-Message-ID-Hash: MMVHKMFVFJNYC442K43XLZV3IMPDUONH X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Peter Krempa X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1744042971347019000 Content-Type: text/plain; charset="utf-8" From: Peter Krempa qemuRdpAvailable() is called from the capability filing code, thus: - it must not report spurious errors - it should not call any extra processes We can solve the above by just checking existance of 'qemu-rdp' in the path as: - at the time of adding of qemuRdpAvailable() there was only one 'qemu-rdp'= release - it supported all the features - the check can't change as we'd drop the capability Add comments and gut the check to only check existance of the file. Fixes: f5e5a9bec9ec3e6c762f5000e3b8a0ba6a3a8c8d Closes: https://gitlab.com/libvirt/libvirt/-/issues/763 Signed-off-by: Peter Krempa Reviewed-by: Boris Fiuczynski Reviewed-by: Marc-Andr=C3=A9 Lureau --- src/qemu/qemu_rdp.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_rdp.c b/src/qemu/qemu_rdp.c index 984795d599..0c48b87e7b 100644 --- a/src/qemu/qemu_rdp.c +++ b/src/qemu/qemu_rdp.c @@ -413,12 +413,25 @@ qemuRdpSetCredentials(virDomainObj *vm, } +/** + * qemuRdpAvailable: + * @helper: name (or path to) 'qemu-rdp' binary + * + * Returns whether 'qemu-rdp' is available. + * + * Important: + * This function is called from 'virQEMUDriverGetDomainCapabilities'. It m= ust + * not report any errors and must not add any additional checks. + * + * This function is mocked from 'tests/testutilsqemu.c' + * + */ bool qemuRdpAvailable(const char *helper) { - g_autoptr(qemuRdp) rdp =3D NULL; - - rdp =3D qemuRdpNewForHelper(helper); + g_autofree char *helperPath =3D NULL; - return rdp && qemuRdpHasFeature(rdp, QEMU_RDP_FEATURE_DBUS_ADDRESS); + /* This function was added corresponding to the first release of 'qemu= -rdp' + * thus checking existance of the helper binary is sufficient. */ + return !!(helperPath =3D virFindFileInPath(helper)); } --=20 2.49.0