From nobody Fri Mar 13 12:47:23 2026 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=1742113191; cv=none; d=zohomail.com; s=zohoarc; b=Gnq4hZq1CLTfpNNO7veAFyIBvIyP/FRaXHgYJLkquVHpGVQNUpGrmb3tM8aUhfK7mfNGfQlVgbitH7pQicqTKx/M7hWuH61akVHkAK522Kn2NoMd3s9r7I6KVNOcc9o5i55yBjCEUL2DS11e0Ji/DvvjAvln3KOWo+ahO1t8dtU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1742113191; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=szPoIMCn3iYfZgXk5Vr0+/1UtrltpVqMzzxFDpdE/l8=; b=BO5AGUfAA4sR4MTWpFfSahSCpxxi5ZO9kBFDQ16O+fjQdNiGt/hvedgzjTa2JQge6N3lFuQTEtIc0gs45A1wm1znWSrmTRTqgiuRPpYzsuzj9W6h/IqR3xoznBk7FNZE639limExIPT+Ayvz+8hc1wIzuiU8gb0I0C2ntM8HRBo= 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 1742113191761166.55246090287017; Sun, 16 Mar 2025 01:19:51 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 223A02274; Sun, 16 Mar 2025 04:19:51 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 6D6F42330; Sun, 16 Mar 2025 04:19:21 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 3B9E32273; Sun, 16 Mar 2025 04:19:16 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 79AF82305 for ; Sun, 16 Mar 2025 04:19:00 -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-408-FvveT42rNw2QYYXzI3g2rw-1; Sun, 16 Mar 2025 04:18:58 -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 5EE5F18007E1 for ; Sun, 16 Mar 2025 08:18:57 +0000 (UTC) Received: from localhost (unknown [10.45.242.5]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7AFB9180174E; Sun, 16 Mar 2025 08:18:54 +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=1742113140; 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: in-reply-to:in-reply-to:references:references; bh=6HWFN22cddo0ajDs/7t9jDqBrlyMAnva6+/MxnsnG/k=; b=jBJX0ZPAXtBeVG32XGxvYTRKmBbIbTnkaWxvylSaYeJT8x/y8JYrBeqPvPvnzunsn2lT0k pMLCuqhIF6EMQ9j44PhJhhH1omY145G0OjyrSyWj1CtiU0SGRMtvl/V8vGuS4UURW2o5qM /fdaCNE2e+kJ466IYn0UJhHUD2+8l34= X-MC-Unique: FvveT42rNw2QYYXzI3g2rw-1 X-Mimecast-MFC-AGG-ID: FvveT42rNw2QYYXzI3g2rw_1742113137 To: devel@lists.libvirt.org Subject: [PATCH v3 01/20] build-sys: drop -Winline when optimization=g Date: Sun, 16 Mar 2025 12:18:22 +0400 Message-ID: <20250316081841.3170078-2-marcandre.lureau@redhat.com> In-Reply-To: <20250316081841.3170078-1-marcandre.lureau@redhat.com> References: <20250316081841.3170078-1-marcandre.lureau@redhat.com> 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: Vy2eJRfqMz-OkqfpT8HDh8N9Ub3lj13XVS18ScrtBtA_1742113137 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: YJQPGJLPNIQG7KGZ5VCXLOADNGHD64ZS X-Message-ID-Hash: YJQPGJLPNIQG7KGZ5VCXLOADNGHD64ZS X-MailFrom: marcandre.lureau@redhat.com X-Mailman-Rule-Hits: nonmember-moderation 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 CC: mkletzan@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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: "marcandre.lureau--- via Devel" Reply-To: marcandre.lureau@redhat.com X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1742113193139019000 Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau The warning is triggered when compiling with various build options, such as -Doptimization=3Dg. From gcc(1) man page about -Winline: seemingly insignificant changes in the source program can cause the warning= s produced by -Winline to appear or disappear. Such flaky behaviour is best left to the user discretion. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Martin Kletzander --- meson.build | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 2d76a0846c..56823ca25b 100644 --- a/meson.build +++ b/meson.build @@ -340,7 +340,6 @@ cc_flags +=3D [ '-Wimplicit-int', '-Wincompatible-pointer-types', '-Winit-self', - '-Winline', '-Wint-conversion', '-Wint-in-bool-context', '-Wint-to-pointer-cast', @@ -444,6 +443,12 @@ cc_flags +=3D [ '-Wwrite-strings', ] =20 +if get_option('optimization') !=3D 'g' + # Seemingly insignificant changes in the source program can cause the wa= rnings + # produced by -Winline to appear or disappear. + cc_flags +=3D [ '-Winline' ] +endif + if cc.get_id() =3D=3D 'clang' # Stop CLang from doing inter-procedural analysis of calls # between functions in the same compilation unit. Such an --=20 2.47.0 From nobody Fri Mar 13 12:47:23 2026 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=1742113214; cv=none; d=zohomail.com; s=zohoarc; b=KN/lHaFJN1qgT8Vl/rFv0zXcLkYznChg3G770wbaNeNkcq79ttLWBCJavvuTyJPMslKgK1RsR5CSNQBkaHjK3vaCVGG/P3g/FWoBWOz14xpJ29XWn2zebtVMt8a2th0LgdHKkM3C99X42n2FMUxMvkbxoNd2kqL4gA+KqGFcq+c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1742113214; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=A/2FinDc9UQEsgntMKyyM8DWVdU8oyML+RJ/z/QQps0=; b=by+yWG/UJyS0ByRB3TxpL6eCUIfqwCu+HoQ7FuOEDSEu67f9n6dgZ/Mf4x3ZMFpH/Gz4u9puvEXlDT7k2mLW1x1QYk8mC3D+hiViSYgT8UfeUPiw4U0krkkPf2dg9GEWX6YD4qsKM6CRyC23eufDWorzpVSfw+YxVBkmTQ9CLA8= 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 1742113214309143.85294809002175; Sun, 16 Mar 2025 01:20:14 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id DA47E22C2; Sun, 16 Mar 2025 04:20:12 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 25FF922BD; Sun, 16 Mar 2025 04:19:28 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 2432F22BE; Sun, 16 Mar 2025 04:19:24 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 BBC142322 for ; Sun, 16 Mar 2025 04:19:08 -0400 (EDT) Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-574-dZdElYxpMuC1MVgG32AyFw-1; Sun, 16 Mar 2025 04:19:06 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0088E19560B0 for ; Sun, 16 Mar 2025 08:19:06 +0000 (UTC) Received: from localhost (unknown [10.45.242.5]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1AAD11800946; Sun, 16 Mar 2025 08:19:03 +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=1742113148; 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: in-reply-to:in-reply-to:references:references; bh=PNEtzP3Wc0RFfTf+zcNB+t1e5A0OEIWDZDts2PyJBMk=; b=T/2X3wnBfBoRZP2hozA6PvoNreux/yRJG4i/e0gcvToXy8dLu/8O9K4u1hNu16W79TZQ9N alLf/6jCVTzfYMpxupcV76n+D6ijJkp6DYkhGcu56rUCHVzZ0YXdrRhMDmNqYkZPHNG0wS UQKTVittR2u7VJH8iyX2PzshY+qTYgA= X-MC-Unique: dZdElYxpMuC1MVgG32AyFw-1 X-Mimecast-MFC-AGG-ID: dZdElYxpMuC1MVgG32AyFw_1742113146 To: devel@lists.libvirt.org Subject: [PATCH v3 02/20] build: fix -Werror=maybe-uninitialized Date: Sun, 16 Mar 2025 12:18:23 +0400 Message-ID: <20250316081841.3170078-3-marcandre.lureau@redhat.com> In-Reply-To: <20250316081841.3170078-1-marcandre.lureau@redhat.com> References: <20250316081841.3170078-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: hD8PdHl_Kpd3yo9hzhGtt8_DvStNAt5mB5MhudZTPzE_1742113146 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: LN2PI2CUI5AGRQQ754JXVHCM3DQUGK2U X-Message-ID-Hash: LN2PI2CUI5AGRQQ754JXVHCM3DQUGK2U X-MailFrom: marcandre.lureau@redhat.com X-Mailman-Rule-Hits: nonmember-moderation 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 CC: mkletzan@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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: "marcandre.lureau--- via Devel" Reply-To: marcandre.lureau@redhat.com X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1742113215108019000 Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau When compiled with -Doptimization=3Dg ../tools/nss/libvirt_nss_macs.c:155:8: error: =E2=80=98jerr=E2=80=99 may be= used uninitialized [-Werror=3Dmaybe-uninitialized] 155 | if (jerr =3D=3D json_tokener_continue) { | ^ Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Martin Kletzander --- tools/nss/libvirt_nss_leases.c | 2 +- tools/nss/libvirt_nss_macs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/nss/libvirt_nss_leases.c b/tools/nss/libvirt_nss_leases.c index 25ea6b0ce2..4d68787fb2 100644 --- a/tools/nss/libvirt_nss_leases.c +++ b/tools/nss/libvirt_nss_leases.c @@ -260,7 +260,7 @@ findLeases(const char *file, int ret =3D -1; json_object *jobj =3D NULL; json_tokener *tok =3D NULL; - enum json_tokener_error jerr; + enum json_tokener_error jerr =3D json_tokener_error_parse_eof; int jsonflags =3D JSON_TOKENER_STRICT | JSON_TOKENER_VALIDATE_UTF8; char line[1024]; size_t nreadTotal =3D 0; diff --git a/tools/nss/libvirt_nss_macs.c b/tools/nss/libvirt_nss_macs.c index bac8c0e1bb..c3af9375bc 100644 --- a/tools/nss/libvirt_nss_macs.c +++ b/tools/nss/libvirt_nss_macs.c @@ -122,7 +122,7 @@ findMACs(const char *file, char line[1024]; json_object *jobj =3D NULL; json_tokener *tok =3D NULL; - enum json_tokener_error jerr; + enum json_tokener_error jerr =3D json_tokener_error_parse_eof; int jsonflags =3D JSON_TOKENER_STRICT | JSON_TOKENER_VALIDATE_UTF8; size_t nreadTotal =3D 0; int rv; --=20 2.47.0 From nobody Fri Mar 13 12:47:23 2026 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=1742113235; cv=none; d=zohomail.com; s=zohoarc; b=YjoPNnz0RuX9tdceZbf6FxxY7AlHKUTx/ugJk1WpazugQJc8Wr26ZUj/kg9N6YNNP/zjzgsP1hNUb7voFY++fMWKd9VCI38bgHd+q2/mkyGD8OXhpXYBGxjkWdIM+3v6Ue4tEycZ0oClGdFtabbLLwX/LBVt5nndqro6+u77Qyo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1742113235; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=jow8PUoFOR1WQUrhyBXkpJDpucsLNlzoIonNfHfF5TI=; b=nbXq4GLXhNFNRXQQmkD4+9UQF7QFERXSVt4ytz5SxqT8Fer3VuSP/MrN3NC5oQUnHSCcEOa3BPp3prAycp61NXfhLk339o5jO87ZYHk0Y1ZzqcLtZx4gQewOezMCBrfD4Vblrim1ztWrfkpyF0JhTaltiGDQwOV4EvUyGesy08s= 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 1742113235918823.0494825388332; Sun, 16 Mar 2025 01:20:35 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 439972371; Sun, 16 Mar 2025 04:20:35 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id C5B872342; Sun, 16 Mar 2025 04:19:34 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 9D97922B1; Sun, 16 Mar 2025 04:19:31 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 E0FB822BB for ; Sun, 16 Mar 2025 04:19:18 -0400 (EDT) Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-626-95nOf2acMviwX864-HWiww-1; Sun, 16 Mar 2025 04:19:14 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1936019560B2 for ; Sun, 16 Mar 2025 08:19:14 +0000 (UTC) Received: from localhost (unknown [10.45.242.5]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 146481956095; Sun, 16 Mar 2025 08:19:11 +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=1742113158; 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: in-reply-to:in-reply-to:references:references; bh=5c1MxBE21qII/zUUKq+3I6AikCNUITGQXQxD33SYYMU=; b=P8c+Q0zIIN3typs4QNSkI+yKhB4R1XmhAw1VyRlMdMI/rvL3sOAk65xrP7H/S0pZFRb5KB zu5MypHbImrSHYg/Lo6iFdsOMp+bzccBfvW67b1pf8DoAizM47mrwAeTHzu36C56Cic2rq M+66q/8iBgId9kyBaZk8Tr/PlHUfyZc= X-MC-Unique: 95nOf2acMviwX864-HWiww-1 X-Mimecast-MFC-AGG-ID: 95nOf2acMviwX864-HWiww_1742113154 To: devel@lists.libvirt.org Subject: [PATCH v3 03/20] qemu-slirp: drop unneeded check for OOM Date: Sun, 16 Mar 2025 12:18:24 +0400 Message-ID: <20250316081841.3170078-4-marcandre.lureau@redhat.com> In-Reply-To: <20250316081841.3170078-1-marcandre.lureau@redhat.com> References: <20250316081841.3170078-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: VIGYxtjpimPHXRfF64_zarPtFRixQn3kS0vuKwDfaqc_1742113154 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: TARPPCWJFTKYRZXCVPHQI7XKMHVUBNRL X-Message-ID-Hash: TARPPCWJFTKYRZXCVPHQI7XKMHVUBNRL X-MailFrom: marcandre.lureau@redhat.com X-Mailman-Rule-Hits: nonmember-moderation 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 CC: mkletzan@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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: "marcandre.lureau--- via Devel" Reply-To: marcandre.lureau@redhat.com X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1742113237056019000 Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau glib anti-pattern, since it aborts on OOM. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Martin Kletzander --- src/qemu/qemu_slirp.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/qemu/qemu_slirp.c b/src/qemu/qemu_slirp.c index 66d9d77c6c..eac7e4cc47 100644 --- a/src/qemu/qemu_slirp.c +++ b/src/qemu/qemu_slirp.c @@ -99,12 +99,6 @@ qemuSlirpNewForHelper(const char *helper) size_t i, nfeatures; =20 slirp =3D qemuSlirpNew(); - if (!slirp) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to allocate slirp for '%1$s'"), helper); - return NULL; - } - cmd =3D virCommandNewArgList(helper, "--print-capabilities", NULL); virCommandSetOutputBuffer(cmd, &output); if (virCommandRun(cmd, NULL) < 0) --=20 2.47.0 From nobody Fri Mar 13 12:47:23 2026 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=1742113257; cv=none; d=zohomail.com; s=zohoarc; b=hoPFpUzo9XIIUiUFg7fiPE29gVQwEZGe/VzkF3uEu58EybHs6KioYuyAJL6OkoaIKT6jajdZa9cSBBk9v+1of5KAs9akYcye/jn4c7azPMn7ZprOYC0iMdQYKnocWLwNt0YyFGVGzfYcLXUH7NLk1G8uoqDvNSaHx5Y/9fRMgLw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1742113257; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=b12WVyYs65q7gffriaSAn78suGHv3nyqYWFTVSQSbZM=; b=HVfbcUzG+CsDtjj55imx1fDkSSN7TOIxknaprgv03XUl81x1dRgauietJ5iLS4Xxq850ffOJzUQjCxoGzk/Kq6lbYE3i2JGAKFJVKGSXQND1xkDVlGIZ4aNgEGBIKkOkz3Bd+Yt77aDbS2jwXXcWc5dGaqXt0L+zKy0vmvbSHFc= 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 1742113257162268.33747486283664; Sun, 16 Mar 2025 01:20:57 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 875CA22AC; Sun, 16 Mar 2025 04:20:56 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id B2D2E234F; Sun, 16 Mar 2025 04:19:41 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 24EA322BA; Sun, 16 Mar 2025 04:19:37 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 74C362294 for ; Sun, 16 Mar 2025 04:19:24 -0400 (EDT) Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-28-TBJyQADePTmpNhgvR3iRSg-1; Sun, 16 Mar 2025 04:19:22 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9D370195604F for ; Sun, 16 Mar 2025 08:19:21 +0000 (UTC) Received: from localhost (unknown [10.45.242.5]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id EC7F21955F2D; Sun, 16 Mar 2025 08:19:19 +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=1742113164; 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: in-reply-to:in-reply-to:references:references; bh=l8p6PXiK0bnnq9qdaz55ukTUPcE29aSEuTV4WmFbPVA=; b=MQSKpIjzjTPHOkf5SM2Q0jXJU5MYSC6FKVQdCOKnnXTN7TMSYzYC7eEDYSY1RVg3ILOEZ3 3j9xhAJQMNq59zuIXwu2gV3V/a0IgVriK9ke+c9cghTLBR0jNQOuo057gPBhtfHl+qGY33 7nSky5rlFJ7alfnXr6uYoxmLvpPA/t0= X-MC-Unique: TBJyQADePTmpNhgvR3iRSg-1 X-Mimecast-MFC-AGG-ID: TBJyQADePTmpNhgvR3iRSg_1742113161 To: devel@lists.libvirt.org Subject: [PATCH v3 04/20] util: annotate non-null arguments for virGDBusCallMethod() Date: Sun, 16 Mar 2025 12:18:25 +0400 Message-ID: <20250316081841.3170078-5-marcandre.lureau@redhat.com> In-Reply-To: <20250316081841.3170078-1-marcandre.lureau@redhat.com> References: <20250316081841.3170078-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 27U7fVAZL-DOojedUEbfQfdozoUFnuZJ7_5ES4mcEEg_1742113161 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: H46UJWLUF7IVWUP33LSVCVGCIUFJJYJK X-Message-ID-Hash: H46UJWLUF7IVWUP33LSVCVGCIUFJJYJK X-MailFrom: marcandre.lureau@redhat.com X-Mailman-Rule-Hits: nonmember-moderation 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 CC: mkletzan@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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: "marcandre.lureau--- via Devel" Reply-To: marcandre.lureau@redhat.com X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1742113259153019000 Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau Helps avoid/debug a potential SEGV if conn is NULL, since gio will not set the "gerror" in that case and we will crash later at: virReportError(VIR_ERR_DBUS_SERVICE, "%s", gerror->message); Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Martin Kletzander --- src/util/virgdbus.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/util/virgdbus.h b/src/util/virgdbus.h index dfe6138112..65e7ba7be4 100644 --- a/src/util/virgdbus.h +++ b/src/util/virgdbus.h @@ -54,7 +54,11 @@ virGDBusCallMethod(GDBusConnection *conn, const char *objectPath, const char *ifaceName, const char *method, - GVariant *data); + GVariant *data) + ATTRIBUTE_NONNULL(1) + ATTRIBUTE_NONNULL(6) + ATTRIBUTE_NONNULL(7) + ATTRIBUTE_NONNULL(8); =20 int virGDBusCallMethodWithFD(GDBusConnection *conn, @@ -67,7 +71,12 @@ virGDBusCallMethodWithFD(GDBusConnection *conn, const char *ifaceName, const char *method, GVariant *data, - GUnixFDList *dataFD); + GUnixFDList *dataFD) + ATTRIBUTE_NONNULL(1) + ATTRIBUTE_NONNULL(7) + ATTRIBUTE_NONNULL(8) + ATTRIBUTE_NONNULL(9); + =20 int virGDBusIsServiceEnabled(const char *name); --=20 2.47.0 From nobody Fri Mar 13 12:47:23 2026 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=1742113294; cv=none; d=zohomail.com; s=zohoarc; b=Flu7kbrALpKQJPTOb0Jj9tgPjZHAGAp4U9M+0Q6LVAZIWM1NQwxL6AUOMFrTeV2aZ8/dkaGxdM9nSmzhyeR0bQFBttu6kKOslkDLcIzseqiek08dQrVhGoMMWhDMTHOXE2lSYQjc2CtysnOALITR2+SFqwKCUhah3fmhBh0N3aQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1742113294; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=ZMcNb8COQ4YelunyaEIOe3OIxdd9XO63k2zyEFX7zwM=; b=KkG9WMzQCKhYIguZjWyJtB81tguhBPGjoI0j4wYJ1HGmZ7yRtt03ceibuar8IAN4eJDs/NUxi9dBFB+E784fNPKS6kFyjgn+Q7755Z8BFwXWcH5nRFDrxXMNuXZM9gZ2K58vJ6sY23ogKG025J9jEVZnYP4OaFj8o+K392HB+IE= 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 1742113293995942.273571760845; Sun, 16 Mar 2025 01:21:33 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 0438D2343; Sun, 16 Mar 2025 04:21:32 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 0DC4F225B; Sun, 16 Mar 2025 04:19:47 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id CA22E2284; Sun, 16 Mar 2025 04:19:41 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 E735C22DC for ; Sun, 16 Mar 2025 04:19:31 -0400 (EDT) Received: from mx-prod-mc-06.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-202-ngOtkiylOt69xVpxhOa7bg-1; Sun, 16 Mar 2025 04:19:30 -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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 65BDC180049D for ; Sun, 16 Mar 2025 08:19:29 +0000 (UTC) Received: from localhost (unknown [10.45.242.5]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 929BF18001F6; Sun, 16 Mar 2025 08:19:26 +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=1742113171; 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: in-reply-to:in-reply-to:references:references; bh=FAWt9f6P2+wMdz4uqY7FExZGURF3SeWLIyTsbHn6Tac=; b=E92Pedw2e1rVSlfwBa7rsyi28SfXkJJ6W5JrdRT/BoegbwBHB4KFb9rKmQL4uwE3zQOnVD 8M7qtT0nA+yu32GNd2B+OPZZTK4ESfrZQHxLaASE0j2X5wC8VAuGGMU920h4zA6ty4f8aM 2jzDnXQoTv3OSiRWhOb/UDjDIyOnVQ8= X-MC-Unique: ngOtkiylOt69xVpxhOa7bg-1 X-Mimecast-MFC-AGG-ID: ngOtkiylOt69xVpxhOa7bg_1742113169 To: devel@lists.libvirt.org Subject: [PATCH v3 05/20] qemu: add rdp state directory Date: Sun, 16 Mar 2025 12:18:26 +0400 Message-ID: <20250316081841.3170078-6-marcandre.lureau@redhat.com> In-Reply-To: <20250316081841.3170078-1-marcandre.lureau@redhat.com> References: <20250316081841.3170078-1-marcandre.lureau@redhat.com> 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: YR6HjhhvHnZ575hMdPvar0qkqstfpIn0dBCdFO3fLus_1742113169 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: SGAUDLNDUJWZCROZB5VMLYOA2W5W3NCS X-Message-ID-Hash: SGAUDLNDUJWZCROZB5VMLYOA2W5W3NCS X-MailFrom: marcandre.lureau@redhat.com X-Mailman-Rule-Hits: nonmember-moderation 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 CC: mkletzan@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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: "marcandre.lureau--- via Devel" Reply-To: marcandre.lureau@redhat.com X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1742113295762019100 Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Martin Kletzander --- src/qemu/qemu_conf.c | 2 ++ src/qemu/qemu_conf.h | 1 + src/qemu/qemu_driver.c | 12 ++++++++++++ tests/testutilsqemu.c | 2 ++ 4 files changed, 17 insertions(+) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index b376841388..1708f4f5ad 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -226,6 +226,7 @@ virQEMUDriverConfig *virQEMUDriverConfigNew(bool privil= eged, cfg->configDir =3D g_strdup_printf("%s/qemu", cfg->configBaseDir); cfg->autostartDir =3D g_strdup_printf("%s/qemu/autostart", cfg->config= BaseDir); cfg->slirpStateDir =3D g_strdup_printf("%s/slirp", cfg->stateDir); + cfg->rdpStateDir =3D g_strdup_printf("%s/rdp", cfg->stateDir); cfg->passtStateDir =3D g_strdup_printf("%s/passt", cfg->stateDir); cfg->dbusStateDir =3D g_strdup_printf("%s/dbus", cfg->stateDir); =20 @@ -327,6 +328,7 @@ static void virQEMUDriverConfigDispose(void *obj) g_free(cfg->slirpStateDir); g_free(cfg->passtStateDir); g_free(cfg->dbusStateDir); + g_free(cfg->rdpStateDir); =20 g_free(cfg->libDir); g_free(cfg->cacheDir); diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h index 3e1b41af73..af1f59708f 100644 --- a/src/qemu/qemu_conf.h +++ b/src/qemu/qemu_conf.h @@ -99,6 +99,7 @@ struct _virQEMUDriverConfig { char *slirpStateDir; char *passtStateDir; char *dbusStateDir; + char *rdpStateDir; /* These two directories are ones QEMU processes use (so must match * the QEMU user/group */ char *libDir; diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index f0e9681161..6f0ce5a2f3 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -648,6 +648,11 @@ qemuStateInitialize(bool privileged, cfg->dbusStateDir); goto error; } + if (g_mkdir_with_parents(cfg->rdpStateDir, 0777) < 0) { + virReportSystemError(errno, _("Failed to create rdp state dir %1$s= "), + cfg->rdpStateDir); + goto error; + } =20 qemu_driver->inhibitor =3D virInhibitorNew( VIR_INHIBITOR_WHAT_SHUTDOWN, @@ -793,6 +798,13 @@ qemuStateInitialize(bool privileged, (int)cfg->group); goto error; } + if (chown(cfg->rdpStateDir, cfg->user, cfg->group) < 0) { + virReportSystemError(errno, + _("unable to set ownership of '%1$s' to %= 2$d:%3$d"), + cfg->rdpStateDir, (int)cfg->user, + (int)cfg->group); + goto error; + } =20 run_uid =3D cfg->user; run_gid =3D cfg->group; diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 20409a6535..6189b47d9b 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -330,6 +330,8 @@ int qemuTestDriverInit(virQEMUDriver *driver) cfg->passtStateDir =3D g_strdup("/var/run/libvirt/qemu/passt"); VIR_FREE(cfg->dbusStateDir); cfg->dbusStateDir =3D g_strdup("/var/run/libvirt/qemu/dbus"); + VIR_FREE(cfg->rdpStateDir); + cfg->rdpStateDir =3D g_strdup("/var/run/libvirt/qemu/rdp"); =20 if (!g_mkdtemp(statedir)) { fprintf(stderr, "Cannot create fake stateDir"); --=20 2.47.0 From nobody Fri Mar 13 12:47:23 2026 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=1742113333; cv=none; d=zohomail.com; s=zohoarc; b=PwnAfoH/5Qj5TxqSnlQTOWjP1uHp1bTUIzUa4YOTFGcFeNKFuUMxk+RTpfw716UKThNtLMRGUsEp9+62oNz9uHSkIoRBrBUTtfKzrr5rCKDEvHrb9i36H80H+DjHy+7iAzewq4A2VW35JAlHU08fcK2wkXK6rF2EDJdz8uQUcMk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1742113333; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=N5Zz5kMqaol3c8OuwZ9qWP/w3Fhd2kCczgIRjySQjjA=; b=XdTcFxsWzb0Hy+PrimlyIR7eMvakn9UkadNc1h4Q4ktJDLht5zPSzCTfMwbopDIIuxPBbEHLCbyI0B0dXZ6Aa5fpHKDiGgfxegA27Khs7V8k32BmXbimmibUNufogUN4FWadPWVEFNnDNxW8mXlA+Nl+EWs+ZSz2XkAIDimM1JY= 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 1742113333872372.9427331116034; Sun, 16 Mar 2025 01:22:13 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 43010DC5; Sun, 16 Mar 2025 04:22:13 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 20C23234D; Sun, 16 Mar 2025 04:19:55 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 5E25E22E9; Sun, 16 Mar 2025 04:19:50 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 39E4C22E9 for ; Sun, 16 Mar 2025 04:19:40 -0400 (EDT) Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-608-itQbiJxhOp6tAMSlexzxAw-1; Sun, 16 Mar 2025 04:19:38 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 517C119560B0 for ; Sun, 16 Mar 2025 08:19:37 +0000 (UTC) Received: from localhost (unknown [10.45.242.5]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5CFC71800946; Sun, 16 Mar 2025 08:19:34 +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=1742113179; 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: in-reply-to:in-reply-to:references:references; bh=YCmiYXSgHBKN+QjMsgm274UuxQ8pDnQf/nSZNnIoSOo=; b=H1WaGIL7sm0VMt9XYXrFGHcn0DPdlo0D6IR36IYOHtYA8Ja0VZoojavVTshTg4lPqxUpdd waE/8O9mmTAmKtPK6t7gjMEZOsytrqAZk9jfMyJ+jIWZb7swkQXeLglKoVphmgQzN4YhA0 mpaCNh7HPSHQ3tZUIpWFCJsSRaO4sHQ= X-MC-Unique: itQbiJxhOp6tAMSlexzxAw-1 X-Mimecast-MFC-AGG-ID: itQbiJxhOp6tAMSlexzxAw_1742113177 To: devel@lists.libvirt.org Subject: [PATCH v3 06/20] qemu: add qemu RDP configuration Date: Sun, 16 Mar 2025 12:18:27 +0400 Message-ID: <20250316081841.3170078-7-marcandre.lureau@redhat.com> In-Reply-To: <20250316081841.3170078-1-marcandre.lureau@redhat.com> References: <20250316081841.3170078-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: YYysxcv4JWQhetRSv0G2JI1HrnZCxbyZIHZFs4rBUBY_1742113177 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: ERYYHJQHZ6HHO4RDT4UQ744SK7JOYXXF X-Message-ID-Hash: ERYYHJQHZ6HHO4RDT4UQ744SK7JOYXXF X-MailFrom: marcandre.lureau@redhat.com X-Mailman-Rule-Hits: nonmember-moderation 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 CC: mkletzan@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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: "marcandre.lureau--- via Devel" Reply-To: marcandre.lureau@redhat.com X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1742113335518019000 Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Martin Kletzander --- src/qemu/libvirtd_qemu.aug | 7 ++++++ src/qemu/qemu.conf.in | 31 ++++++++++++++++++++++++ src/qemu/qemu_conf.c | 39 ++++++++++++++++++++++++++++++ src/qemu/qemu_conf.h | 6 +++++ src/qemu/test_libvirtd_qemu.aug.in | 5 ++++ tests/testutilsqemu.c | 2 ++ 6 files changed, 90 insertions(+) diff --git a/src/qemu/libvirtd_qemu.aug b/src/qemu/libvirtd_qemu.aug index 642093c40b..0288c2895b 100644 --- a/src/qemu/libvirtd_qemu.aug +++ b/src/qemu/libvirtd_qemu.aug @@ -50,6 +50,11 @@ module Libvirtd_qemu =3D | bool_entry "spice_sasl" | str_entry "spice_sasl_dir" =20 + let rdp_entry =3D str_entry "rdp_listen" + | str_entry "rdp_tls_x509_cert_dir" + | str_entry "rdp_username" + | str_entry "rdp_password" + let chardev_entry =3D bool_entry "chardev_tls" | str_entry "chardev_tls_x509_cert_dir" | bool_entry "chardev_tls_x509_verify" @@ -103,6 +108,7 @@ module Libvirtd_qemu =3D | str_entry "bridge_helper" | str_entry "pr_helper" | str_entry "slirp_helper" + | str_entry "qemu_rdp" | str_entry "dbus_daemon" | bool_entry "set_process_name" | int_entry "max_processes" @@ -156,6 +162,7 @@ module Libvirtd_qemu =3D let entry =3D default_tls_entry | vnc_entry | spice_entry + | rdp_entry | chardev_entry | migrate_entry | backup_entry diff --git a/src/qemu/qemu.conf.in b/src/qemu/qemu.conf.in index 31172303dc..9354e960f1 100644 --- a/src/qemu/qemu.conf.in +++ b/src/qemu/qemu.conf.in @@ -229,6 +229,31 @@ # #spice_sasl_dir =3D "/some/directory/sasl2" =20 +# RDP is configured to listen on 127.0.0.1 by default. +# To make it listen on all public interfaces, uncomment +# this next option. +# +#rdp_listen =3D "0.0.0.0" + +# In order to override the default TLS certificate location for +# RDP certificates, supply a valid path to the certificate directory. +# If the path is not provided, then the default_tls_x509_cert_dir path +# will be used. +# +#rdp_tls_x509_cert_dir =3D "/etc/pki/libvirt-rdp" + +# The default RDP username. This parameter is only used if the +# per-domain XML config does not already provide a username. +# +#rdp_username =3D "user" + +# The default RDP password. This parameter is only used if the +# per-domain XML config does not already provide a password. +# By default, RDP server will not allow password-less connections. +# Obviously change this example here before you set this. +# +#rdp_password =3D "RDP12345" + # Enable use of TLS encryption on the chardev TCP transports. # # It is necessary to setup CA and issue a server certificate @@ -923,6 +948,12 @@ # Path to the SLIRP networking helper. #slirp_helper =3D "/usr/bin/slirp-helper" =20 + +# Path to qemu-rdp +# If this is not an absolute path, the program will be searched for +# in $PATH. +#qemu_rdp =3D "qemu-rdp" + # Path to the dbus-daemon # If this is not an absolute path, the program will be searched for # in $PATH. diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 1708f4f5ad..95113b8eb6 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -104,6 +104,7 @@ VIR_ONCE_GLOBAL_INIT(virQEMUConfig); =20 #define QEMU_BRIDGE_HELPER "qemu-bridge-helper" #define QEMU_PR_HELPER "qemu-pr-helper" +#define QEMU_RDP "qemu-rdp" #define QEMU_DBUS_DAEMON "dbus-daemon" =20 =20 @@ -241,6 +242,7 @@ virQEMUDriverConfig *virQEMUDriverConfigNew(bool privil= eged, } =20 cfg->vncListen =3D g_strdup(VIR_LOOPBACK_IPV4_ADDR); + cfg->rdpListen =3D g_strdup(VIR_LOOPBACK_IPV4_ADDR); cfg->spiceListen =3D g_strdup(VIR_LOOPBACK_IPV4_ADDR); =20 cfg->remotePortMin =3D QEMU_REMOTE_PORT_MIN; @@ -266,6 +268,7 @@ virQEMUDriverConfig *virQEMUDriverConfigNew(bool privil= eged, cfg->prHelperName =3D g_strdup(QEMU_PR_HELPER); cfg->slirpHelperName =3D g_strdup(QEMU_SLIRP_HELPER); cfg->dbusDaemonName =3D g_strdup(QEMU_DBUS_DAEMON); + cfg->qemuRdpName =3D g_strdup(QEMU_RDP); =20 cfg->securityDefaultConfined =3D true; cfg->securityRequireConfined =3D false; @@ -352,6 +355,11 @@ static void virQEMUDriverConfigDispose(void *obj) g_free(cfg->spicePassword); g_free(cfg->spiceSASLdir); =20 + g_free(cfg->rdpTLSx509certdir); + g_free(cfg->rdpListen); + g_free(cfg->rdpUsername); + g_free(cfg->rdpPassword); + g_free(cfg->chardevTLSx509certdir); g_free(cfg->chardevTLSx509secretUUID); =20 @@ -376,6 +384,7 @@ static void virQEMUDriverConfigDispose(void *obj) g_free(cfg->prHelperName); g_free(cfg->slirpHelperName); g_free(cfg->dbusDaemonName); + g_free(cfg->qemuRdpName); =20 g_free(cfg->autoDumpPath); =20 @@ -500,6 +509,21 @@ virQEMUDriverConfigLoadSPICEEntry(virQEMUDriverConfig = *cfg, return 0; } =20 +static int +virQEMUDriverConfigLoadRDPEntry(virQEMUDriverConfig *cfg, + virConf *conf) +{ + if (virConfGetValueString(conf, "rdp_tls_x509_cert_dir", &cfg->rdpTLSx= 509certdir) < 0) + return -1; + if (virConfGetValueString(conf, "rdp_listen", &cfg->rdpListen) < 0) + return -1; + if (virConfGetValueString(conf, "rdp_username", &cfg->rdpUsername) < 0) + return -1; + if (virConfGetValueString(conf, "rdp_password", &cfg->rdpPassword) < 0) + return -1; + + return 0; +} =20 static int virQEMUDriverConfigLoadSpecificTLSEntry(virQEMUDriverConfig *cfg, @@ -714,6 +738,9 @@ virQEMUDriverConfigLoadProcessEntry(virQEMUDriverConfig= *cfg, if (virConfGetValueString(conf, "dbus_daemon", &cfg->dbusDaemonName) <= 0) return -1; =20 + if (virConfGetValueString(conf, "qemu_rdp", &cfg->qemuRdpName) < 0) + return -1; + if (virConfGetValueBool(conf, "set_process_name", &cfg->setProcessName= ) < 0) return -1; if (virConfGetValueUInt(conf, "max_processes", &cfg->maxProcesses) < 0) @@ -1184,6 +1211,9 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfig *= cfg, if (virQEMUDriverConfigLoadSPICEEntry(cfg, conf) < 0) return -1; =20 + if (virQEMUDriverConfigLoadRDPEntry(cfg, conf) < 0) + return -1; + if (virQEMUDriverConfigLoadSpecificTLSEntry(cfg, conf) < 0) return -1; =20 @@ -1271,6 +1301,14 @@ virQEMUDriverConfigValidate(virQEMUDriverConfig *cfg) return -1; } =20 + if (cfg->rdpTLSx509certdir && + !virFileExists(cfg->rdpTLSx509certdir)) { + virReportError(VIR_ERR_CONF_SYNTAX, + _("rdp_tls_x509_cert_dir directory '%1$s' does not = exist"), + cfg->rdpTLSx509certdir); + return -1; + } + if (cfg->chardevTLSx509certdir && !virFileExists(cfg->chardevTLSx509certdir)) { virReportError(VIR_ERR_CONF_SYNTAX, @@ -1356,6 +1394,7 @@ virQEMUDriverConfigSetDefaults(virQEMUDriverConfig *c= fg) =20 SET_TLS_X509_CERT_DEFAULT(vnc); SET_TLS_X509_CERT_DEFAULT(spice); + SET_TLS_X509_CERT_DEFAULT(rdp); SET_TLS_X509_CERT_DEFAULT(chardev); SET_TLS_X509_CERT_DEFAULT(migrate); SET_TLS_X509_CERT_DEFAULT(backup); diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h index af1f59708f..b40b373358 100644 --- a/src/qemu/qemu_conf.h +++ b/src/qemu/qemu_conf.h @@ -136,6 +136,11 @@ struct _virQEMUDriverConfig { char *spicePassword; bool spiceAutoUnixSocket; =20 + char *rdpTLSx509certdir; + char *rdpListen; + char *rdpUsername; + char *rdpPassword; + bool chardevTLS; char *chardevTLSx509certdir; bool chardevTLSx509verify; @@ -174,6 +179,7 @@ struct _virQEMUDriverConfig { char *prHelperName; char *slirpHelperName; char *dbusDaemonName; + char *qemuRdpName; =20 bool macFilter; =20 diff --git a/src/qemu/test_libvirtd_qemu.aug.in b/src/qemu/test_libvirtd_qe= mu.aug.in index c2a1d7d829..8ef26a9da1 100644 --- a/src/qemu/test_libvirtd_qemu.aug.in +++ b/src/qemu/test_libvirtd_qemu.aug.in @@ -22,6 +22,10 @@ module Test_libvirtd_qemu =3D { "spice_password" =3D "XYZ12345" } { "spice_sasl" =3D "1" } { "spice_sasl_dir" =3D "/some/directory/sasl2" } +{ "rdp_listen" =3D "0.0.0.0" } +{ "rdp_tls_x509_cert_dir" =3D "/etc/pki/libvirt-rdp" } +{ "rdp_username" =3D "user" } +{ "rdp_password" =3D "RDP12345" } { "chardev_tls" =3D "1" } { "chardev_tls_x509_cert_dir" =3D "/etc/pki/libvirt-chardev" } { "chardev_tls_x509_verify" =3D "1" } @@ -111,6 +115,7 @@ module Test_libvirtd_qemu =3D { "memory_backing_dir" =3D "/var/lib/libvirt/qemu/ram" } { "pr_helper" =3D "qemu-pr-helper" } { "slirp_helper" =3D "/usr/bin/slirp-helper" } +{ "qemu_rdp" =3D "qemu-rdp" } { "dbus_daemon" =3D "dbus-daemon" } { "swtpm_user" =3D "tss" } { "swtpm_group" =3D "tss" } diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 6189b47d9b..66c05d7b46 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -382,6 +382,8 @@ int qemuTestDriverInit(virQEMUDriver *driver) cfg->vncTLSx509certdir =3D g_strdup("/etc/pki/libvirt-vnc"); VIR_FREE(cfg->spiceTLSx509certdir); cfg->spiceTLSx509certdir =3D g_strdup("/etc/pki/libvirt-spice"); + VIR_FREE(cfg->rdpTLSx509certdir); + cfg->rdpTLSx509certdir =3D g_strdup("/etc/pki/libvirt-rdp"); VIR_FREE(cfg->chardevTLSx509certdir); cfg->chardevTLSx509certdir =3D g_strdup("/etc/pki/libvirt-chardev"); VIR_FREE(cfg->vxhsTLSx509certdir); --=20 2.47.0 From nobody Fri Mar 13 12:47:23 2026 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=1742113360; cv=none; d=zohomail.com; s=zohoarc; b=luSohGI8b7WGL8yhuhNW9WXltrm1OOhrKD1qjM3A225lvqBSPO1flYGtCdS1nxMu8m8eNXE1lttnPNXHLbuhWQcl6xcWRnmdCdLFQJptc8Xi3cL3oRM+O6pm2G4Oi3ZRqbgLJHi/j1/VJw4qqH5BUyKBzAAQd/TuFMjiGTpAUrI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1742113360; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=lYbaIk6fbS2BVvTteG4/pv4LL2gWm5IUATshBkeZZzI=; b=dYStu+sgX73CaZYbpxIXd0yin9zxeYrGmjecrdgTQrRj2GqDvPAF5un1dczu8Ap+sQT1FwhlciE3h08UazF/0h/JuDvR0ho7UuiB4YDGZ0NtkmmKsZ5W0d7wQ+TQGL0uWJass6GUgQhWH1OU+k5TH6oTic8czQKeTmxyJ3aNW0Q= 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 1742113360817842.2080253436377; Sun, 16 Mar 2025 01:22:40 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id BCA841550; Sun, 16 Mar 2025 04:22:39 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 3593022BB; Sun, 16 Mar 2025 04:20:07 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 1D0C522D7; Sun, 16 Mar 2025 04:20:02 -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 51D5B22BC for ; Sun, 16 Mar 2025 04:19:50 -0400 (EDT) Received: from mx-prod-mc-06.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-223-DILaGWGqMDOvOQr-W2L4eQ-1; Sun, 16 Mar 2025 04:19:45 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B0D96180049D for ; Sun, 16 Mar 2025 08:19:44 +0000 (UTC) Received: from localhost (unknown [10.45.242.5]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3387118001DE; Sun, 16 Mar 2025 08:19:42 +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=-1.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,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=1742113190; 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: in-reply-to:in-reply-to:references:references; bh=+VAKYKVh85HdvYL1SkT1Ty5aOK6cwUh8lNQGYoAdDns=; b=NpJJviDUps9GDdu7QZMozTYBkcvLoNBS8cbBXhyRyD6/+lst7KHMKwiSy11/gVNK0W/nVp 5k9yPCBLCGLQ0SoSVF+nKbcvrOVZ8SdmCTCDjrefDOTYlKW5Nv1ZF9JELR0iMrXYaAp4jK I6yYCp8EjvobNEpnVpgoHIZYxxOMrlM= X-MC-Unique: DILaGWGqMDOvOQr-W2L4eQ-1 X-Mimecast-MFC-AGG-ID: DILaGWGqMDOvOQr-W2L4eQ_1742113184 To: devel@lists.libvirt.org Subject: [PATCH v3 07/20] conf: parse optional RDP username & password Date: Sun, 16 Mar 2025 12:18:28 +0400 Message-ID: <20250316081841.3170078-8-marcandre.lureau@redhat.com> In-Reply-To: <20250316081841.3170078-1-marcandre.lureau@redhat.com> References: <20250316081841.3170078-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: cc41cpjuFk_ppmOqA7wyKq-Muug7h3hNLZlgERrbjY0_1742113184 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: N34JLFGUFFSPP3ULIO3J33JGCYPIK3RD X-Message-ID-Hash: N34JLFGUFFSPP3ULIO3J33JGCYPIK3RD X-MailFrom: marcandre.lureau@redhat.com X-Mailman-Rule-Hits: nonmember-moderation 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 CC: mkletzan@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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: "marcandre.lureau--- via Devel" Reply-To: marcandre.lureau@redhat.com X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1742113361970019100 Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau Like VNC, allow to set credentials for RDP. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Martin Kletzander --- src/conf/domain_conf.c | 13 +++++++++++++ src/conf/domain_conf.h | 2 ++ src/conf/schemas/domaincommon.rng | 10 ++++++++++ 3 files changed, 25 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index dedcf76511..7e7b007b9d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1994,6 +1994,7 @@ virDomainGraphicsAuthDefClear(virDomainGraphicsAuthDe= f *def) if (!def) return; =20 + VIR_FREE(def->username); VIR_FREE(def->passwd); =20 /* Don't free def */ @@ -11319,6 +11320,8 @@ virDomainGraphicsAuthDefParseXML(xmlNodePtr node, if (!def->passwd) return 0; =20 + def->username =3D virXMLPropString(node, "username"); + validTo =3D virXMLPropString(node, "passwdValidTo"); if (validTo) { g_autoptr(GDateTime) then =3D NULL; @@ -11708,6 +11711,10 @@ virDomainGraphicsDefParseXMLRDP(virDomainGraphicsD= ef *def, if (STREQ_NULLABLE(multiUser, "yes")) def->data.rdp.multiUser =3D true; =20 + if (virDomainGraphicsAuthDefParseXML(node, &def->data.rdp.auth, + def->type) < 0) + return -1; + return 0; } =20 @@ -26306,6 +26313,10 @@ virDomainGraphicsAuthDefFormatAttr(virBuffer *buf, if (!def->passwd) return; =20 + if (def->username) + virBufferEscapeString(buf, " username=3D'%s'", + def->username); + if (flags & VIR_DOMAIN_DEF_FORMAT_SECURE) virBufferEscapeString(buf, " passwd=3D'%s'", def->passwd); @@ -26580,6 +26591,8 @@ virDomainGraphicsDefFormatRDP(virBuffer *attrBuf, =20 virDomainGraphicsListenDefFormatAddr(attrBuf, glisten, flags); =20 + virDomainGraphicsAuthDefFormatAttr(attrBuf, &def->data.rdp.auth, flags= ); + virDomainGraphicsDefFormatListnes(childBuf, def, flags); } =20 diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 3a97fd866c..dd49cfd144 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1903,6 +1903,7 @@ typedef enum { } virDomainGraphicsAuthConnectedType; =20 struct _virDomainGraphicsAuthDef { + char *username; char *passwd; bool expires; /* Whether there is an expiry time set */ time_t validTo; /* seconds since epoch */ @@ -2027,6 +2028,7 @@ struct _virDomainGraphicsDef { bool autoport; bool replaceUser; bool multiUser; + virDomainGraphicsAuthDef auth; } rdp; struct { char *display; diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincom= mon.rng index 3276569325..7ef45a1731 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -4540,6 +4540,16 @@ + + + + + + + + + + --=20 2.47.0 From nobody Fri Mar 13 12:47:23 2026 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=1742113387; cv=none; d=zohomail.com; s=zohoarc; b=kEb0cxBRjm4gMvoeoKY4tEdbBhfSdGFOdOWlgai9GGJs+3NI2kQedfNueo5s2E481tCEMiox6KsUptMIj8j8ML2MwUNRxI+Upt4w9WFxuMFEpVpNw/YNwnoPM4FJEDPsw5jkI0admjrnNuN1FdYFHqcdj9JqW+FvUBg8MuSSloY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1742113387; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=NS6FWTgBbid7JfEoilNpT73QyxFSIrbVPGREQgWFrdA=; b=hv+F5YdlkMWxqTvwmcKw/eGMhjC8dTOJAL74vn/qly1uTRK3IfxH3jTtLfjRGYqm6NuwBVXsnQnbafoXw61ymLDamyc72YJvo8cII0zrPy9TqnQqYNHlrfphwwSzeOylrwWRqVgEflVzRi+8kqABe3w0vZTuXxNi49E6i+880V4= 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 1742113387195887.891645845625; Sun, 16 Mar 2025 01:23:07 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 8B2A123B5; Sun, 16 Mar 2025 04:23:06 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 15FE6236D; Sun, 16 Mar 2025 04:20:14 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id BD8362315; Sun, 16 Mar 2025 04:20:09 -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 66B192368 for ; Sun, 16 Mar 2025 04:19:55 -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-607-sJV90pvmOjOnN1i1iDpw6w-1; Sun, 16 Mar 2025 04:19:53 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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 EF14D1801A06 for ; Sun, 16 Mar 2025 08:19:52 +0000 (UTC) Received: from localhost (unknown [10.45.242.5]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id ED9981956095; Sun, 16 Mar 2025 08:19:50 +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=-1.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,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=1742113195; 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: in-reply-to:in-reply-to:references:references; bh=7dU6FpLcyGf5WejGV6B8O1AABFgJJtdjO6qClbisVGQ=; b=RGjf/AuTEkRnMrzkG9YpuDrbAEUUgy+nYXovMUa5SVFtMJXZLGcFZQTtTnlkqnUUtBPmrm lY2zynqzhUFAuDn86PEn+9o5f9evXW7Z2mm/tvhjNotjhZlJDLLg74vP93pzGTeE66ftFx VhfqRcRz9XORBerDHMuG+1ovGCirVKo= X-MC-Unique: sJV90pvmOjOnN1i1iDpw6w-1 X-Mimecast-MFC-AGG-ID: sJV90pvmOjOnN1i1iDpw6w_1742113193 To: devel@lists.libvirt.org Subject: [PATCH v3 08/20] conf: generalize virDomainDefHasSpiceGraphics Date: Sun, 16 Mar 2025 12:18:29 +0400 Message-ID: <20250316081841.3170078-9-marcandre.lureau@redhat.com> In-Reply-To: <20250316081841.3170078-1-marcandre.lureau@redhat.com> References: <20250316081841.3170078-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: QaMfAtLFWwT61yzFJnOB5RHNb57lwI2vWIba0RiCuVQ_1742113193 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: FGO3YMLL2IIFAOCA5PTDKLRUQ57F4HPT X-Message-ID-Hash: FGO3YMLL2IIFAOCA5PTDKLRUQ57F4HPT X-MailFrom: marcandre.lureau@redhat.com X-Mailman-Rule-Hits: nonmember-moderation 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 CC: mkletzan@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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: "marcandre.lureau--- via Devel" Reply-To: marcandre.lureau@redhat.com X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1742113387521019000 Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau Generalize the function, broaden its potential usage. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Martin Kletzander --- src/conf/domain_conf.c | 15 ++++++++++++--- src/conf/domain_conf.h | 2 +- src/libvirt_private.syms | 2 +- src/qemu/qemu_validate.c | 4 ++-- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 7e7b007b9d..5748a89bd1 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -31771,15 +31771,24 @@ virDomainObjGetMessages(virDomainObj *vm, =20 } =20 + +/** + * virDomainDefHasGraphics: + * @def: domain definition + * @type: a graphics type + * + * Returns true if domain has a graphics of given type. + */ bool -virDomainDefHasSpiceGraphics(const virDomainDef *def) +virDomainDefHasGraphics(const virDomainDef *def, virDomainGraphicsType typ= e) { size_t i =3D 0; =20 for (i =3D 0; i < def->ngraphics; i++) { - if (def->graphics[i]->type =3D=3D VIR_DOMAIN_GRAPHICS_TYPE_SPICE) { + virDomainGraphicsDef *graphics =3D def->graphics[i]; + + if (graphics->type =3D=3D type) return true; - } } =20 return false; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index dd49cfd144..32756e4dce 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -4631,4 +4631,4 @@ virDomainObjGetMessages(virDomainObj *vm, unsigned int flags); =20 bool -virDomainDefHasSpiceGraphics(const virDomainDef *def); +virDomainDefHasGraphics(const virDomainDef *def, virDomainGraphicsType typ= e); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index e78abdad15..f4ec26eba3 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -337,6 +337,7 @@ virDomainDefGetVcpus; virDomainDefGetVcpusMax; virDomainDefGetVcpusTopology; virDomainDefHasDeviceAddress; +virDomainDefHasGraphics; virDomainDefHasManagedPR; virDomainDefHasMdevHostdev; virDomainDefHasMemballoon; @@ -345,7 +346,6 @@ virDomainDefHasNVMeDisk; virDomainDefHasOldStyleROUEFI; virDomainDefHasOldStyleUEFI; virDomainDefHasPCIHostdev; -virDomainDefHasSpiceGraphics; virDomainDefHasUSB; virDomainDefHasVcpusOffline; virDomainDefHasVDPANet; diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index af334aa96a..ef217ffc9e 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -2153,7 +2153,7 @@ qemuValidateDomainChrSourceDef(const virDomainChrSour= ceDef *def, =20 case VIR_DOMAIN_CHR_TYPE_SPICEVMC: case VIR_DOMAIN_CHR_TYPE_SPICEPORT: - if (!virDomainDefHasSpiceGraphics(vmdef)) { + if (!virDomainDefHasGraphics(vmdef, VIR_DOMAIN_GRAPHICS_TYPE_SPICE= )) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("chardev '%1$s' not supported without spice g= raphics"), virDomainChrTypeToString(def->type)); @@ -4737,7 +4737,7 @@ qemuValidateDomainDeviceDefAudio(virDomainAudioDef *a= udio, break; =20 case VIR_DOMAIN_AUDIO_TYPE_SPICE: - if (!virDomainDefHasSpiceGraphics(def)) { + if (!virDomainDefHasGraphics(def, VIR_DOMAIN_GRAPHICS_TYPE_SPICE))= { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Spice audio is not supported without spice g= raphics")); return -1; --=20 2.47.0 From nobody Fri Mar 13 12:47:23 2026 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=1742113416; cv=none; d=zohomail.com; s=zohoarc; b=kEWRoqMHiz15ZJ7dJDCMIdBuYTcU2rw0rb6w8catd0lupTfXkluOuu6Q8mVXqzU1YqsmNA7lCfP3keYgZJU27cVuVO5XhmoWZW4CZsZCa49acRu5TkAA+6MnBE3ffIIb0gVLsVsUBG11lsmSHkMSsXEunLB6iNe7iXe5EJXkpIs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1742113416; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=iVe+xvwkpSW+7zu81r7AdQfpO1AmkNkUaS+9sah8TsQ=; b=Mi+U67/dj/EPb880xsXzlDNis+2v6uEmCC8zIJ63PGxk1+f3/Z82XZAMnFKimCeZwvkucWgnorGM6g4AC+K+obtvbGo8c1OeTJbMyLsdLqnLnjjAq1vOx9mFyUFd4wABw4UdP4Lm4eKyiW9lFgJ6l+esBkRRXDwCr2Ut7OyZsJU= 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 1742113416407655.5763983776008; Sun, 16 Mar 2025 01:23:36 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 6393E22C7; Sun, 16 Mar 2025 04:23:35 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id B10B1235D; Sun, 16 Mar 2025 04:20:27 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 1B3B62282; Sun, 16 Mar 2025 04:20:23 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 69443231C for ; Sun, 16 Mar 2025 04:20:04 -0400 (EDT) Received: from mx-prod-mc-06.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-94-AOWlyl15OVeHiwlq25JgwQ-1; Sun, 16 Mar 2025 04:20:02 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 69A57180025B for ; Sun, 16 Mar 2025 08:20:01 +0000 (UTC) Received: from localhost (unknown [10.45.242.5]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3F13E1800946; Sun, 16 Mar 2025 08:19:58 +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=1742113204; 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: in-reply-to:in-reply-to:references:references; bh=PMhY3sJoY1rizelQvkSpWfdeWpyXOb7zm6pZ6uWA5mQ=; b=URjIpxJgeUFEMBnqEJ3/0CSLbtccUkN2Nd6xxrGDj7/IraDv1UpSuYCvF3uXEXMjR5KT5G biXJ2f/t+u/dLEc9ts+JL1WzrDRNOUNASrvbQVfTtJ0JjwdrT1/6YD9vbHrC0B06yIUYvi rSfTItgreOS7vCVGyo0RbGKIId7WjcE= X-MC-Unique: AOWlyl15OVeHiwlq25JgwQ-1 X-Mimecast-MFC-AGG-ID: AOWlyl15OVeHiwlq25JgwQ_1742113201 To: devel@lists.libvirt.org Subject: [PATCH v3 09/20] qemu: use virDomainDefHasGraphics Date: Sun, 16 Mar 2025 12:18:30 +0400 Message-ID: <20250316081841.3170078-10-marcandre.lureau@redhat.com> In-Reply-To: <20250316081841.3170078-1-marcandre.lureau@redhat.com> References: <20250316081841.3170078-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: I1dwwyu8IspRELABmLSzRxd_2rOWWe6nS69LiEDnsy4_1742113201 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: BJMGQLSHXMXUBYTFZHTXL65DTVBBGTVZ X-Message-ID-Hash: BJMGQLSHXMXUBYTFZHTXL65DTVBBGTVZ X-MailFrom: marcandre.lureau@redhat.com X-Mailman-Rule-Hits: nonmember-moderation 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 CC: mkletzan@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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: "marcandre.lureau--- via Devel" Reply-To: marcandre.lureau@redhat.com X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1742113419377019100 Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Martin Kletzander --- src/qemu/qemu_validate.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index ef217ffc9e..eae75d7bf5 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -4491,8 +4491,6 @@ qemuValidateDomainDeviceDefGraphics(const virDomainGr= aphicsDef *graphics, virQEMUCaps *qemuCaps) { virDomainCapsDeviceGraphics graphicsCaps =3D { 0 }; - bool have_egl_headless =3D false; - size_t i; =20 virQEMUCapsFillDomainDeviceGraphicsCaps(qemuCaps, &graphicsCaps); =20 @@ -4503,18 +4501,11 @@ qemuValidateDomainDeviceDefGraphics(const virDomain= GraphicsDef *graphics, return -1; } =20 - for (i =3D 0; i < def->ngraphics; i++) { - if (def->graphics[i]->type =3D=3D VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEA= DLESS) { - have_egl_headless =3D true; - break; - } - } - /* Only VNC and SPICE can be paired with egl-headless, the other types * either don't make sense to pair with egl-headless or aren't even * supported by QEMU. */ - if (have_egl_headless) { + if (virDomainDefHasGraphics(def, VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS= )) { if (graphics->type !=3D VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS && graphics->type !=3D VIR_DOMAIN_GRAPHICS_TYPE_VNC && graphics->type !=3D VIR_DOMAIN_GRAPHICS_TYPE_SPICE) { --=20 2.47.0 From nobody Fri Mar 13 12:47:23 2026 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=1742113437; cv=none; d=zohomail.com; s=zohoarc; b=dF55mjX/ktXFx/+UiRGSmCIEu2yo4HYFvaWifsfbjLV0yd0nRzUX/H0TZ7gd1GLIBb0LFizP6X7tVOzqPjdT9dDBFokQy5y+NHDNPNlO8W5PGMFch/MAqqlNs4Z3kgdU1F0MaTHcD9HOvQu3n+aaYUQvfqoKMEjrCR1j0Sh+EEM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1742113437; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=ukXBGIEFnJXPElCz1KJTGFKX5AbqT6zps/uY90apKg8=; b=i+izG1f1ILQahswpUxfMKrqWT7mfLC+pGXct28JW9e6IfuCKWObzGXIN+ocjScda/Yk2PCMMVFfQAYpZ3UkxdGflZWI1LUj4HTA8qSlTQXWTCAX2lu7hi2vg9Bw2BZODqDk4D/EoTEstAkvnMtaBlCxk8f3f+iL+LUYBAFXC0JM= 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 1742113437698940.2760882917412; Sun, 16 Mar 2025 01:23:57 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id A6B0622AC; Sun, 16 Mar 2025 04:23:56 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id AA8D2226F; Sun, 16 Mar 2025 04:20:30 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 9EB802284; Sun, 16 Mar 2025 04:20:25 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 0DB062284 for ; Sun, 16 Mar 2025 04:20:14 -0400 (EDT) Received: from mx-prod-mc-06.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-474-9INumO-CP262xpW3gha02w-1; Sun, 16 Mar 2025 04:20:10 -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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5EDAC180025F for ; Sun, 16 Mar 2025 08:20:09 +0000 (UTC) Received: from localhost (unknown [10.45.242.5]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7049B1828A84; Sun, 16 Mar 2025 08:20:06 +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=1742113213; 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: in-reply-to:in-reply-to:references:references; bh=xzvwajcTYF0e028/jc7186ZsFcIaAyzFvgofNfHG1/Y=; b=O5nwNBukBiziHhpgqTNHkjdPtu4RS7iWoq2SmhIawb3HoGq9nY69Q0lAeGPIoRY6bWQYws QE2CeaH+5ckibj2hWLUUEZBdQauIS41+u3dUGoHrAoYqb9bH2F4VNy6Rj3QcP4/OUBsCfy QDE2kVJLxtbgZrHsHkWzpBSNOvAMmS4= X-MC-Unique: 9INumO-CP262xpW3gha02w-1 X-Mimecast-MFC-AGG-ID: 9INumO-CP262xpW3gha02w_1742113209 To: devel@lists.libvirt.org Subject: [PATCH v3 10/20] qemu: add RDP ports range allocator Date: Sun, 16 Mar 2025 12:18:31 +0400 Message-ID: <20250316081841.3170078-11-marcandre.lureau@redhat.com> In-Reply-To: <20250316081841.3170078-1-marcandre.lureau@redhat.com> References: <20250316081841.3170078-1-marcandre.lureau@redhat.com> 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: WzgKqFQoRR9ocz_v0Ie7FlqLAhevTS7Ii8cuKjcWq9w_1742113209 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: KAITA5UO3JPHISOPY4IV5R4KGL6XVCGN X-Message-ID-Hash: KAITA5UO3JPHISOPY4IV5R4KGL6XVCGN X-MailFrom: marcandre.lureau@redhat.com X-Mailman-Rule-Hits: nonmember-moderation 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 CC: mkletzan@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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: "marcandre.lureau--- via Devel" Reply-To: marcandre.lureau@redhat.com X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1742113438730019100 Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau RDP server uses port 3389 by default. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Martin Kletzander --- src/qemu/qemu_conf.c | 6 ++++++ src/qemu/qemu_conf.h | 6 ++++++ src/qemu/qemu_driver.c | 8 ++++++++ 3 files changed, 20 insertions(+) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 95113b8eb6..65016feb6a 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -65,6 +65,9 @@ VIR_LOG_INIT("qemu.qemu_conf"); #define QEMU_REMOTE_PORT_MIN 5900 #define QEMU_REMOTE_PORT_MAX 65535 =20 +#define QEMU_RDP_PORT_MIN 3389 +#define QEMU_RDP_PORT_MAX 65535 + #define QEMU_WEBSOCKET_PORT_MIN 5700 #define QEMU_WEBSOCKET_PORT_MAX 65535 =20 @@ -248,6 +251,9 @@ virQEMUDriverConfig *virQEMUDriverConfigNew(bool privil= eged, cfg->remotePortMin =3D QEMU_REMOTE_PORT_MIN; cfg->remotePortMax =3D QEMU_REMOTE_PORT_MAX; =20 + cfg->rdpPortMin =3D QEMU_RDP_PORT_MIN; + cfg->rdpPortMax =3D QEMU_RDP_PORT_MAX; + cfg->webSocketPortMin =3D QEMU_WEBSOCKET_PORT_MIN; cfg->webSocketPortMax =3D QEMU_WEBSOCKET_PORT_MAX; =20 diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h index b40b373358..bbbbd6bf67 100644 --- a/src/qemu/qemu_conf.h +++ b/src/qemu/qemu_conf.h @@ -169,6 +169,9 @@ struct _virQEMUDriverConfig { unsigned int remotePortMin; unsigned int remotePortMax; =20 + unsigned int rdpPortMin; + unsigned int rdpPortMax; + unsigned int webSocketPortMin; unsigned int webSocketPortMax; =20 @@ -312,6 +315,9 @@ struct _virQEMUDriver { /* Immutable pointer, immutable object */ virPortAllocatorRange *webSocketPorts; =20 + /* Immutable pointer, immutable object */ + virPortAllocatorRange *rdpPorts; + /* Immutable pointer, immutable object */ virPortAllocatorRange *migrationPorts; =20 diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 6f0ce5a2f3..d72805f0c7 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -701,6 +701,13 @@ qemuStateInitialize(bool privileged, cfg->webSocketPortMax)) =3D=3D NULL) goto error; =20 + if ((qemu_driver->rdpPorts =3D + virPortAllocatorRangeNew(_("rdp"), + cfg->rdpPortMin, + cfg->rdpPortMax)) =3D=3D NULL) + goto error; + + if ((qemu_driver->migrationPorts =3D virPortAllocatorRangeNew(_("migration"), cfg->migrationPortMin, @@ -1050,6 +1057,7 @@ qemuStateCleanup(void) virSysinfoDefFree(qemu_driver->hostsysinfo); virPortAllocatorRangeFree(qemu_driver->migrationPorts); virPortAllocatorRangeFree(qemu_driver->webSocketPorts); + virPortAllocatorRangeFree(qemu_driver->rdpPorts); virPortAllocatorRangeFree(qemu_driver->remotePorts); virObjectUnref(qemu_driver->hostdevMgr); virObjectUnref(qemu_driver->securityManager); --=20 2.47.0 From nobody Fri Mar 13 12:47:23 2026 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=1742113457; cv=none; d=zohomail.com; s=zohoarc; b=YySQHNEIg/KSA0YKqip60Q7TSo2srC4EtQgAUw9pOwpMgmdj2yyXrHWw2wmEoMdqdm3Ghc/3G6V038d1UbVCoSMNo94xYrKpZZ50HmpQQl/42CcWMknPBCLJcAa3mpBx23QN3pyw1102NFi8nkwg3OAzB1eDHNm/DfQCt9GJyN4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1742113457; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=n1mZl/eLlKI48mJkRDOnBaVvqnbkET8V9/hXwHbsFs0=; b=J13hpmAzSVkLEGGufRjO0DgyXqC4bjNER2YbuSde9UMFDBVJwRHTDDNCQ6n71IRmVnZY36oPTO8CDgD/ArqnpiWv5NigCZ95EcHNVG72FcQv7y26NQRh9dPLMShutkxXgJy52kFHjMiHDVavn82cYv5oSsxaY7PsLAGitdVICBU= 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 174211345736135.83666049946089; Sun, 16 Mar 2025 01:24:17 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id AEB41147B; Sun, 16 Mar 2025 04:24:16 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 74CC022D7; Sun, 16 Mar 2025 04:20:38 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 8887B22A8; Sun, 16 Mar 2025 04:20:34 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 0C24A235B for ; Sun, 16 Mar 2025 04:20:20 -0400 (EDT) Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-250-PUC6kc3uN96nz92Vd8jR_A-1; Sun, 16 Mar 2025 04:20:18 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id ACAF419560B0 for ; Sun, 16 Mar 2025 08:20:17 +0000 (UTC) Received: from localhost (unknown [10.45.242.5]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9C87C1800946; Sun, 16 Mar 2025 08:20:15 +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=1742113219; 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: in-reply-to:in-reply-to:references:references; bh=AeNkBfDO/X2Zuh880L4p2FR3PJEkoFCV+Yo2C/IqyTM=; b=MqYoa3qjB7vPt33aMCE9gAY/E3OJB95Xxvy4nBvAIpo6GHsjYXB7wnsgTiMOXWq1LxYqyY iWSMx2L85QGyZSKYcL1ruBxYjO07CGxKGoI6gFtLLvyQqixUzuRKSirABrZyajs9nB5V+S Ij0jx1klQYaiy2Z3SKB9ypvt9YAITyk= X-MC-Unique: PUC6kc3uN96nz92Vd8jR_A-1 X-Mimecast-MFC-AGG-ID: PUC6kc3uN96nz92Vd8jR_A_1742113217 To: devel@lists.libvirt.org Subject: [PATCH v3 11/20] qemu: limit to one Date: Sun, 16 Mar 2025 12:18:32 +0400 Message-ID: <20250316081841.3170078-12-marcandre.lureau@redhat.com> In-Reply-To: <20250316081841.3170078-1-marcandre.lureau@redhat.com> References: <20250316081841.3170078-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: h_vVVHTbIKMOQ8hpSU61EyjwSI4KCK8bHxeEUlqwAwc_1742113217 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 4TSLN6SIN3U4RJN6FY7PXQQKRJXSZ2WL X-Message-ID-Hash: 4TSLN6SIN3U4RJN6FY7PXQQKRJXSZ2WL X-MailFrom: marcandre.lureau@redhat.com X-Mailman-Rule-Hits: nonmember-moderation 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 CC: mkletzan@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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: "marcandre.lureau--- via Devel" Reply-To: marcandre.lureau@redhat.com X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1742113457855019000 Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Martin Kletzander --- src/qemu/qemu_command.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index ead2307ed7..84ff62cd6c 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -8432,6 +8432,7 @@ qemuBuildGraphicsCommandLine(virQEMUDriverConfig *cfg, =20 break; case VIR_DOMAIN_GRAPHICS_TYPE_RDP: + break; case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP: return -1; case VIR_DOMAIN_GRAPHICS_TYPE_LAST: @@ -9981,6 +9982,7 @@ qemuBuildCommandLineValidate(virQEMUDriver *driver, int spice =3D 0; int egl_headless =3D 0; int dbus =3D 0; + int rdp =3D 0; =20 if (!driver->privileged) { /* If we have no cgroups then we can have no tunings that @@ -10029,15 +10031,17 @@ qemuBuildCommandLineValidate(virQEMUDriver *drive= r, ++dbus; break; case VIR_DOMAIN_GRAPHICS_TYPE_RDP: + ++rdp; + break; case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP: case VIR_DOMAIN_GRAPHICS_TYPE_LAST: break; } } =20 - if (sdl > 1 || vnc > 1 || spice > 1 || egl_headless > 1 || dbus > 1) { + if (sdl > 1 || vnc > 1 || spice > 1 || egl_headless > 1 || dbus > 1 ||= rdp > 1) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("only 1 graphics device of each type (sdl, vnc, s= pice, headless, dbus) is supported")); + _("only 1 graphics device of each type (sdl, vnc, s= pice, headless, dbus, rdp) is supported")); return -1; } =20 --=20 2.47.0 From nobody Fri Mar 13 12:47:23 2026 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=1742113482; cv=none; d=zohomail.com; s=zohoarc; b=O3TqHghLcDxBs5NHwGI2GlugXqi4H2dXPoG7v5bT5IObSMWIoaUyFnK/5DEWlI7W893aq18Kpucx7e51tZrRMLAF0v/rG8awFB6l0d7eU6P4ZIqYsVtujNED3vtv0Oz4Th58cTP0KhdS7dxz5UO2/efypBRjv+bZO4OrVZ0cxPA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1742113482; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=0fJzm8UIpowYuvffIlHsx8wZUj+kvTonwAERU8LV5yc=; b=MTnG4fiZVSvuUnfYhBnReHk7OGeA59N8uCV4cMJQQ740DouoFptdrBOQTDKuDjCee7Az9FtzbDi6IBV3hLDu+/EZ4UGoUN1jCvuDyhca8PFiZ5XDMIrNAsPVmrz9seilhRm79R52N5TPXYIex6Q+DwgLsvanPtlcjpHJsZ8ZO+0= 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 1742113482310724.294194092167; Sun, 16 Mar 2025 01:24:42 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id A498D23D2; Sun, 16 Mar 2025 04:24:41 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 210DF2397; Sun, 16 Mar 2025 04:20:46 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 573DA22D4; Sun, 16 Mar 2025 04:20:41 -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 239DB22D4 for ; Sun, 16 Mar 2025 04:20:28 -0400 (EDT) Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-425-6n9oHSItOMuZStUSQ22Iqw-1; Sun, 16 Mar 2025 04:20:26 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B878819560B6 for ; Sun, 16 Mar 2025 08:20:25 +0000 (UTC) Received: from localhost (unknown [10.45.242.5]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B51F51956095; Sun, 16 Mar 2025 08:20:23 +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=-1.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,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=1742113227; 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: in-reply-to:in-reply-to:references:references; bh=UYx/4dszP+g8ehi9EWLGiDrHd4u/6gtqed8sFqfpknI=; b=JDlHV+hoI855dAEWk7Ue7/a5F7udaHv+mPUz1aTanVlk/wWS9MwkeuHIZyMc9tM64jgp61 7lZDFrqi6+x4+9qoAOzZujxRRdKonzGDV6gTJ9UZL3OaG671aqaQJTVN7HIn+wpnP0u74C x9Nef1cqo1ZuB2LxozGnUOzDF713Eyc= X-MC-Unique: 6n9oHSItOMuZStUSQ22Iqw-1 X-Mimecast-MFC-AGG-ID: 6n9oHSItOMuZStUSQ22Iqw_1742113225 To: devel@lists.libvirt.org Subject: [PATCH v3 12/20] qemu/virtiofs: use domainLogContext Date: Sun, 16 Mar 2025 12:18:33 +0400 Message-ID: <20250316081841.3170078-13-marcandre.lureau@redhat.com> In-Reply-To: <20250316081841.3170078-1-marcandre.lureau@redhat.com> References: <20250316081841.3170078-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: b2eNRAU5oTmTQGvGCGxn7uXC69tiV51eAy2dVl32dLQ_1742113225 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: WRBYWEUSB3KQ52IS2JOF3KKJ3IZJKCKU X-Message-ID-Hash: WRBYWEUSB3KQ52IS2JOF3KKJ3IZJKCKU X-MailFrom: marcandre.lureau@redhat.com X-Mailman-Rule-Hits: nonmember-moderation 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 CC: mkletzan@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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: "marcandre.lureau--- via Devel" Reply-To: marcandre.lureau@redhat.com X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1742113483843019000 Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Martin Kletzander --- src/qemu/qemu_virtiofs.c | 53 +++++++++------------------------------- 1 file changed, 12 insertions(+), 41 deletions(-) diff --git a/src/qemu/qemu_virtiofs.c b/src/qemu/qemu_virtiofs.c index dd3e0dd9fe..aa282024a4 100644 --- a/src/qemu/qemu_virtiofs.c +++ b/src/qemu/qemu_virtiofs.c @@ -75,19 +75,6 @@ qemuVirtioFSCreateSocketFilename(virDomainObj *vm, } =20 =20 -static char * -qemuVirtioFSCreateLogFilename(virQEMUDriverConfig *cfg, - const virDomainDef *def, - const char *alias) -{ - g_autofree char *name =3D NULL; - - name =3D g_strdup_printf("%s-%s", def->name, alias); - - return virFileBuildPath(cfg->logDir, name, "-virtiofsd.log"); -} - - static int qemuVirtioFSOpenChardev(virQEMUDriver *driver, virDomainObj *vm, @@ -244,10 +231,11 @@ qemuVirtioFSStart(virQEMUDriver *driver, g_autoptr(virCommand) cmd =3D NULL; g_autofree char *socket_path =3D NULL; g_autofree char *pidfile =3D NULL; - g_autofree char *logpath =3D NULL; + g_autofree char *logname =3D NULL; pid_t pid =3D (pid_t) -1; VIR_AUTOCLOSE fd =3D -1; - VIR_AUTOCLOSE logfd =3D -1; + int logfd =3D -1; + g_autoptr(domainLogContext) logContext =3D NULL; int rc; =20 if (!virFileIsExecutable(fs->binary)) { @@ -272,35 +260,18 @@ qemuVirtioFSStart(virQEMUDriver *driver, if ((fd =3D qemuVirtioFSOpenChardev(driver, vm, socket_path)) < 0) goto error; =20 - logpath =3D qemuVirtioFSCreateLogFilename(cfg, vm->def, fs->info.alias= ); - - if (cfg->stdioLogD) { - g_autoptr(virLogManager) logManager =3D virLogManagerNew(driver->p= rivileged); =20 - if (!logManager) - goto error; - - if ((logfd =3D virLogManagerDomainOpenLogFile(logManager, - "qemu", - vm->def->uuid, - vm->def->name, - logpath, - 0, - NULL, NULL)) < 0) - goto error; - } else { - if ((logfd =3D open(logpath, O_WRONLY | O_CREAT | O_APPEND, S_IRUS= R | S_IWUSR)) < 0) { - virReportSystemError(errno, _("failed to create logfile %1$s"), - logpath); - goto error; - } - if (virSetCloseExec(logfd) < 0) { - virReportSystemError(errno, _("failed to set close-on-exec fla= g on %1$s"), - logpath); - goto error; - } + logname =3D g_strdup_printf("%s-%s-virtiofsd", vm->def->name, fs->info= .alias); + if (!(logContext =3D domainLogContextNew(cfg->stdioLogD, cfg->logDir, + QEMU_DRIVER_NAME, + vm, driver->privileged, + logname))) { + virLastErrorPrefixMessage("%s", _("can't open log context")); + goto error; } =20 + logfd =3D domainLogContextGetWriteFD(logContext); + if (!(cmd =3D qemuVirtioFSBuildCommandLine(cfg, fs, &fd))) goto error; =20 --=20 2.47.0 From nobody Fri Mar 13 12:47:23 2026 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=1742113503; cv=none; d=zohomail.com; s=zohoarc; b=cFyrGDCXlw/PZkdmmSTNO7Afl0s7YnuppzbC+04Iy2olKCyJQ3s+4e9/z0jjnhxj5A6ZqDzt5isEhJIrwX6uvPaXl+xZq7/lxXvEtwx+LVJo3aEaowC2qA+Rsfzo6PoMQAmnXO77E0izhpjxOvkJft4Pwopx1gEoqcENphkv9y8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1742113503; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=iSAdnH86GbR7m4KcT4FlHRApUF/mPO99m76afbLsarc=; b=EwewIITaX9tz8xQh6TEK8idJOwZOaFL9GLKLKRPgjPgeD23lcyBMjXFf7q08plVzpygMInt2dDampcHWswtAydtQ2j8Y4PeXtAv2b6YUkU5DNhqr4Ph6n+k8XQE5ZeJucOTX9dJ5lpylCO461R9BFqG/ijoLYiZKOEzpjeSW1cc= 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 1742113503941136.83015312571592; Sun, 16 Mar 2025 01:25:03 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 619EB2366; Sun, 16 Mar 2025 04:25:03 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id F184722D5; Sun, 16 Mar 2025 04:20:49 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 15C042285; Sun, 16 Mar 2025 04:20:45 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 133112285 for ; Sun, 16 Mar 2025 04:20:36 -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-646-TfJPQu-pMc-lA1sud_8SwQ-1; Sun, 16 Mar 2025 04:20:34 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 B9C5A180882E for ; Sun, 16 Mar 2025 08:20:33 +0000 (UTC) Received: from localhost (unknown [10.45.242.5]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id CB53E1801756; Sun, 16 Mar 2025 08:20:31 +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=1742113235; 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: in-reply-to:in-reply-to:references:references; bh=IzxH2YGqZxbhHHweRTfhArMn7k2xj0QcCZg2DiO5VXI=; b=CtWNGEsYeh7uJ/29R+HeuWdBEbic+dEjI2nhJl/Ellc4VFcx4mS04D5T7oY4OC5DKFim+j UdVHJt0EniJE4+DgFMUMVDUPfe4RJtNXnLQDtFbGJyiuau715HcO8qK0fXIKCUWZHHcLGq b/Sv+l448LTzVySxMkoV00kaTCmcAL0= X-MC-Unique: TfJPQu-pMc-lA1sud_8SwQ-1 X-Mimecast-MFC-AGG-ID: TfJPQu-pMc-lA1sud_8SwQ_1742113233 To: devel@lists.libvirt.org Subject: [PATCH v3 13/20] qemu/dbus: keep a connection to the VM D-Bus Date: Sun, 16 Mar 2025 12:18:34 +0400 Message-ID: <20250316081841.3170078-14-marcandre.lureau@redhat.com> In-Reply-To: <20250316081841.3170078-1-marcandre.lureau@redhat.com> References: <20250316081841.3170078-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: Oz0QDMvrguSsNxRaQHTzj7oULRPQP18Vfx9xu17PaEQ_1742113233 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 4QF3UAQAOJTJECLJQGMYXRYA4WXLIHMS X-Message-ID-Hash: 4QF3UAQAOJTJECLJQGMYXRYA4WXLIHMS X-MailFrom: marcandre.lureau@redhat.com X-Mailman-Rule-Hits: nonmember-moderation 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 CC: mkletzan@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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: "marcandre.lureau--- via Devel" Reply-To: marcandre.lureau@redhat.com X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1742113505733019000 Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau The following changes are going to communicate with the qemu-rdp server through the VM D-Bus bus, keep a connection for that and further usage. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Martin Kletzander --- src/qemu/qemu_dbus.c | 35 +++++++++++++++++++++++++++++++++++ src/qemu/qemu_dbus.h | 3 +++ src/qemu/qemu_domain.h | 2 ++ src/qemu/qemu_process.c | 3 +++ 4 files changed, 43 insertions(+) diff --git a/src/qemu/qemu_dbus.c b/src/qemu/qemu_dbus.c index 06b655d870..c9e99ea27b 100644 --- a/src/qemu/qemu_dbus.c +++ b/src/qemu/qemu_dbus.c @@ -84,6 +84,36 @@ qemuDBusGetAddress(virQEMUDriver *driver, } =20 =20 +bool +qemuDBusConnect(virQEMUDriver *driver, + virDomainObj *vm) +{ + qemuDomainObjPrivate *priv =3D vm->privateData; + g_autoptr(GError) gerr =3D NULL; + g_autofree char *address =3D NULL; + + if (priv->dbusConnection) + return true; + + address =3D qemuDBusGetAddress(driver, vm); + if (!address) + return false; + + priv->dbusConnection =3D + g_dbus_connection_new_for_address_sync(address, + G_DBUS_CONNECTION_FLAGS_AUT= HENTICATION_CLIENT| + G_DBUS_CONNECTION_FLAGS_MES= SAGE_BUS_CONNECTION, + NULL, NULL, &gerr); + if (!priv->dbusConnection) { + virReportError(VIR_ERR_OPERATION_FAILED, + _("Failed to connect to dbus-daemon: %1$s"), gerr->m= essage); + return false; + } + + return true; +} + + static int qemuDBusWriteConfig(const char *filename, const char *path) { @@ -140,6 +170,8 @@ qemuDBusStop(virQEMUDriver *driver, } else { priv->dbusDaemonRunning =3D false; } + + g_clear_object(&priv->dbusConnection); } =20 =20 @@ -264,6 +296,9 @@ qemuDBusStart(virQEMUDriver *driver, if (qemuSecurityDomainSetPathLabel(driver, vm, sockpath, false) < 0) goto cleanup; =20 + if (!qemuDBusConnect(driver, vm)) + goto cleanup; + priv->dbusDaemonRunning =3D true; ret =3D 0; cleanup: diff --git a/src/qemu/qemu_dbus.h b/src/qemu/qemu_dbus.h index b27f38a591..2d97c6df2d 100644 --- a/src/qemu/qemu_dbus.h +++ b/src/qemu/qemu_dbus.h @@ -24,6 +24,9 @@ char *qemuDBusGetAddress(virQEMUDriver *driver, virDomainObj *vm); =20 +bool qemuDBusConnect(virQEMUDriver *driver, + virDomainObj *vm); + int qemuDBusStart(virQEMUDriver *driver, virDomainObj *vm); =20 diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 8e53a270a7..a70617f3c0 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -39,6 +39,7 @@ #include "qemu_fd.h" #include "virchrdev.h" #include "virobject.h" +#include "virgdbus.h" #include "virdomainmomentobjlist.h" #include "virenum.h" #include "vireventthread.h" @@ -240,6 +241,7 @@ struct _qemuDomainObjPrivate { /* running backup job */ virDomainBackupDef *backup; =20 + GDBusConnection *dbusConnection; bool dbusDaemonRunning; =20 /* list of Ids to migrate */ diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 0173fbe3be..1eb670e6ba 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -9405,6 +9405,9 @@ qemuProcessReconnect(void *opaque) if (qemuDomainObjStartWorker(obj) < 0) goto error; =20 + if (priv->dbusDaemonRunning && !qemuDBusConnect(driver, obj)) + goto error; + VIR_DEBUG("Reconnect monitor to def=3D%p name=3D'%s'", obj, obj->def->= name); =20 tryMonReconn =3D true; --=20 2.47.0 From nobody Fri Mar 13 12:47:23 2026 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=1742113531; cv=none; d=zohomail.com; s=zohoarc; b=Z9rYP7uNB8zLm+A3yqNWZo3WQuzNGFNIcct7XNCbFcVyjVhr+/UUIB2hABKn2/mJpwIatVcUrxKf/96LbvS5XM9/gQddxfhKFPi+HFhRF1AXXDhX7qpZ+9w5VvqDjIfg4sJeaOTspecYpHw0A1fwCZr9fX2y8v3dI31xNdJ4ed8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1742113531; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=3StfA+cg3oEDQVyFi8S8/UzoB1BRRfqs3T5QYOTcCsQ=; b=WzplP0a+g58bfub1lb/WCloJYbZHTpCak0tmPssiRKxLn8O87PpKgV7lJlv6/1Ydi3B4uPOA6m+9n0dp7l2Pp4ANML+9cN/aNLKZMUHFMcwXZQODI6SjeySbO4oRqtCSzzD8MlYEgNK3I6WHwzrfeRGuiZwuMOXa1V5CrSb9PVE= 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 1742113531109976.5338359039961; Sun, 16 Mar 2025 01:25:31 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 0B5B4234E; Sun, 16 Mar 2025 04:25:30 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 151742274; Sun, 16 Mar 2025 04:21:06 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 6C01622BA; Sun, 16 Mar 2025 04:21:01 -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 27D962314 for ; Sun, 16 Mar 2025 04:20:44 -0400 (EDT) Received: from mx-prod-mc-06.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-641-1Si6dR4sOqab44LjxeKlEA-1; Sun, 16 Mar 2025 04:20:42 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 71C8B180049D for ; Sun, 16 Mar 2025 08:20:41 +0000 (UTC) Received: from localhost (unknown [10.45.242.5]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7B8B51954B32; Sun, 16 Mar 2025 08:20:38 +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=-1.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,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=1742113243; 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: in-reply-to:in-reply-to:references:references; bh=YyPaELeVcANyap6vt81UxqFywsYeof5gX23vh1f+RBg=; b=S1a9j6JZTMJyDxyo2T8Bn/4Qp+35iJfd89dJ4OCwcpJqiOz5CHaDfM9ktlpRnS4N+dZBZE DwZAre5ylSUtB1Jk+nsrLZMtwRd4GJ987xIMsZ4slTqZC2ZbKXLquDtGOoRR0yEF9cOWvb 0HSjWQi5jnGJA9cSXzMsuuMmiB9RhqQ= X-MC-Unique: 1Si6dR4sOqab44LjxeKlEA-1 X-Mimecast-MFC-AGG-ID: 1Si6dR4sOqab44LjxeKlEA_1742113241 To: devel@lists.libvirt.org Subject: [PATCH v3 14/20] qemu/dbus: log daemon stdout/err, use domainLogContext Date: Sun, 16 Mar 2025 12:18:35 +0400 Message-ID: <20250316081841.3170078-15-marcandre.lureau@redhat.com> In-Reply-To: <20250316081841.3170078-1-marcandre.lureau@redhat.com> References: <20250316081841.3170078-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: sIDlf0DaUhB0Y5WzrRnBhx7lBJOpKONO98w_syRF3P0_1742113241 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: YHR4AZDZRAQX4KDHDUJ2QKFZF6VFL5YR X-Message-ID-Hash: YHR4AZDZRAQX4KDHDUJ2QKFZF6VFL5YR X-MailFrom: marcandre.lureau@redhat.com X-Mailman-Rule-Hits: nonmember-moderation 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 CC: mkletzan@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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: "marcandre.lureau--- via Devel" Reply-To: marcandre.lureau@redhat.com X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1742113531832019100 Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau Currently, if dbus-daemon writes on errfd, it will SIGPIPE. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Martin Kletzander --- src/qemu/qemu_dbus.c | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_dbus.c b/src/qemu/qemu_dbus.c index c9e99ea27b..a9e2fb0fe2 100644 --- a/src/qemu/qemu_dbus.c +++ b/src/qemu/qemu_dbus.c @@ -24,6 +24,7 @@ #include "virlog.h" #include "virtime.h" #include "virpidfile.h" +#include "virutil.h" =20 #define VIR_FROM_THIS VIR_FROM_NONE =20 @@ -212,9 +213,12 @@ qemuDBusStart(virQEMUDriver *driver, g_autofree char *pidfile =3D NULL; g_autofree char *configfile =3D NULL; g_autofree char *sockpath =3D NULL; + g_autofree char *logpath =3D NULL; virTimeBackOffVar timebackoff; const unsigned long long timeout =3D 500 * 1000; /* ms */ - VIR_AUTOCLOSE errfd =3D -1; + int logfd =3D -1; + g_autoptr(domainLogContext) logContext =3D NULL; + pid_t cpid =3D -1; int ret =3D -1; =20 @@ -246,10 +250,21 @@ qemuDBusStart(virQEMUDriver *driver, if (qemuSecurityDomainSetPathLabel(driver, vm, configfile, false) < 0) goto cleanup; =20 + if (!(logContext =3D domainLogContextNew(cfg->stdioLogD, cfg->dbusStat= eDir, + QEMU_DRIVER_NAME, + vm, driver->privileged, + shortName))) { + virLastErrorPrefixMessage("%s", _("can't open log context")); + goto cleanup; + } + + logfd =3D domainLogContextGetWriteFD(logContext); + cmd =3D virCommandNew(dbusDaemonPath); virCommandClearCaps(cmd); virCommandSetPidFile(cmd, pidfile); - virCommandSetErrorFD(cmd, &errfd); + virCommandSetOutputFD(cmd, &logfd); + virCommandSetErrorFD(cmd, &logfd); virCommandDaemonize(cmd); virCommandAddArgFormat(cmd, "--config-file=3D%s", configfile); =20 @@ -266,7 +281,7 @@ qemuDBusStart(virQEMUDriver *driver, if (virTimeBackOffStart(&timebackoff, 1, timeout) < 0) goto cleanup; while (virTimeBackOffWait(&timebackoff)) { - char errbuf[1024] =3D { 0 }; + g_autofree char *msg =3D NULL; =20 if (virFileExists(sockpath)) break; @@ -274,15 +289,12 @@ qemuDBusStart(virQEMUDriver *driver, if (virProcessKill(cpid, 0) =3D=3D 0) continue; =20 - if (saferead(errfd, errbuf, sizeof(errbuf) - 1) < 0) { - virReportSystemError(errno, - _("dbus-daemon %1$s died unexpectedly"), - dbusDaemonPath); - } else { - virReportError(VIR_ERR_OPERATION_FAILED, - _("dbus-daemon died and reported: %1$s"), errbu= f); - } + if (domainLogContextReadFiltered(logContext, &msg, 1024) < 0) + VIR_WARN("Unable to read from dbus-daemon log"); =20 + virReportError(VIR_ERR_OPERATION_FAILED, + _("dbus-daemon died and reported:\n%1$s"), + NULLSTR(msg)); goto cleanup; } =20 --=20 2.47.0 From nobody Fri Mar 13 12:47:23 2026 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=1742113548; cv=none; d=zohomail.com; s=zohoarc; b=Mps68Kyp6A3IFpn4d9wQNtEhcF7hFNfebCueOhYbGNoQq1zNCltmyCGQdDB0JpEVaKzkJ2/56/5CCNuFeC1oWKjVSqDFmOpLMwvTsSf56jQnA3iIUbU3XlYhXbyUlXR5sxkf6BCi8GKa1Kw/VznqJfXEDW1nZoxeuYH41KI/lmM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1742113548; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=SsVRGWLrzGu8mVHNym+580PUbTcSsJCITAnXB2n1TPI=; b=Osmi4Pmq+4h/FN7Jn6XiOAPpRsBNCHtaXfpTgGlYY24S75fARPv5IT3OwykO9sK2+xEFGJEcWvbuceV9eqbk77box1pQJy3YgUnVada6Dt8PniYuX5LdcOCQJY+KkSC8dGJPY6oF9KhU/kodF0rmSTD6vlfyvosKXS3PBhSVJw4= 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 1742113548147328.2460645488479; Sun, 16 Mar 2025 01:25:48 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 29DBE234F; Sun, 16 Mar 2025 04:25:47 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id DB86E2381; Sun, 16 Mar 2025 04:21:20 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 5138B2361; Sun, 16 Mar 2025 04:21:15 -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 C87452326 for ; Sun, 16 Mar 2025 04:20:53 -0400 (EDT) Received: from mx-prod-mc-06.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-529-xQLbFzIcMzW3ivsl3jDEMg-1; Sun, 16 Mar 2025 04:20:50 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 082811800262 for ; Sun, 16 Mar 2025 08:20:50 +0000 (UTC) Received: from localhost (unknown [10.45.242.5]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id EE64F18009BC; Sun, 16 Mar 2025 08:20:47 +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=-1.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,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=1742113253; 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: in-reply-to:in-reply-to:references:references; bh=p9/gEOXxrzCiReewel4dVbhL6RzzIw7ZLNaxOgsRwf0=; b=X7un+VVuy0XRm8FuEqCAypTkLAgYUgGcyy62XRIHYtFth97hNGIJddwsqZpQZe9kGcBKdv I1ipXTlPrQuVXg2eRubHrp+s/9NmQaBMBgjgYNhiScbNxPmoZu/NlZ3Wyb3CUzLftEep+6 QzPhf/QMJ3+93MwQkVPL1dNA8lBxdhM= X-MC-Unique: xQLbFzIcMzW3ivsl3jDEMg-1 X-Mimecast-MFC-AGG-ID: xQLbFzIcMzW3ivsl3jDEMg_1742113250 To: devel@lists.libvirt.org Subject: [PATCH v3 15/20] qemu: validate RDP configuration Date: Sun, 16 Mar 2025 12:18:36 +0400 Message-ID: <20250316081841.3170078-16-marcandre.lureau@redhat.com> In-Reply-To: <20250316081841.3170078-1-marcandre.lureau@redhat.com> References: <20250316081841.3170078-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: EXajvAEehrtupQAGLFLpE6qOTkyEMwlAOzKKQknhFVc_1742113250 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 4DXZYJ52RGB2PN43QRNTVCLJHDV3TNPC X-Message-ID-Hash: 4DXZYJ52RGB2PN43QRNTVCLJHDV3TNPC X-MailFrom: marcandre.lureau@redhat.com X-Mailman-Rule-Hits: nonmember-moderation 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 CC: mkletzan@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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: "marcandre.lureau--- via Devel" Reply-To: marcandre.lureau@redhat.com X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1742113549711019100 Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Martin Kletzander --- src/qemu/qemu_validate.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index eae75d7bf5..89dee51526 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -4484,6 +4484,29 @@ qemuValidateDomainDeviceDefDBusGraphics(const virDom= ainGraphicsDef *graphics, } =20 =20 +static int +qemuValidateDomainDeviceDefRDPGraphics(const virDomainGraphicsDef *graphic= s) +{ + if (graphics->data.rdp.replaceUser) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("RDP doesn't support 'replaceUser'")); + return -1; + } + if (graphics->data.rdp.multiUser) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("RDP doesn't support 'multiUser'")); + return -1; + } + if (graphics->data.rdp.auth.expires) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("RDP password expiration isn't supported")); + return -1; + } + + return 0; +} + + static int qemuValidateDomainDeviceDefGraphics(const virDomainGraphicsDef *graphics, const virDomainDef *def, @@ -4555,8 +4578,13 @@ qemuValidateDomainDeviceDefGraphics(const virDomainG= raphicsDef *graphics, =20 break; =20 - case VIR_DOMAIN_GRAPHICS_TYPE_SDL: case VIR_DOMAIN_GRAPHICS_TYPE_RDP: + if (qemuValidateDomainDeviceDefRDPGraphics(graphics) < 0) + return -1; + + break; + + case VIR_DOMAIN_GRAPHICS_TYPE_SDL: case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP: case VIR_DOMAIN_GRAPHICS_TYPE_LAST: break; --=20 2.47.0 From nobody Fri Mar 13 12:47:24 2026 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=1742113590; cv=none; d=zohomail.com; s=zohoarc; b=F72sz1ec6tXUmvoaC5Q88qFVSRwTb5/3xN8CcslHN9LKMlPmNSHANkqtKTn6AnZ+Z7KrAG6w481f2UurLOR7G7IRlaQQ2ityOEE4H8ohzhNvEkw34ST03QY1s48PbZhorsxi9u+7yzJLqxT7/+IzjB2kJV7D5bI/tLPqpeZPgvc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1742113590; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=npuwLgb4c00zIv1Xwhrgh+7IRSb3IsoLbp87Wo5XYV0=; b=f7gSQA/TPW0zKv65UvU/jyjlBEZlUrwmsqAEEDLmR6Ni78/rEHz0rrYoscIegSlEHfBIskE0lN4ANFp02gZ4bkS29G+aTh9u+CQeHxm6GbsJTmBeQWdDd9zacZ0fSjWHeC/1L8zbNPH+7wurGjxejyCkoFxziZZLrynoQeQcO1I= 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 1742113590907987.6880561888618; Sun, 16 Mar 2025 01:26:30 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id E494B23D1; Sun, 16 Mar 2025 04:26:29 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id EC6682370; Sun, 16 Mar 2025 04:21:27 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 7C3CB129B; Sun, 16 Mar 2025 04:21:23 -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 07D4122CE for ; Sun, 16 Mar 2025 04:21:01 -0400 (EDT) Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-595-FRUiJHeTMvqNtP_5EAjFUw-1; Sun, 16 Mar 2025 04:20:58 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E9A661956087 for ; Sun, 16 Mar 2025 08:20:57 +0000 (UTC) Received: from localhost (unknown [10.45.242.5]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 05D0B18009BC; Sun, 16 Mar 2025 08:20:55 +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=-1.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,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=1742113260; 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: in-reply-to:in-reply-to:references:references; bh=4BHZ1FFiacVxpW7zPE/PGrPOwDM1uLxQ+5zUfbNMEzI=; b=Gtw5Auv/hOfQBPBDqulRTveZQ+1t2W6QuDBUTGdcfJ1rKqfScQXLX/hptFlzQ3j4gXgXlc QoJpc47U0gBuabK8FXKPA5l/3uvtWIy1pfj7q/19DRz67OZtpz32/SlsUTU+LdVaRBgsxB L0Slf4Y1g5HCKAdtk67bGR+VhgpZbvQ= X-MC-Unique: FRUiJHeTMvqNtP_5EAjFUw-1 X-Mimecast-MFC-AGG-ID: FRUiJHeTMvqNtP_5EAjFUw_1742113258 To: devel@lists.libvirt.org Subject: [PATCH v3 16/20] qemu: add qemu-rdp helper unit Date: Sun, 16 Mar 2025 12:18:37 +0400 Message-ID: <20250316081841.3170078-17-marcandre.lureau@redhat.com> In-Reply-To: <20250316081841.3170078-1-marcandre.lureau@redhat.com> References: <20250316081841.3170078-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 1gwYSHHlknVwKKVu5RrpHMm9ee_ZqYdXhKKWF4sWw58_1742113258 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: UI3WRTF4CC6A4GSKEBL42Q5TJZLKWMLG X-Message-ID-Hash: UI3WRTF4CC6A4GSKEBL42Q5TJZLKWMLG X-MailFrom: marcandre.lureau@redhat.com X-Mailman-Rule-Hits: nonmember-moderation 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 CC: mkletzan@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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: "marcandre.lureau--- via Devel" Reply-To: marcandre.lureau@redhat.com X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1742113594044019100 Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau Helpers to start the qemu-rdp server and set it up. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Martin Kletzander --- po/POTFILES | 1 + src/qemu/meson.build | 1 + src/qemu/qemu_domain.c | 1 + src/qemu/qemu_domain.h | 2 + src/qemu/qemu_rdp.c | 413 +++++++++++++++++++++++++++++++++++++++++ src/qemu/qemu_rdp.h | 71 +++++++ 6 files changed, 489 insertions(+) create mode 100644 src/qemu/qemu_rdp.c create mode 100644 src/qemu/qemu_rdp.h diff --git a/po/POTFILES b/po/POTFILES index d4b3de781b..0c83affb44 100644 --- a/po/POTFILES +++ b/po/POTFILES @@ -195,6 +195,7 @@ src/qemu/qemu_passt.c src/qemu/qemu_postparse.c src/qemu/qemu_process.c src/qemu/qemu_qapi.c +src/qemu/qemu_rdp.c src/qemu/qemu_saveimage.c src/qemu/qemu_slirp.c src/qemu/qemu_snapshot.c diff --git a/src/qemu/meson.build b/src/qemu/meson.build index 43a8ad7c3b..7a07d4f2c4 100644 --- a/src/qemu/meson.build +++ b/src/qemu/meson.build @@ -34,6 +34,7 @@ qemu_driver_sources =3D [ 'qemu_postparse.c', 'qemu_process.c', 'qemu_qapi.c', + 'qemu_rdp.c', 'qemu_saveimage.c', 'qemu_security.c', 'qemu_snapshot.c', diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 29fac0034e..efc1ebddd5 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1038,6 +1038,7 @@ qemuDomainGraphicsPrivateDispose(void *obj) =20 g_free(priv->tlsAlias); g_clear_pointer(&priv->secinfo, qemuDomainSecretInfoFree); + g_clear_pointer(&priv->rdp, qemuRdpFree); } =20 =20 diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index a70617f3c0..e3b206763c 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -35,6 +35,7 @@ #include "qemu_capabilities.h" #include "qemu_migration_params.h" #include "qemu_nbdkit.h" +#include "qemu_rdp.h" #include "qemu_slirp.h" #include "qemu_fd.h" #include "virchrdev.h" @@ -419,6 +420,7 @@ struct _qemuDomainGraphicsPrivate { =20 char *tlsAlias; qemuDomainSecretInfo *secinfo; + qemuRdp *rdp; }; =20 =20 diff --git a/src/qemu/qemu_rdp.c b/src/qemu/qemu_rdp.c new file mode 100644 index 0000000000..97eb772abb --- /dev/null +++ b/src/qemu/qemu_rdp.c @@ -0,0 +1,413 @@ +/* + * qemu_rdp.c: QEMU Rdp support + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * . + */ + +#include + +#include + +#include "qemu_dbus.h" +#include "qemu_extdevice.h" +#include "qemu_security.h" +#include "qemu_rdp.h" +#include "virenum.h" +#include "virerror.h" +#include "virjson.h" +#include "virlog.h" +#include "virpidfile.h" +#include "virutil.h" +#include "virgdbus.h" + +#define VIR_FROM_THIS VIR_FROM_NONE + +VIR_LOG_INIT("qemu.rdp"); + +VIR_ENUM_IMPL(qemuRdpFeature, + QEMU_RDP_FEATURE_LAST, + "", + "dbus-address", + "remotefx" +); + +#define ORG_QEMUDISPLAY_RDP "org.QemuDisplay.RDP" +#define ORG_QEMUDISPLAY_RDP_PATH "/org/qemu_display/rdp" +#define ORG_QEMUDISPLAY_RDP_IFACE "org.QemuDisplay.RDP" + + +void +qemuRdpFree(qemuRdp *rdp) +{ + if (!rdp) + return; + + virBitmapFree(rdp->features); + g_free(rdp); +} + + +void +qemuRdpSetFeature(qemuRdp *rdp, + qemuRdpFeature feature) +{ + ignore_value(virBitmapSetBit(rdp->features, feature)); +} + + +bool +qemuRdpHasFeature(const qemuRdp *rdp, + qemuRdpFeature feature) +{ + return virBitmapIsBitSet(rdp->features, feature); +} + + +qemuRdp * +qemuRdpNew(void) +{ + g_autoptr(qemuRdp) rdp =3D g_new0(qemuRdp, 1); + + rdp->features =3D virBitmapNew(QEMU_RDP_FEATURE_LAST); + rdp->pid =3D -1; + + return g_steal_pointer(&rdp); +} + + +qemuRdp * +qemuRdpNewForHelper(const char *helper) +{ + g_autoptr(qemuRdp) rdp =3D NULL; + g_autoptr(virCommand) cmd =3D NULL; + g_autofree char *output =3D NULL; + g_autoptr(virJSONValue) doc =3D NULL; + virJSONValue *featuresJSON; + g_autofree char *helperPath =3D NULL; + size_t i, nfeatures; + + helperPath =3D virFindFileInPath(helper); + if (!helperPath) { + virReportSystemError(errno, + _("'%1$s' is not a suitable qemu-rdp helper n= ame"), + helper); + return NULL; + } + + rdp =3D qemuRdpNew(); + cmd =3D virCommandNewArgList(helperPath, "--print-capabilities", NULL); + virCommandSetOutputBuffer(cmd, &output); + if (virCommandRun(cmd, NULL) < 0) + return NULL; + + if (!(doc =3D virJSONValueFromString(output)) || + !(featuresJSON =3D virJSONValueObjectGetArray(doc, "features"))) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unable to parse json capabilities '%1$s'"), + helper); + return NULL; + } + + nfeatures =3D virJSONValueArraySize(featuresJSON); + for (i =3D 0; i < nfeatures; i++) { + virJSONValue *item =3D virJSONValueArrayGet(featuresJSON, i); + const char *tmpStr =3D virJSONValueGetString(item); + int tmp; + + if ((tmp =3D qemuRdpFeatureTypeFromString(tmpStr)) <=3D 0) { + VIR_WARN("unknown qemu-rdp feature %s", tmpStr); + continue; + } + + qemuRdpSetFeature(rdp, tmp); + } + + return g_steal_pointer(&rdp); +} + + +static char * +qemuRdpCreatePidFilename(virDomainObj *vm) +{ + qemuDomainObjPrivate *priv =3D vm->privateData; + virQEMUDriver *driver =3D priv->driver; + g_autofree char *shortName =3D virDomainDefGetShortName(vm->def); + g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(driver); + g_autofree char *name =3D NULL; + + name =3D g_strdup_printf("%s-rdp", shortName); + + return virPidFileBuildPath(cfg->rdpStateDir, name); +} + + +void +qemuRdpStop(virDomainObj *vm, virDomainGraphicsDef *gfx) +{ + qemuDomainObjPrivate *priv =3D vm->privateData; + qemuDomainGraphicsPrivate *gfxpriv =3D QEMU_DOMAIN_GRAPHICS_PRIVATE(gf= x); + qemuRdp *rdp =3D gfxpriv->rdp; + g_autofree char *pidfile =3D qemuRdpCreatePidFilename(vm); + virErrorPtr orig_err; + + if (!rdp) + return; + + if (rdp->leaving_id) { + g_dbus_connection_signal_unsubscribe(priv->dbusConnection, rdp->le= aving_id); + rdp->leaving_id =3D 0; + } + g_clear_handle_id(&rdp->name_watch, g_bus_unwatch_name); + + virErrorPreserveLast(&orig_err); + + if (virPidFileForceCleanupPath(pidfile) < 0) { + VIR_WARN("Unable to kill qemu-rdp process"); + } else { + rdp->pid =3D -1; + } + + virErrorRestore(&orig_err); +} + + +int +qemuRdpSetupCgroup(qemuRdp *rdp, + virCgroup *cgroup) +{ + return virCgroupAddProcess(cgroup, rdp->pid); +} + + +static void +on_leaving_signal(GDBusConnection *connection, + const gchar *sender_name G_GNUC_UNUSED, + const gchar *object_path G_GNUC_UNUSED, + const gchar *interface_name G_GNUC_UNUSED, + const gchar *signal_name G_GNUC_UNUSED, + GVariant *parameters, + gpointer user_data) +{ + qemuRdp *rdp =3D user_data; + const gchar *reason; + + g_variant_get(parameters, "(&s)", &reason); + VIR_DEBUG("%s.Leaving reason: '%s'", ORG_QEMUDISPLAY_RDP_IFACE, reason= ); + g_dbus_connection_signal_unsubscribe(connection, rdp->leaving_id); + rdp->leaving_id =3D 0; +} + + +static void +name_appeared_cb(GDBusConnection* connection, + const gchar* name G_GNUC_UNUSED, + const gchar* name_owner G_GNUC_UNUSED, + gpointer user_data G_GNUC_UNUSED) +{ + qemuRdp *rdp =3D user_data; + + VIR_DEBUG("'%s' appeared", name); + rdp->name_appeared =3D true; + + if (!rdp->leaving_id) { + rdp->leaving_id =3D g_dbus_connection_signal_subscribe( + connection, + ORG_QEMUDISPLAY_RDP, + ORG_QEMUDISPLAY_RDP_IFACE, + "Leaving", + ORG_QEMUDISPLAY_RDP_PATH, + NULL, + G_DBUS_SIGNAL_FLAGS_NONE, + on_leaving_signal, + rdp, + NULL); + } +} + + +static void +name_vanished_cb(GDBusConnection* connection G_GNUC_UNUSED, + const gchar* name G_GNUC_UNUSED, + gpointer user_data G_GNUC_UNUSED) +{ + qemuRdp *rdp =3D user_data; + + if (rdp->name_appeared && rdp->leaving_id) { + virReportError(VIR_ERR_INTERNAL_ERROR, _("'%1$s' vanished unexpect= edly"), name); + } +} + + +int +qemuRdpStart(virDomainObj *vm, virDomainGraphicsDef *gfx) +{ + qemuDomainObjPrivate *priv =3D vm->privateData; + virQEMUDriver *driver =3D priv->driver; + qemuDomainGraphicsPrivate *gfxpriv =3D QEMU_DOMAIN_GRAPHICS_PRIVATE(gf= x); + qemuRdp *rdp =3D gfxpriv->rdp; + virDomainGraphicsListenDef *glisten =3D NULL; + g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(driver); + g_autoptr(virCommand) cmd =3D NULL; + g_autofree char *shortName =3D virDomainDefGetShortName(vm->def); + g_autofree char *pidfile =3D NULL; + g_autofree char *logname =3D NULL; + g_autofree char *certpath =3D NULL; + g_autofree char *keypath =3D NULL; + g_autofree char *dbus_addr =3D qemuDBusGetAddress(driver, vm); + g_auto(virBuffer) bind_addr =3D VIR_BUFFER_INITIALIZER; + pid_t pid =3D -1; + int logfd =3D -1; + g_autoptr(domainLogContext) logContext =3D NULL; + + if (rdp->pid !=3D -1) { + return 0; + } + + if (!dbus_addr) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("no D-Bus address")= ); + return -1; + } + + if (!(glisten =3D virDomainGraphicsGetListen(gfx, 0))) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("missing listen element")); + return -1; + } + + switch (glisten->type) { + case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS: + case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK: + if (glisten->address) { + bool escapeAddr =3D strchr(glisten->address, ':') !=3D NULL; + if (escapeAddr) + virBufferAsprintf(&bind_addr, "[%s]", glisten->address); + else + virBufferAdd(&bind_addr, glisten->address, -1); + } + virBufferAsprintf(&bind_addr, ":%d", + gfx->data.rdp.port); + break; + case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_SOCKET: + case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NONE: + case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_LAST: + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unsupported qemu-rdp listen type")); + return -1; + } + + if (!(pidfile =3D qemuRdpCreatePidFilename(vm))) + return -1; + + logname =3D g_strdup_printf("%s-qemu-rdp", shortName); + if (!(logContext =3D domainLogContextNew(cfg->stdioLogD, cfg->logDir, + QEMU_DRIVER_NAME, + vm, driver->privileged, + logname))) { + virLastErrorPrefixMessage("%s", _("can't open log context")); + return -1; + } + + logfd =3D domainLogContextGetWriteFD(logContext); + + cmd =3D virCommandNew(cfg->qemuRdpName); + virCommandClearCaps(cmd); + virCommandSetPidFile(cmd, pidfile); + virCommandSetOutputFD(cmd, &logfd); + virCommandSetErrorFD(cmd, &logfd); + virCommandDaemonize(cmd); + virCommandAddArgPair(cmd, "--dbus-address", dbus_addr); + virCommandAddArg(cmd, "serve"); + + virCommandAddArg(cmd, "--bind-address"); + virCommandAddArgBuffer(cmd, &bind_addr); + + certpath =3D g_build_filename(cfg->rdpTLSx509certdir, "server-cert.pem= ", NULL); + keypath =3D g_build_filename(cfg->rdpTLSx509certdir, "server-key.pem",= NULL); + if (!virFileExists((certpath))) { + virReportError(VIR_ERR_OPERATION_FAILED, _("Missing certificate fi= le '%1$s'"), certpath); + return -1; + } + if (!virFileExists((keypath))) { + virReportError(VIR_ERR_OPERATION_FAILED, _("Missing key file '%1$s= '"), keypath); + return -1; + } + virCommandAddArgPair(cmd, "--cert", certpath); + virCommandAddArgPair(cmd, "--key", keypath); + + rdp->name_watch =3D g_bus_watch_name_on_connection(priv->dbusConnectio= n, + ORG_QEMUDISPLAY_RDP, + G_BUS_NAME_WATCHER_FL= AGS_NONE, + name_appeared_cb, + name_vanished_cb, + rdp, + NULL); + + if (qemuExtDeviceLogCommand(driver, vm, cmd, "qemu-rdp") < 0) + return -1; + + if (qemuSecurityCommandRun(driver, vm, cmd, -1, -1, false, NULL) < 0) + goto error; + + if (virPidFileReadPath(pidfile, &pid) < 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unable to read qemu-rdp pidfile '%1$s'"), + pidfile); + goto error; + } + + if (virProcessKill(pid, 0) !=3D 0) { + g_autofree char *msg =3D NULL; + + if (domainLogContextReadFiltered(logContext, &msg, 1024) < 0) + VIR_WARN("Unable to read from qemu-rdp log"); + + virReportError(VIR_ERR_OPERATION_FAILED, + _("qemu-rdp died and reported:\n%1$s"), + NULLSTR(msg)); + goto error; + } + + rdp->pid =3D pid; + + return 0; + + error: + g_clear_handle_id(&rdp->name_watch, g_bus_unwatch_name); + qemuRdpStop(vm, gfx); + return -1; +} + + +int +qemuRdpSetCredentials(virDomainObj *vm, + const char *username, + const char *password, + const char *domain) +{ + qemuDomainObjPrivate *priv =3D vm->privateData; + g_autoptr(GVariant) args =3D NULL; + + args =3D g_variant_new("(sss)", username, password, domain); + + return virGDBusCallMethod(priv->dbusConnection, + NULL, + G_VARIANT_TYPE("()"), + NULL, + ORG_QEMUDISPLAY_RDP, + ORG_QEMUDISPLAY_RDP_PATH, + ORG_QEMUDISPLAY_RDP_IFACE, + "SetCredentials", + args); +} diff --git a/src/qemu/qemu_rdp.h b/src/qemu/qemu_rdp.h new file mode 100644 index 0000000000..6af90b06d2 --- /dev/null +++ b/src/qemu/qemu_rdp.h @@ -0,0 +1,71 @@ +/* + * qemu_rdp.h: QEMU RDP support + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * . + */ + +#pragma once + +#include "qemu_conf.h" +#include "virbitmap.h" +#include "virenum.h" + +typedef enum { + QEMU_RDP_FEATURE_NONE =3D 0, + + QEMU_RDP_FEATURE_DBUS_ADDRESS, + QEMU_RDP_FEATURE_REMOTEFX, + QEMU_RDP_FEATURE_LAST, +} qemuRdpFeature; + +VIR_ENUM_DECL(qemuRdpFeature); + +typedef struct _qemuRdp qemuRdp; +struct _qemuRdp { + int fd[2]; + virBitmap *features; + pid_t pid; + guint name_watch; + bool name_appeared; + guint leaving_id; +}; + +qemuRdp *qemuRdpNew(void); + +qemuRdp *qemuRdpNewForHelper(const char *helper); + +void qemuRdpFree(qemuRdp *rdp); + +void qemuRdpSetFeature(qemuRdp *rdp, + qemuRdpFeature feature); + +bool qemuRdpHasFeature(const qemuRdp *rdp, + qemuRdpFeature feature); + +int qemuRdpStart(virDomainObj *vm, + virDomainGraphicsDef *gfx); + +void qemuRdpStop(virDomainObj *vm, + virDomainGraphicsDef *gfx); + +int qemuRdpSetupCgroup(qemuRdp *rdp, + virCgroup *cgroup); + +int qemuRdpSetCredentials(virDomainObj *vm, + const char *username, + const char *password, + const char *domain); + +G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuRdp, qemuRdpFree); --=20 2.47.0 From nobody Fri Mar 13 12:47:24 2026 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=1742113622; cv=none; d=zohomail.com; s=zohoarc; b=W9whUuG+2x5OipZDUaogXRCITohFkY8wqqbyUDF9g9BGp79mqZctaa0fpjG1IZEOKIhMBLdOQhaZKPwzKlFACQGTI3HFw+IknSEKUcnuP0M98ptFvOXqsv1TBfejI4a95dBuY0AbXNl6Sbi1Tt5lfryhiv7JtDcj7WU19Ckpa3A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1742113622; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=OZzc2M8bEfUmSDNAIt3IWc+RZcO0MpdkigYf71qe5nQ=; b=mXUyz5j1/809sGAQi1/YsSJ7gVpSaP4CPTvLiwnKz0Po6mw+z1bbZBf0B0H8OR/1WrwMP5DmMaAG792pcgx3azizoy6YjTSDhUM3bW/TJjAf6K+csbjBXbzkGfHxxpc0WOfOBXtv48chqw11UiQfw8JEjaHll6kdW5RSV0w980g= 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 1742113622069334.1273170384376; Sun, 16 Mar 2025 01:27:02 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 1A95023D9; Sun, 16 Mar 2025 04:27:01 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 1AA8B2375; Sun, 16 Mar 2025 04:21:37 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 0E1922338; Sun, 16 Mar 2025 04:21:32 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 0FB9F23AD for ; Sun, 16 Mar 2025 04:21:09 -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-332--Mjo0n61Mk29_Ms5jBebew-1; Sun, 16 Mar 2025 04:21:07 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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 67DDA1801A00 for ; Sun, 16 Mar 2025 08:21:06 +0000 (UTC) Received: from localhost (unknown [10.45.242.5]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 919C51954B32; Sun, 16 Mar 2025 08:21:03 +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=1742113268; 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: in-reply-to:in-reply-to:references:references; bh=OuZBqrVDE5deGCcdEpFUoJi5O+d3z4TVjPj7LYVQqdM=; b=XZvhliMLR+F0fiCVz6SnhKMDOYh0UU/enzfVnM4ksBZ80jiMTlYw1w23vTHZUTR8tKLNv3 5GHg24T8YySv+7CW6cUsqnB8R6nJXvL46D6Ca8XWVuaHPJWc14fam776mn4XBstO9NrEJS 9FoAwapu6XYjZ2382lh2juQrD3gGVlE= X-MC-Unique: -Mjo0n61Mk29_Ms5jBebew-1 X-Mimecast-MFC-AGG-ID: -Mjo0n61Mk29_Ms5jBebew_1742113266 To: devel@lists.libvirt.org Subject: [PATCH v3 17/20] qemu: pass virQEMUDriverConfig to capabilities Date: Sun, 16 Mar 2025 12:18:38 +0400 Message-ID: <20250316081841.3170078-18-marcandre.lureau@redhat.com> In-Reply-To: <20250316081841.3170078-1-marcandre.lureau@redhat.com> References: <20250316081841.3170078-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: VYFA9-tRpbFmtu0UuLvSQqZi9N0pFFAonsSF8Irzkfc_1742113266 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: POBXAOY6LRQ7S77UUPQN4V6RERVEPU4E X-Message-ID-Hash: POBXAOY6LRQ7S77UUPQN4V6RERVEPU4E X-MailFrom: marcandre.lureau@redhat.com X-Mailman-Rule-Hits: nonmember-moderation 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 CC: mkletzan@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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: "marcandre.lureau--- via Devel" Reply-To: marcandre.lureau@redhat.com X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1742113623919019100 Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau This will help with the following patch, which also requires config access. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Martin Kletzander --- src/qemu/qemu_capabilities.c | 9 +++++---- src/qemu/qemu_capabilities.h | 9 +++++---- src/qemu/qemu_conf.c | 9 +++++---- tests/domaincapstest.c | 7 +++---- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index d13b4c8109..ca99e61896 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -6926,12 +6926,11 @@ virQEMUCapsFillDomainFeatureHypervCaps(virQEMUCaps = *qemuCaps, =20 =20 int -virQEMUCapsFillDomainCaps(virQEMUCaps *qemuCaps, +virQEMUCapsFillDomainCaps(virQEMUDriverConfig *cfg, + virQEMUCaps *qemuCaps, virArch hostarch, virDomainCaps *domCaps, - bool privileged, - virFirmware **firmwares, - size_t nfirmwares) + bool privileged) { virDomainCapsOS *os =3D &domCaps->os; virDomainCapsDeviceDisk *disk =3D &domCaps->disk; @@ -6948,6 +6947,8 @@ virQEMUCapsFillDomainCaps(virQEMUCaps *qemuCaps, virDomainCapsLaunchSecurity *launchSecurity =3D &domCaps->launchSecuri= ty; virDomainCapsDeviceNet *net =3D &domCaps->net; virDomainCapsDevicePanic *panic =3D &domCaps->panic; + virFirmware **firmwares =3D cfg->firmwares; + size_t nfirmwares =3D cfg->nfirmwares; =20 virQEMUCapsFillDomainFeaturesFromQEMUCaps(qemuCaps, domCaps); =20 diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index e836d107aa..733b84029d 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -28,6 +28,8 @@ #include "virfilecache.h" #include "virenum.h" =20 +typedef struct _virQEMUDriverConfig virQEMUDriverConfig; + /* * Internal flags to keep track of qemu command line capabilities * @@ -865,12 +867,11 @@ void virQEMUCapsInitGuestFromBinary(virCaps *caps, virQEMUCaps *qemuCaps, virArch guestarch); =20 -int virQEMUCapsFillDomainCaps(virQEMUCaps *qemuCaps, +int virQEMUCapsFillDomainCaps(virQEMUDriverConfig *cfg, + virQEMUCaps *qemuCaps, virArch hostarch, virDomainCaps *domCaps, - bool privileged, - virFirmware **firmwares, - size_t nfirmwares); + bool privileged); =20 void virQEMUCapsFillDomainMemoryBackingCaps(virQEMUCaps *qemuCaps, virDomainCapsMemoryBacking *me= moryBacking); diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 65016feb6a..79634511db 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -1623,10 +1623,11 @@ virQEMUDriverGetDomainCapabilities(virQEMUDriver *d= river, if (!(domCaps =3D virDomainCapsNew(path, machine, arch, virttype))) return NULL; =20 - if (virQEMUCapsFillDomainCaps(qemuCaps, driver->hostarch, - domCaps, driver->privileged, - cfg->firmwares, - cfg->nfirmwares) < 0) + if (virQEMUCapsFillDomainCaps(cfg, + qemuCaps, + driver->hostarch, + domCaps, + driver->privileged) < 0) return NULL; =20 return g_steal_pointer(&domCaps); diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c index 96dc029af3..71e181d179 100644 --- a/tests/domaincapstest.c +++ b/tests/domaincapstest.c @@ -99,10 +99,9 @@ fillQemuCaps(virDomainCaps *domCaps, if (!domCaps->machine) domCaps->machine =3D g_strdup(virQEMUCapsGetPreferredMachine(qemuC= aps, virtType)); =20 - if (virQEMUCapsFillDomainCaps(qemuCaps, domCaps->arch, domCaps, - false, - cfg->firmwares, - cfg->nfirmwares) < 0) + if (virQEMUCapsFillDomainCaps(cfg, + qemuCaps, domCaps->arch, domCaps, + false) < 0) return -1; =20 /* The function above tries to query host's VFIO capabilities by calli= ng --=20 2.47.0 From nobody Fri Mar 13 12:47:24 2026 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=1742113695; cv=none; d=zohomail.com; s=zohoarc; b=Qs/9Dv0ntTlvYJg60nBMQVqMNc4QftuTQ5YRkIUJTVeRxcNjYEpGnfK2qfyYHlT3hU8VVEwYA7Cjxu+ZI9ouzssBTJYCA9HY7CkvYOR6ysW95KMzohg2Z0M1Kk6TMIG66ycn28YeMESg3vidE+l247SPsKM4QZJtO6ooaKs2moA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1742113695; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=fld9xsdJLZnmCk0Ujao5tSeilqykQUl5Ei6txMpFeuk=; b=PrTko7VTrpk7dJtwW4JSbW04Nty00NrFUov4Z1nepIW4HvqNGmv20RVaqrMh8h5TtPljKIqMnZhs7LYkG/aDkdoyjihJb8cevryzS2mieS3bS2Dry6s7N2pMV7UOHVdSeJOsLBm4pTpiFgp3vhKkGxIWIfupLIoaG0fXXlA7uGo= 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 1742113695766687.6523003661266; Sun, 16 Mar 2025 01:28:15 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 0095C23E3; Sun, 16 Mar 2025 04:28:14 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id E39C3110C; Sun, 16 Mar 2025 04:21:45 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id EE8A5BA0; Sun, 16 Mar 2025 04:21:40 -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 A16E0231F for ; Sun, 16 Mar 2025 04:21:17 -0400 (EDT) Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-63-Ua-KG_-4NyuNko9Tlt0M1g-1; Sun, 16 Mar 2025 04:21:15 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DD1B719560B9 for ; Sun, 16 Mar 2025 08:21:14 +0000 (UTC) Received: from localhost (unknown [10.45.242.5]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 74EF21800946; Sun, 16 Mar 2025 08:21:11 +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=-1.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,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=1742113277; 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: in-reply-to:in-reply-to:references:references; bh=EQIoqlxXimV9c9j+ipJ74oap9DVw5t+ZNifMepyYn8E=; b=N5rG+n6XxOiiXl6P5fb3rs+x2ZGmfylVyKLnW2VOmWqHF/oyxHHkKUwLqyqKK6NcHb242G xOfWCd5FnZjubkn7hrmXVbnMSzKeYKeKxtGfgK4JghwFanaVcHhpcuophYrmyX6TvqyKJo TpO9hc/BdvT/B1ETmEBnXa6WccWeVtw= X-MC-Unique: Ua-KG_-4NyuNko9Tlt0M1g-1 X-Mimecast-MFC-AGG-ID: Ua-KG_-4NyuNko9Tlt0M1g_1742113275 To: devel@lists.libvirt.org Subject: [PATCH v3 18/20] qemu: add 'rdp' capability if qemu-rdp is available Date: Sun, 16 Mar 2025 12:18:39 +0400 Message-ID: <20250316081841.3170078-19-marcandre.lureau@redhat.com> In-Reply-To: <20250316081841.3170078-1-marcandre.lureau@redhat.com> References: <20250316081841.3170078-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: q86sd5P7uyZsbNrcg33fmkxiA1cJ97H1sIN8UxCO7bY_1742113275 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: PVFJ76R4WT7C7FL4KDKAAJHWCXJXLMV2 X-Message-ID-Hash: PVFJ76R4WT7C7FL4KDKAAJHWCXJXLMV2 X-MailFrom: marcandre.lureau@redhat.com X-Mailman-Rule-Hits: nonmember-moderation 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 CC: mkletzan@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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: "marcandre.lureau--- via Devel" Reply-To: marcandre.lureau@redhat.com X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1742113696533019000 Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Martin Kletzander --- src/qemu/qemu_capabilities.c | 15 +++++++++++---- src/qemu/qemu_capabilities.h | 3 ++- src/qemu/qemu_rdp.c | 11 +++++++++++ src/qemu/qemu_rdp.h | 2 ++ src/qemu/qemu_validate.c | 3 ++- .../qemu_10.0.0-q35.x86_64+amdsev.xml | 1 + tests/domaincapsdata/qemu_10.0.0-q35.x86_64.xml | 1 + .../qemu_10.0.0-tcg.x86_64+amdsev.xml | 1 + tests/domaincapsdata/qemu_10.0.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_10.0.0.s390x.xml | 1 + .../domaincapsdata/qemu_10.0.0.x86_64+amdsev.xml | 1 + tests/domaincapsdata/qemu_10.0.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_7.0.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_7.1.0.x86_64.xml | 1 + .../domaincapsdata/qemu_7.2.0-hvf.x86_64+hvf.xml | 1 + tests/domaincapsdata/qemu_7.2.0-q35.x86_64.xml | 1 + .../domaincapsdata/qemu_7.2.0-tcg.x86_64+hvf.xml | 1 + tests/domaincapsdata/qemu_7.2.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_7.2.0.ppc.xml | 1 + tests/domaincapsdata/qemu_7.2.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.0.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.0.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.0.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.1.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.1.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.1.0.s390x.xml | 1 + tests/domaincapsdata/qemu_8.1.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.2.0-q35.x86_64.xml | 1 + .../qemu_8.2.0-tcg-virt.loongarch64.xml | 1 + tests/domaincapsdata/qemu_8.2.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.2.0-virt.aarch64.xml | 1 + .../qemu_8.2.0-virt.loongarch64.xml | 1 + tests/domaincapsdata/qemu_8.2.0.aarch64.xml | 1 + tests/domaincapsdata/qemu_8.2.0.armv7l.xml | 1 + tests/domaincapsdata/qemu_8.2.0.s390x.xml | 1 + tests/domaincapsdata/qemu_8.2.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_9.0.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_9.0.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_9.0.0.sparc.xml | 1 + tests/domaincapsdata/qemu_9.0.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_9.1.0-q35.x86_64.xml | 1 + .../qemu_9.1.0-tcg-virt.riscv64.xml | 1 + tests/domaincapsdata/qemu_9.1.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_9.1.0-virt.riscv64.xml | 1 + tests/domaincapsdata/qemu_9.1.0.s390x.xml | 1 + tests/domaincapsdata/qemu_9.1.0.x86_64.xml | 1 + .../domaincapsdata/qemu_9.2.0-hvf.aarch64+hvf.xml | 1 + .../qemu_9.2.0-q35.x86_64+amdsev.xml | 1 + tests/domaincapsdata/qemu_9.2.0-q35.x86_64.xml | 1 + .../qemu_9.2.0-tcg.x86_64+amdsev.xml | 1 + tests/domaincapsdata/qemu_9.2.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_9.2.0.s390x.xml | 1 + tests/domaincapsdata/qemu_9.2.0.x86_64+amdsev.xml | 1 + tests/domaincapsdata/qemu_9.2.0.x86_64.xml | 1 + tests/testutilsqemu.c | 6 ++++++ 59 files changed, 87 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index ca99e61896..2c137bb663 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -6475,7 +6475,8 @@ virQEMUCapsFillDomainDeviceDiskCaps(virQEMUCaps *qemu= Caps, =20 =20 void -virQEMUCapsFillDomainDeviceGraphicsCaps(virQEMUCaps *qemuCaps, +virQEMUCapsFillDomainDeviceGraphicsCaps(virQEMUDriverConfig *cfg, + virQEMUCaps *qemuCaps, virDomainCapsDeviceGraphics *dev) { dev->supported =3D VIR_TRISTATE_BOOL_YES; @@ -6489,8 +6490,14 @@ virQEMUCapsFillDomainDeviceGraphicsCaps(virQEMUCaps = *qemuCaps, VIR_DOMAIN_CAPS_ENUM_SET(dev->type, VIR_DOMAIN_GRAPHICS_TYPE_SPICE= ); if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_EGL_HEADLESS)) VIR_DOMAIN_CAPS_ENUM_SET(dev->type, VIR_DOMAIN_GRAPHICS_TYPE_EGL_H= EADLESS); - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DISPLAY_DBUS)) - VIR_DOMAIN_CAPS_ENUM_SET(dev->type, VIR_DOMAIN_GRAPHICS_TYPE_DBUS); + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DISPLAY_DBUS)) { + VIR_DOMAIN_CAPS_ENUM_SET(dev->type, + VIR_DOMAIN_GRAPHICS_TYPE_DBUS); + if (qemuRdpAvailable(cfg->qemuRdpName)) { + VIR_DOMAIN_CAPS_ENUM_SET(dev->type, + VIR_DOMAIN_GRAPHICS_TYPE_RDP); + } + } } =20 =20 @@ -6974,7 +6981,7 @@ virQEMUCapsFillDomainCaps(virQEMUDriverConfig *cfg, virQEMUCapsFillDomainCPUCaps(qemuCaps, hostarch, domCaps); virQEMUCapsFillDomainMemoryBackingCaps(qemuCaps, memoryBacking); virQEMUCapsFillDomainDeviceDiskCaps(qemuCaps, domCaps->machine, disk); - virQEMUCapsFillDomainDeviceGraphicsCaps(qemuCaps, graphics); + virQEMUCapsFillDomainDeviceGraphicsCaps(cfg, qemuCaps, graphics); virQEMUCapsFillDomainDeviceVideoCaps(qemuCaps, video); virQEMUCapsFillDomainDeviceHostdevCaps(qemuCaps, hostdev); virQEMUCapsFillDomainDeviceRNGCaps(qemuCaps, rng); diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 733b84029d..df63fe51ae 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -876,7 +876,8 @@ int virQEMUCapsFillDomainCaps(virQEMUDriverConfig *cfg, void virQEMUCapsFillDomainMemoryBackingCaps(virQEMUCaps *qemuCaps, virDomainCapsMemoryBacking *me= moryBacking); =20 -void virQEMUCapsFillDomainDeviceGraphicsCaps(virQEMUCaps *qemuCaps, +void virQEMUCapsFillDomainDeviceGraphicsCaps(virQEMUDriverConfig *cfg, + virQEMUCaps *qemuCaps, virDomainCapsDeviceGraphics *= dev); =20 void virQEMUCapsFillDomainDeviceVideoCaps(virQEMUCaps *qemuCaps, diff --git a/src/qemu/qemu_rdp.c b/src/qemu/qemu_rdp.c index 97eb772abb..984795d599 100644 --- a/src/qemu/qemu_rdp.c +++ b/src/qemu/qemu_rdp.c @@ -411,3 +411,14 @@ qemuRdpSetCredentials(virDomainObj *vm, "SetCredentials", args); } + + +bool +qemuRdpAvailable(const char *helper) +{ + g_autoptr(qemuRdp) rdp =3D NULL; + + rdp =3D qemuRdpNewForHelper(helper); + + return rdp && qemuRdpHasFeature(rdp, QEMU_RDP_FEATURE_DBUS_ADDRESS); +} diff --git a/src/qemu/qemu_rdp.h b/src/qemu/qemu_rdp.h index 6af90b06d2..2485a49de4 100644 --- a/src/qemu/qemu_rdp.h +++ b/src/qemu/qemu_rdp.h @@ -42,6 +42,8 @@ struct _qemuRdp { guint leaving_id; }; =20 +bool qemuRdpAvailable(const char *helper); + qemuRdp *qemuRdpNew(void); =20 qemuRdp *qemuRdpNewForHelper(const char *helper); diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 89dee51526..19af0f0209 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -4513,9 +4513,10 @@ qemuValidateDomainDeviceDefGraphics(const virDomainG= raphicsDef *graphics, virQEMUDriver *driver, virQEMUCaps *qemuCaps) { + g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(driver); virDomainCapsDeviceGraphics graphicsCaps =3D { 0 }; =20 - virQEMUCapsFillDomainDeviceGraphicsCaps(qemuCaps, &graphicsCaps); + virQEMUCapsFillDomainDeviceGraphicsCaps(cfg, qemuCaps, &graphicsCaps); =20 if (!VIR_DOMAIN_CAPS_ENUM_IS_SET(graphicsCaps.type, graphics->type)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, diff --git a/tests/domaincapsdata/qemu_10.0.0-q35.x86_64+amdsev.xml b/tests= /domaincapsdata/qemu_10.0.0-q35.x86_64+amdsev.xml index d000e4296e..b7fa8daa15 100644 --- a/tests/domaincapsdata/qemu_10.0.0-q35.x86_64+amdsev.xml +++ b/tests/domaincapsdata/qemu_10.0.0-q35.x86_64+amdsev.xml @@ -697,6 +697,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_10.0.0-q35.x86_64.xml b/tests/domain= capsdata/qemu_10.0.0-q35.x86_64.xml index 73cb50e7b6..e1ff01a7a8 100644 --- a/tests/domaincapsdata/qemu_10.0.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_10.0.0-q35.x86_64.xml @@ -1558,6 +1558,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_10.0.0-tcg.x86_64+amdsev.xml b/tests= /domaincapsdata/qemu_10.0.0-tcg.x86_64+amdsev.xml index 7d7e77cace..d8a6fe8354 100644 --- a/tests/domaincapsdata/qemu_10.0.0-tcg.x86_64+amdsev.xml +++ b/tests/domaincapsdata/qemu_10.0.0-tcg.x86_64+amdsev.xml @@ -1666,6 +1666,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_10.0.0-tcg.x86_64.xml b/tests/domain= capsdata/qemu_10.0.0-tcg.x86_64.xml index 9a7d39c1f8..3ce5c0c412 100644 --- a/tests/domaincapsdata/qemu_10.0.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_10.0.0-tcg.x86_64.xml @@ -1666,6 +1666,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_10.0.0.s390x.xml b/tests/domaincapsd= ata/qemu_10.0.0.s390x.xml index 4af3c7ec53..d66240307e 100644 --- a/tests/domaincapsdata/qemu_10.0.0.s390x.xml +++ b/tests/domaincapsdata/qemu_10.0.0.s390x.xml @@ -253,6 +253,7 @@ sdl vnc + rdp egl-headless dbus diff --git a/tests/domaincapsdata/qemu_10.0.0.x86_64+amdsev.xml b/tests/dom= aincapsdata/qemu_10.0.0.x86_64+amdsev.xml index fb06905b86..1f852adfae 100644 --- a/tests/domaincapsdata/qemu_10.0.0.x86_64+amdsev.xml +++ b/tests/domaincapsdata/qemu_10.0.0.x86_64+amdsev.xml @@ -697,6 +697,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_10.0.0.x86_64.xml b/tests/domaincaps= data/qemu_10.0.0.x86_64.xml index c06b9d1c51..66c4dfed9f 100644 --- a/tests/domaincapsdata/qemu_10.0.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_10.0.0.x86_64.xml @@ -1558,6 +1558,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml b/tests/domainc= apsdata/qemu_7.0.0-q35.x86_64.xml index 2c5129453e..8fa50785b7 100644 --- a/tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml @@ -1050,6 +1050,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml b/tests/domainc= apsdata/qemu_7.0.0-tcg.x86_64.xml index d4a567f5c6..2686989d64 100644 --- a/tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml @@ -1849,6 +1849,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_7.0.0.x86_64.xml b/tests/domaincapsd= ata/qemu_7.0.0.x86_64.xml index 6fa08af994..6ab3774452 100644 --- a/tests/domaincapsdata/qemu_7.0.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.0.0.x86_64.xml @@ -1050,6 +1050,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml b/tests/domainc= apsdata/qemu_7.1.0-q35.x86_64.xml index 8bed31ad22..75565c4495 100644 --- a/tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml @@ -1017,6 +1017,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml b/tests/domainc= apsdata/qemu_7.1.0-tcg.x86_64.xml index cb7fd8811b..4e44dbaf65 100644 --- a/tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml @@ -1797,6 +1797,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_7.1.0.x86_64.xml b/tests/domaincapsd= ata/qemu_7.1.0.x86_64.xml index a0f8b13f72..898b081df0 100644 --- a/tests/domaincapsdata/qemu_7.1.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.1.0.x86_64.xml @@ -1017,6 +1017,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_7.2.0-hvf.x86_64+hvf.xml b/tests/dom= aincapsdata/qemu_7.2.0-hvf.x86_64+hvf.xml index ce2e4f9f37..0fbbc8118c 100644 --- a/tests/domaincapsdata/qemu_7.2.0-hvf.x86_64+hvf.xml +++ b/tests/domaincapsdata/qemu_7.2.0-hvf.x86_64+hvf.xml @@ -1022,6 +1022,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_7.2.0-q35.x86_64.xml b/tests/domainc= apsdata/qemu_7.2.0-q35.x86_64.xml index f9d27024fc..cfbe7e5dd1 100644 --- a/tests/domaincapsdata/qemu_7.2.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.2.0-q35.x86_64.xml @@ -1022,6 +1022,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_7.2.0-tcg.x86_64+hvf.xml b/tests/dom= aincapsdata/qemu_7.2.0-tcg.x86_64+hvf.xml index c7728ac454..805a636ec6 100644 --- a/tests/domaincapsdata/qemu_7.2.0-tcg.x86_64+hvf.xml +++ b/tests/domaincapsdata/qemu_7.2.0-tcg.x86_64+hvf.xml @@ -1502,6 +1502,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_7.2.0-tcg.x86_64.xml b/tests/domainc= apsdata/qemu_7.2.0-tcg.x86_64.xml index c7728ac454..805a636ec6 100644 --- a/tests/domaincapsdata/qemu_7.2.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.2.0-tcg.x86_64.xml @@ -1502,6 +1502,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_7.2.0.ppc.xml b/tests/domaincapsdata= /qemu_7.2.0.ppc.xml index c6ef37b1af..21dbe730c5 100644 --- a/tests/domaincapsdata/qemu_7.2.0.ppc.xml +++ b/tests/domaincapsdata/qemu_7.2.0.ppc.xml @@ -65,6 +65,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_7.2.0.x86_64.xml b/tests/domaincapsd= ata/qemu_7.2.0.x86_64.xml index f0d9493353..2b402f59c8 100644 --- a/tests/domaincapsdata/qemu_7.2.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.2.0.x86_64.xml @@ -1022,6 +1022,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_8.0.0-q35.x86_64.xml b/tests/domainc= apsdata/qemu_8.0.0-q35.x86_64.xml index b8c376cb14..c1f7b96465 100644 --- a/tests/domaincapsdata/qemu_8.0.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.0.0-q35.x86_64.xml @@ -1104,6 +1104,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_8.0.0-tcg.x86_64.xml b/tests/domainc= apsdata/qemu_8.0.0-tcg.x86_64.xml index d3c9830a1a..4d8d4c7702 100644 --- a/tests/domaincapsdata/qemu_8.0.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.0.0-tcg.x86_64.xml @@ -1597,6 +1597,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_8.0.0.x86_64.xml b/tests/domaincapsd= ata/qemu_8.0.0.x86_64.xml index e8df30ae07..7db506386c 100644 --- a/tests/domaincapsdata/qemu_8.0.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.0.0.x86_64.xml @@ -1104,6 +1104,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_8.1.0-q35.x86_64.xml b/tests/domainc= apsdata/qemu_8.1.0-q35.x86_64.xml index e80e175376..4c9b674c1e 100644 --- a/tests/domaincapsdata/qemu_8.1.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.1.0-q35.x86_64.xml @@ -1363,6 +1363,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_8.1.0-tcg.x86_64.xml b/tests/domainc= apsdata/qemu_8.1.0-tcg.x86_64.xml index 62ffabb3e2..52f0d339bb 100644 --- a/tests/domaincapsdata/qemu_8.1.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.1.0-tcg.x86_64.xml @@ -1619,6 +1619,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_8.1.0.s390x.xml b/tests/domaincapsda= ta/qemu_8.1.0.s390x.xml index 2ca3b1d2ae..be8bb70245 100644 --- a/tests/domaincapsdata/qemu_8.1.0.s390x.xml +++ b/tests/domaincapsdata/qemu_8.1.0.s390x.xml @@ -342,6 +342,7 @@ sdl vnc + rdp egl-headless dbus diff --git a/tests/domaincapsdata/qemu_8.1.0.x86_64.xml b/tests/domaincapsd= ata/qemu_8.1.0.x86_64.xml index 4117d926cb..8389909b74 100644 --- a/tests/domaincapsdata/qemu_8.1.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.1.0.x86_64.xml @@ -1363,6 +1363,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_8.2.0-q35.x86_64.xml b/tests/domainc= apsdata/qemu_8.2.0-q35.x86_64.xml index dfa88bcf96..dcb46e06ea 100644 --- a/tests/domaincapsdata/qemu_8.2.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.2.0-q35.x86_64.xml @@ -1364,6 +1364,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_8.2.0-tcg-virt.loongarch64.xml b/tes= ts/domaincapsdata/qemu_8.2.0-tcg-virt.loongarch64.xml index c9f01904cd..18979cf280 100644 --- a/tests/domaincapsdata/qemu_8.2.0-tcg-virt.loongarch64.xml +++ b/tests/domaincapsdata/qemu_8.2.0-tcg-virt.loongarch64.xml @@ -72,6 +72,7 @@ sdl vnc + rdp spice dbus diff --git a/tests/domaincapsdata/qemu_8.2.0-tcg.x86_64.xml b/tests/domainc= apsdata/qemu_8.2.0-tcg.x86_64.xml index 327cad253e..fae61e8955 100644 --- a/tests/domaincapsdata/qemu_8.2.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.2.0-tcg.x86_64.xml @@ -1585,6 +1585,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_8.2.0-virt.aarch64.xml b/tests/domai= ncapsdata/qemu_8.2.0-virt.aarch64.xml index 224c619168..ce17865e24 100644 --- a/tests/domaincapsdata/qemu_8.2.0-virt.aarch64.xml +++ b/tests/domaincapsdata/qemu_8.2.0-virt.aarch64.xml @@ -120,6 +120,7 @@ sdl vnc + rdp egl-headless dbus diff --git a/tests/domaincapsdata/qemu_8.2.0-virt.loongarch64.xml b/tests/d= omaincapsdata/qemu_8.2.0-virt.loongarch64.xml index ed3637eaec..8f4ebbc107 100644 --- a/tests/domaincapsdata/qemu_8.2.0-virt.loongarch64.xml +++ b/tests/domaincapsdata/qemu_8.2.0-virt.loongarch64.xml @@ -76,6 +76,7 @@ sdl vnc + rdp spice dbus diff --git a/tests/domaincapsdata/qemu_8.2.0.aarch64.xml b/tests/domaincaps= data/qemu_8.2.0.aarch64.xml index 224c619168..ce17865e24 100644 --- a/tests/domaincapsdata/qemu_8.2.0.aarch64.xml +++ b/tests/domaincapsdata/qemu_8.2.0.aarch64.xml @@ -120,6 +120,7 @@ sdl vnc + rdp egl-headless dbus diff --git a/tests/domaincapsdata/qemu_8.2.0.armv7l.xml b/tests/domaincapsd= ata/qemu_8.2.0.armv7l.xml index 7182dca796..ee653c0c49 100644 --- a/tests/domaincapsdata/qemu_8.2.0.armv7l.xml +++ b/tests/domaincapsdata/qemu_8.2.0.armv7l.xml @@ -69,6 +69,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_8.2.0.s390x.xml b/tests/domaincapsda= ta/qemu_8.2.0.s390x.xml index 57ac07c153..78f91736d6 100644 --- a/tests/domaincapsdata/qemu_8.2.0.s390x.xml +++ b/tests/domaincapsdata/qemu_8.2.0.s390x.xml @@ -342,6 +342,7 @@ sdl vnc + rdp egl-headless dbus diff --git a/tests/domaincapsdata/qemu_8.2.0.x86_64.xml b/tests/domaincapsd= ata/qemu_8.2.0.x86_64.xml index f8dbb717f1..97b3795b5a 100644 --- a/tests/domaincapsdata/qemu_8.2.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.2.0.x86_64.xml @@ -1364,6 +1364,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_9.0.0-q35.x86_64.xml b/tests/domainc= apsdata/qemu_9.0.0-q35.x86_64.xml index c5a653f57b..d55bc239a9 100644 --- a/tests/domaincapsdata/qemu_9.0.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_9.0.0-q35.x86_64.xml @@ -1364,6 +1364,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_9.0.0-tcg.x86_64.xml b/tests/domainc= apsdata/qemu_9.0.0-tcg.x86_64.xml index 30876c5fef..48300b14f5 100644 --- a/tests/domaincapsdata/qemu_9.0.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_9.0.0-tcg.x86_64.xml @@ -1514,6 +1514,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_9.0.0.sparc.xml b/tests/domaincapsda= ta/qemu_9.0.0.sparc.xml index e48cdd0ae5..c7862f5842 100644 --- a/tests/domaincapsdata/qemu_9.0.0.sparc.xml +++ b/tests/domaincapsdata/qemu_9.0.0.sparc.xml @@ -60,6 +60,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_9.0.0.x86_64.xml b/tests/domaincapsd= ata/qemu_9.0.0.x86_64.xml index 6c141e1cb9..52f01a7cfc 100644 --- a/tests/domaincapsdata/qemu_9.0.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_9.0.0.x86_64.xml @@ -1364,6 +1364,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_9.1.0-q35.x86_64.xml b/tests/domainc= apsdata/qemu_9.1.0-q35.x86_64.xml index 9445d999b5..5449244329 100644 --- a/tests/domaincapsdata/qemu_9.1.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_9.1.0-q35.x86_64.xml @@ -1500,6 +1500,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_9.1.0-tcg-virt.riscv64.xml b/tests/d= omaincapsdata/qemu_9.1.0-tcg-virt.riscv64.xml index b4327bf878..b236ecbac4 100644 --- a/tests/domaincapsdata/qemu_9.1.0-tcg-virt.riscv64.xml +++ b/tests/domaincapsdata/qemu_9.1.0-tcg-virt.riscv64.xml @@ -82,6 +82,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_9.1.0-tcg.x86_64.xml b/tests/domainc= apsdata/qemu_9.1.0-tcg.x86_64.xml index 61d92550c1..927a5a6d36 100644 --- a/tests/domaincapsdata/qemu_9.1.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_9.1.0-tcg.x86_64.xml @@ -1619,6 +1619,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_9.1.0-virt.riscv64.xml b/tests/domai= ncapsdata/qemu_9.1.0-virt.riscv64.xml index 73e5ba1bc3..1399b980fd 100644 --- a/tests/domaincapsdata/qemu_9.1.0-virt.riscv64.xml +++ b/tests/domaincapsdata/qemu_9.1.0-virt.riscv64.xml @@ -71,6 +71,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_9.1.0.s390x.xml b/tests/domaincapsda= ta/qemu_9.1.0.s390x.xml index be46cfe6ba..b73e0d0688 100644 --- a/tests/domaincapsdata/qemu_9.1.0.s390x.xml +++ b/tests/domaincapsdata/qemu_9.1.0.s390x.xml @@ -205,6 +205,7 @@ sdl vnc + rdp egl-headless dbus diff --git a/tests/domaincapsdata/qemu_9.1.0.x86_64.xml b/tests/domaincapsd= ata/qemu_9.1.0.x86_64.xml index 5e87efe5e8..dc2521135c 100644 --- a/tests/domaincapsdata/qemu_9.1.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_9.1.0.x86_64.xml @@ -1500,6 +1500,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_9.2.0-hvf.aarch64+hvf.xml b/tests/do= maincapsdata/qemu_9.2.0-hvf.aarch64+hvf.xml index 644a0ef44a..b8615a0986 100644 --- a/tests/domaincapsdata/qemu_9.2.0-hvf.aarch64+hvf.xml +++ b/tests/domaincapsdata/qemu_9.2.0-hvf.aarch64+hvf.xml @@ -118,6 +118,7 @@ vnc + rdp dbus diff --git a/tests/domaincapsdata/qemu_9.2.0-q35.x86_64+amdsev.xml b/tests/= domaincapsdata/qemu_9.2.0-q35.x86_64+amdsev.xml index 11a8cd0b97..62c61b9de5 100644 --- a/tests/domaincapsdata/qemu_9.2.0-q35.x86_64+amdsev.xml +++ b/tests/domaincapsdata/qemu_9.2.0-q35.x86_64+amdsev.xml @@ -697,6 +697,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_9.2.0-q35.x86_64.xml b/tests/domainc= apsdata/qemu_9.2.0-q35.x86_64.xml index 98c522f0fc..49f5e64bfa 100644 --- a/tests/domaincapsdata/qemu_9.2.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_9.2.0-q35.x86_64.xml @@ -1558,6 +1558,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_9.2.0-tcg.x86_64+amdsev.xml b/tests/= domaincapsdata/qemu_9.2.0-tcg.x86_64+amdsev.xml index f7668e911e..265680b197 100644 --- a/tests/domaincapsdata/qemu_9.2.0-tcg.x86_64+amdsev.xml +++ b/tests/domaincapsdata/qemu_9.2.0-tcg.x86_64+amdsev.xml @@ -1666,6 +1666,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_9.2.0-tcg.x86_64.xml b/tests/domainc= apsdata/qemu_9.2.0-tcg.x86_64.xml index 7ccdc11412..884228db72 100644 --- a/tests/domaincapsdata/qemu_9.2.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_9.2.0-tcg.x86_64.xml @@ -1666,6 +1666,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_9.2.0.s390x.xml b/tests/domaincapsda= ta/qemu_9.2.0.s390x.xml index e13809bc63..605a3af5c7 100644 --- a/tests/domaincapsdata/qemu_9.2.0.s390x.xml +++ b/tests/domaincapsdata/qemu_9.2.0.s390x.xml @@ -205,6 +205,7 @@ sdl vnc + rdp egl-headless dbus diff --git a/tests/domaincapsdata/qemu_9.2.0.x86_64+amdsev.xml b/tests/doma= incapsdata/qemu_9.2.0.x86_64+amdsev.xml index d1143ad68f..ee82f2905b 100644 --- a/tests/domaincapsdata/qemu_9.2.0.x86_64+amdsev.xml +++ b/tests/domaincapsdata/qemu_9.2.0.x86_64+amdsev.xml @@ -697,6 +697,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/domaincapsdata/qemu_9.2.0.x86_64.xml b/tests/domaincapsd= ata/qemu_9.2.0.x86_64.xml index 0b5162781e..d587c1316a 100644 --- a/tests/domaincapsdata/qemu_9.2.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_9.2.0.x86_64.xml @@ -1558,6 +1558,7 @@ sdl vnc + rdp spice egl-headless dbus diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 66c05d7b46..ecd761dff0 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -52,6 +52,12 @@ bool virTPMHasSwtpm(void) } =20 =20 +/* Enough to tell capabilities code that qemu-rdp is usable */ +bool qemuRdpAvailable(const char *helper G_GNUC_UNUSED) +{ + return true; +} + =20 bool virTPMSwtpmSetupCapsGet(virTPMSwtpmSetupFeature cap) --=20 2.47.0 From nobody Fri Mar 13 12:47:24 2026 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=1742113756; cv=none; d=zohomail.com; s=zohoarc; b=bWzUs7DPtAD8Q54izV7Kq1PVTMsTA31+/QMMvGvCXlNWehm6TWC0wVa3wiYrkvGhyvm3k5vozFIOLVU2cm1QUi2eLsKBhyq+5nPkTUYMAXOsrF7HXQnB5rW3h0JBQl92Q5JrcBY8+OdhsMGTvA6KK2BLfL8xVrAHNa9OGQ+YjAs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1742113756; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=knoIHLoVNP3mGvFD3osaQFl1fgbXgAi4dTc6NPZEri0=; b=h5SweLUyV2sJMezGaVABKQOf18EOBefnvuNfZDoU/jHnz3XJIxVLiMoT60g4yzY7gKLhWr/RDxt4t9PSpc0vAf+N6Tip+Ib5ThdPyztVKw2//njZe50PahA9iRLkiCv6BhUYCx1gXWsuz7FQYaEf4NwbgBjo2qKAGr/co0l9qIE= 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 1742113756384418.2942276141207; Sun, 16 Mar 2025 01:29:16 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 4FD3E169F; Sun, 16 Mar 2025 04:29:15 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 4B8AA12A2; Sun, 16 Mar 2025 04:21:56 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 676AE22CE; Sun, 16 Mar 2025 04:21:50 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 7853D22CE for ; Sun, 16 Mar 2025 04:21:25 -0400 (EDT) Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-696-ERaM2-knOYaB9LgdNgac-w-1; Sun, 16 Mar 2025 04:21:23 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E458319560AB for ; Sun, 16 Mar 2025 08:21:22 +0000 (UTC) Received: from localhost (unknown [10.45.242.5]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id F06DB18001DE; Sun, 16 Mar 2025 08:21:20 +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=1742113285; 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: in-reply-to:in-reply-to:references:references; bh=CDxKdJwRwa7lcjOWOc7V5Uv8iFotVD/SxIlac8NDXfk=; b=YpBoHoPJmbIrTPxmpFreqLDI3Adn8ktMe+Gv0tcSQ3wTIijx9gDvLEtHcnlxkBrGrJml+H HaWpJ4oNFEsDu773U6WZXoSlWj/BsabuDSPX6UtdfXoCY+By0+Ad9ICF3QP66ziV+MaUfB hq5zmmQa304qKD87gfgqbXEso3IXOTQ= X-MC-Unique: ERaM2-knOYaB9LgdNgac-w-1 X-Mimecast-MFC-AGG-ID: ERaM2-knOYaB9LgdNgac-w_1742113283 To: devel@lists.libvirt.org Subject: [PATCH v3 19/20] qemu: add RDP support Date: Sun, 16 Mar 2025 12:18:40 +0400 Message-ID: <20250316081841.3170078-20-marcandre.lureau@redhat.com> In-Reply-To: <20250316081841.3170078-1-marcandre.lureau@redhat.com> References: <20250316081841.3170078-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: DKnkzYFo4VZvF3zZiQPewM6Mz6vga8K2PQhByKH6rYY_1742113283 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: OYCWKKP7LV3ZIKLTBTQ5JEGRCSDCDA43 X-Message-ID-Hash: OYCWKKP7LV3ZIKLTBTQ5JEGRCSDCDA43 X-MailFrom: marcandre.lureau@redhat.com X-Mailman-Rule-Hits: nonmember-moderation 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 CC: mkletzan@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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: "marcandre.lureau--- via Devel" Reply-To: marcandre.lureau@redhat.com X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1742113758465019100 Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau Wire the external server RDP support with QEMU. Check the configuration, allocate a port, start the process and set the credentials. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Martin Kletzander --- docs/formatdomain.rst | 25 +++--- src/conf/domain_conf.h | 1 + src/qemu/qemu_extdevice.c | 46 +++++++++-- src/qemu/qemu_hotplug.c | 51 +++++++++++- src/qemu/qemu_hotplug.h | 1 + src/qemu/qemu_process.c | 166 ++++++++++++++++++++++++++++++++++---- 6 files changed, 258 insertions(+), 32 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index c1876ad467..8ecad75f28 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -6552,7 +6552,7 @@ interaction with the admin. - + @@ -6715,14 +6715,21 @@ interaction with the admin. Starts a RDP server. The ``port`` attribute specifies the TCP port n= umber (with -1 as legacy syntax indicating that it should be auto-allocate= d). The ``autoport`` attribute is the new preferred syntax for indicating - auto-allocation of the TCP port to use. In the VirtualBox driver, the - ``autoport`` will make the hypervisor pick available port from 3389-= 3689 - range when the VM is started. The chosen port will be reflected in t= he - ``port`` attribute. The ``multiUser`` attribute is a boolean deciding - whether multiple simultaneous connections to the VM are permitted. T= he - ``replaceUser`` attribute is a boolean deciding whether the existing - connection must be dropped and a new connection must be established = by the - VRDP server, when a new client connects in single connection mode. + auto-allocation of the TCP port to use. + + A non-p2p ``dbus`` graphics is required to enable the QEMU RDP suppo= rt (it + uses an external "qemu-rdp" helper process). The ``username`` and + ``passwd`` attributes set the credentials (when they are not set, th= e RDP + access may be disabled by the helper). :since:`Since 11.1.0` + + In the VirtualBox driver, the ``autoport`` will make the hypervisor = pick + available port from 3389-3689 range when the VM is started. The chos= en + port will be reflected in the ``port`` attribute. The ``multiUser`` + attribute is a boolean deciding whether multiple simultaneous connec= tions + to the VM are permitted. The ``replaceUser`` attribute is a boolean + deciding whether the existing connection must be dropped and a new + connection must be established by the VRDP server, when a new client + connects in single connection mode. =20 ``desktop`` This value is reserved for VirtualBox domains for the moment. It dis= plays diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 32756e4dce..cbad1b7f7d 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2025,6 +2025,7 @@ struct _virDomainGraphicsDef { } sdl; struct { int port; + bool portReserved; bool autoport; bool replaceUser; bool multiUser; diff --git a/src/qemu/qemu_extdevice.c b/src/qemu/qemu_extdevice.c index 2384bab7a6..78e72b7c10 100644 --- a/src/qemu/qemu_extdevice.c +++ b/src/qemu/qemu_extdevice.c @@ -238,14 +238,28 @@ qemuExtDevicesStart(virQEMUDriver *driver, for (i =3D 0; i < def->ngraphics; i++) { virDomainGraphicsDef *graphics =3D def->graphics[i]; =20 - if (graphics->type !=3D VIR_DOMAIN_GRAPHICS_TYPE_DBUS) + switch (graphics->type) { + case VIR_DOMAIN_GRAPHICS_TYPE_DBUS: { + if (graphics->data.dbus.p2p || graphics->data.dbus.fromConfig) + continue; + if (qemuDBusStart(driver, vm) < 0) + return -1; continue; - - if (graphics->data.dbus.p2p || graphics->data.dbus.fromConfig) + } + case VIR_DOMAIN_GRAPHICS_TYPE_RDP: { + if (qemuRdpStart(vm, graphics) < 0) + return -1; continue; - - if (qemuDBusStart(driver, vm) < 0) - return -1; + } + case VIR_DOMAIN_GRAPHICS_TYPE_SDL: + case VIR_DOMAIN_GRAPHICS_TYPE_VNC: + case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP: + case VIR_DOMAIN_GRAPHICS_TYPE_SPICE: + case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS: + case VIR_DOMAIN_GRAPHICS_TYPE_LAST: + default: + continue; + } } =20 for (i =3D 0; i < def->ndisks; i++) { @@ -311,6 +325,26 @@ qemuExtDevicesStop(virQEMUDriver *driver, qemuVirtioFSStop(driver, vm, fs); } =20 + for (i =3D 0; i < def->ngraphics; i++) { + virDomainGraphicsDef *graphics =3D def->graphics[i]; + + switch (graphics->type) { + case VIR_DOMAIN_GRAPHICS_TYPE_RDP: { + qemuRdpStop(vm, graphics); + continue; + } + case VIR_DOMAIN_GRAPHICS_TYPE_DBUS: + case VIR_DOMAIN_GRAPHICS_TYPE_SDL: + case VIR_DOMAIN_GRAPHICS_TYPE_VNC: + case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP: + case VIR_DOMAIN_GRAPHICS_TYPE_SPICE: + case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS: + case VIR_DOMAIN_GRAPHICS_TYPE_LAST: + default: + continue; + } + } + for (i =3D 0; i < def->ndisks; i++) { virDomainDiskDef *disk =3D def->disks[i]; qemuNbdkitStopStorageSource(disk->src, vm, true); diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index b6ef10edf9..fdd40cfe15 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -4423,6 +4423,7 @@ int qemuDomainChangeGraphicsPasswords(virDomainObj *vm, int type, virDomainGraphicsAuthDef *auth, + const char *defaultUsername, const char *defaultPasswd, int asyncJob) { @@ -4432,13 +4433,21 @@ qemuDomainChangeGraphicsPasswords(virDomainObj *vm, g_autofree char *validTo =3D NULL; const char *connected =3D NULL; const char *password; + const char *username; int ret =3D -1; =20 if (!auth->passwd && !defaultPasswd) return 0; =20 + username =3D auth->username ? auth->username : defaultUsername; password =3D auth->passwd ? auth->passwd : defaultPasswd; =20 + if (type =3D=3D VIR_DOMAIN_GRAPHICS_TYPE_RDP) { + if (!password) + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Missing passwo= rd")); + return qemuRdpSetCredentials(vm, username, password, ""); + } + if (auth->connected) connected =3D virDomainGraphicsAuthConnectedTypeToString(auth->con= nected); =20 @@ -4568,6 +4577,7 @@ qemuDomainChangeGraphics(virQEMUDriver *driver, if (qemuDomainChangeGraphicsPasswords(vm, VIR_DOMAIN_GRAPHICS_TYPE= _VNC, &dev->data.vnc.auth, + NULL, cfg->vncPassword, VIR_ASYNC_JOB_NONE) < 0) return -1; @@ -4615,6 +4625,7 @@ qemuDomainChangeGraphics(virQEMUDriver *driver, if (qemuDomainChangeGraphicsPasswords(vm, VIR_DOMAIN_GRAPHICS_TYPE= _SPICE, &dev->data.spice.auth, + NULL, cfg->spicePassword, VIR_ASYNC_JOB_NONE) < 0) return -1; @@ -4630,8 +4641,46 @@ qemuDomainChangeGraphics(virQEMUDriver *driver, } break; =20 - case VIR_DOMAIN_GRAPHICS_TYPE_SDL: case VIR_DOMAIN_GRAPHICS_TYPE_RDP: + if ((olddev->data.rdp.autoport !=3D dev->data.rdp.autoport) || + (!dev->data.rdp.autoport && + (olddev->data.rdp.port !=3D dev->data.rdp.port))) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", + _("cannot change port settings on rdp graphics"= )); + return -1; + } + + /* If a password lifetime was, or is set, or action if connected h= as + * changed, then we must always run, even if new password matches + * old password */ + if (olddev->data.rdp.auth.expires || + dev->data.rdp.auth.expires || + olddev->data.rdp.auth.connected !=3D dev->data.rdp.auth.connec= ted || + STRNEQ_NULLABLE(olddev->data.rdp.auth.username, + dev->data.rdp.auth.username) || + STRNEQ_NULLABLE(olddev->data.rdp.auth.passwd, + dev->data.rdp.auth.passwd)) { + VIR_DEBUG("Updating password on RDP server %p %p", + dev->data.rdp.auth.passwd, cfg->rdpPassword); + if (qemuDomainChangeGraphicsPasswords(vm, + VIR_DOMAIN_GRAPHICS_TYPE= _RDP, + &dev->data.rdp.auth, + cfg->rdpUsername, + cfg->rdpPassword, + VIR_ASYNC_JOB_NONE) < 0) + return -1; + + /* Steal the new dev's char * reference */ + VIR_FREE(olddev->data.rdp.auth.username); + olddev->data.rdp.auth.username =3D g_steal_pointer(&dev->data.= rdp.auth.username); + VIR_FREE(olddev->data.rdp.auth.passwd); + olddev->data.rdp.auth.passwd =3D g_steal_pointer(&dev->data.rd= p.auth.passwd); + olddev->data.rdp.auth.validTo =3D dev->data.rdp.auth.validTo; + olddev->data.rdp.auth.expires =3D dev->data.rdp.auth.expires; + olddev->data.rdp.auth.connected =3D dev->data.rdp.auth.connect= ed; + } + break; + case VIR_DOMAIN_GRAPHICS_TYPE_SDL: case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP: case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS: case VIR_DOMAIN_GRAPHICS_TYPE_DBUS: diff --git a/src/qemu/qemu_hotplug.h b/src/qemu/qemu_hotplug.h index d51f649bac..7c858fc73e 100644 --- a/src/qemu/qemu_hotplug.h +++ b/src/qemu/qemu_hotplug.h @@ -57,6 +57,7 @@ int qemuDomainChangeGraphicsPasswords(virDomainObj *vm, int type, virDomainGraphicsAuthDef *auth, + const char *defaultUsername, const char *defaultPasswd, int asyncJob); =20 diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 1eb670e6ba..194176f58a 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2969,18 +2969,29 @@ qemuProcessInitPasswords(virQEMUDriver *driver, =20 for (i =3D 0; i < vm->def->ngraphics; ++i) { virDomainGraphicsDef *graphics =3D vm->def->graphics[i]; - if (graphics->type =3D=3D VIR_DOMAIN_GRAPHICS_TYPE_VNC) { - ret =3D qemuDomainChangeGraphicsPasswords(vm, - VIR_DOMAIN_GRAPHICS_TY= PE_VNC, - &graphics->data.vnc.au= th, - cfg->vncPassword, - asyncJob); - } else if (graphics->type =3D=3D VIR_DOMAIN_GRAPHICS_TYPE_SPICE) { - ret =3D qemuDomainChangeGraphicsPasswords(vm, - VIR_DOMAIN_GRAPHICS_TY= PE_SPICE, - &graphics->data.spice.= auth, - cfg->spicePassword, - asyncJob); + + switch (graphics->type) { + case VIR_DOMAIN_GRAPHICS_TYPE_VNC: + ret =3D qemuDomainChangeGraphicsPasswords( + vm, VIR_DOMAIN_GRAPHICS_TYPE_VNC, &graphics->data.vnc.auth= , NULL, + cfg->vncPassword, asyncJob); + break; + case VIR_DOMAIN_GRAPHICS_TYPE_SPICE: + ret =3D qemuDomainChangeGraphicsPasswords( + vm, VIR_DOMAIN_GRAPHICS_TYPE_SPICE, &graphics->data.spice.= auth, + NULL, cfg->spicePassword, asyncJob); + break; + case VIR_DOMAIN_GRAPHICS_TYPE_RDP: + ret =3D qemuDomainChangeGraphicsPasswords( + vm, VIR_DOMAIN_GRAPHICS_TYPE_RDP, &graphics->data.rdp.auth, + cfg->rdpUsername, cfg->rdpPassword, asyncJob); + break; + case VIR_DOMAIN_GRAPHICS_TYPE_SDL: + case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP: + case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS: + case VIR_DOMAIN_GRAPHICS_TYPE_DBUS: + case VIR_DOMAIN_GRAPHICS_TYPE_LAST: + break; } =20 if (ret < 0) @@ -4259,6 +4270,30 @@ qemuProcessSPICEAllocatePorts(virQEMUDriver *driver, return 0; } =20 +static int +qemuProcessRDPAllocatePorts(virQEMUDriver *driver, + virDomainGraphicsDef *graphics, + bool allocate) +{ + unsigned short port; + + if (!allocate) { + if (graphics->data.rdp.autoport) + graphics->data.rdp.port =3D 3389; + + return 0; + } + + if (graphics->data.rdp.autoport) { + if (virPortAllocatorAcquire(driver->rdpPorts, &port) < 0) + return -1; + graphics->data.rdp.port =3D port; + graphics->data.rdp.portReserved =3D true; + } + + return 0; +} + =20 static int qemuProcessVerifyHypervFeatures(virDomainDef *def, @@ -4967,8 +5002,16 @@ qemuProcessGraphicsReservePorts(virDomainGraphicsDef= *graphics, } break; =20 - case VIR_DOMAIN_GRAPHICS_TYPE_SDL: case VIR_DOMAIN_GRAPHICS_TYPE_RDP: + if (!graphics->data.rdp.autoport || + reconnect) { + if (virPortAllocatorSetUsed(graphics->data.rdp.port) < 0) + return -1; + graphics->data.rdp.portReserved =3D true; + } + break; + + case VIR_DOMAIN_GRAPHICS_TYPE_SDL: case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP: case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS: case VIR_DOMAIN_GRAPHICS_TYPE_DBUS: @@ -5007,8 +5050,12 @@ qemuProcessGraphicsAllocatePorts(virQEMUDriver *driv= er, return -1; break; =20 - case VIR_DOMAIN_GRAPHICS_TYPE_SDL: case VIR_DOMAIN_GRAPHICS_TYPE_RDP: + if (qemuProcessRDPAllocatePorts(driver, graphics, allocate) < 0) + return -1; + break; + + case VIR_DOMAIN_GRAPHICS_TYPE_SDL: case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP: case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS: case VIR_DOMAIN_GRAPHICS_TYPE_DBUS: @@ -5175,8 +5222,11 @@ qemuProcessGraphicsSetupListen(virQEMUDriver *driver, listenAddr =3D cfg->spiceListen; break; =20 - case VIR_DOMAIN_GRAPHICS_TYPE_SDL: case VIR_DOMAIN_GRAPHICS_TYPE_RDP: + listenAddr =3D cfg->rdpListen; + break; + + case VIR_DOMAIN_GRAPHICS_TYPE_SDL: case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP: case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS: case VIR_DOMAIN_GRAPHICS_TYPE_DBUS: @@ -5409,6 +5459,23 @@ qemuProcessMakeDir(virQEMUDriver *driver, } =20 =20 +static bool +virDomainDefHasDBus(const virDomainDef *def, bool p2p) +{ + size_t i =3D 0; + + for (i =3D 0; i < def->ngraphics; i++) { + virDomainGraphicsDef *graphics =3D def->graphics[i]; + + if (graphics->type =3D=3D VIR_DOMAIN_GRAPHICS_TYPE_DBUS) { + return graphics->data.dbus.p2p =3D=3D p2p; + } + } + + return false; +} + + static int qemuProcessStartValidateGraphics(virDomainObj *vm) { @@ -5427,8 +5494,30 @@ qemuProcessStartValidateGraphics(virDomainObj *vm) } break; =20 - case VIR_DOMAIN_GRAPHICS_TYPE_SDL: case VIR_DOMAIN_GRAPHICS_TYPE_RDP: + if (graphics->nListens > 1) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("qemu-rdp does not support multiple liste= ns for one graphics device.")); + return -1; + } + if (graphics->data.rdp.multiUser) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("qemu-rdp doesn't support the 'multiUser'= attribute.")); + return -1; + } + if (graphics->data.rdp.replaceUser) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("qemu-rdp doesn't support the 'replaceUse= r' attribute.")); + return -1; + } + if (!virDomainDefHasDBus(vm->def, false)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("qemu-rdp support requires a D-Bus bus gr= aphics device.")); + return -1; + } + break; + + case VIR_DOMAIN_GRAPHICS_TYPE_SDL: case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP: case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS: case VIR_DOMAIN_GRAPHICS_TYPE_DBUS: @@ -5938,6 +6027,41 @@ qemuProcessPrepareHostNetwork(virDomainObj *vm) } =20 =20 +static int +qemuPrepareGraphicsRdp(virQEMUDriver *driver, + virDomainGraphicsDef *gfx) +{ + g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(driver); + qemuRdp *rdp; + + if (!(rdp =3D qemuRdpNewForHelper(cfg->qemuRdpName))) + return -1; + + QEMU_DOMAIN_GRAPHICS_PRIVATE(gfx)->rdp =3D rdp; + + return 0; +} + + +static int +qemuProcessPrepareGraphics(virDomainObj *vm) +{ + qemuDomainObjPrivate *priv =3D vm->privateData; + size_t i; + + for (i =3D 0; i < vm->def->ngraphics; i++) { + virDomainGraphicsDef *gfx =3D vm->def->graphics[i]; + + if (gfx->type =3D=3D VIR_DOMAIN_GRAPHICS_TYPE_RDP && + qemuPrepareGraphicsRdp(priv->driver, gfx) < 0) + return -1; + + } + + return 0; +} + + struct qemuProcessSetupVcpuSchedCoreHelperData { pid_t vcpupid; pid_t dummypid; @@ -7409,6 +7533,10 @@ qemuProcessPrepareHost(virQEMUDriver *driver, if (qemuProcessPrepareHostNetwork(vm) < 0) return -1; =20 + VIR_DEBUG("Preparing graphics"); + if (qemuProcessPrepareGraphics(vm) < 0) + return -1; + /* Must be run before security labelling */ VIR_DEBUG("Preparing host devices"); if (!cfg->relaxedACS) @@ -8981,6 +9109,12 @@ void qemuProcessStop(virQEMUDriver *driver, graphics->data.spice.tlsPortReserved =3D false; } } + if (graphics->type =3D=3D VIR_DOMAIN_GRAPHICS_TYPE_RDP) { + if (graphics->data.rdp.portReserved) { + virPortAllocatorRelease(graphics->data.rdp.port); + graphics->data.rdp.portReserved =3D false; + } + } } =20 for (i =3D 0; i < vm->ndeprecations; i++) --=20 2.47.0 From nobody Fri Mar 13 12:47:24 2026 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=1742113780; cv=none; d=zohomail.com; s=zohoarc; b=j0WUpiRTVpIiPEnByKxlGlKS4zx2SXiLa723O2lekQuSRQuAEm0xPjxuCKjupAgTVcCu6dAewndiw8r1Ti68FTw0ZyO9fpx97NgmGurGadMbXXfhKaEAd5ALotmXwHhFaq408jwd9ThoTjKdxwC5KBuGpfCRLCyAj9Zr2Ymd6UM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1742113780; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=D8yB8oe6HeVAzmOIEwLQfEW4N5j8TtRRZNETKuvW/Wg=; b=Hy+0zXH0EM9uHX9bds3Wyd9OpmRbcGlroMWHULK/Zw4P5dDJRNPP7pFdWYOe8N+cPCbAbYpkuFVO85OEwpFgev+OTIDpLaj7b0BE/uGy7x1sgWVxEZGcH/LwK9FaqSXm+VEJutjDLS0mXf0YUGWbZM5kJuoyF2j9IJDBvOuGLDc= 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 174211378074228.03332343831198; Sun, 16 Mar 2025 01:29:40 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id AB294DAE; Sun, 16 Mar 2025 04:29:39 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 8E9AC23C4; Sun, 16 Mar 2025 04:22:11 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 8122123B2; Sun, 16 Mar 2025 04:22:06 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 ADC7C22C1 for ; Sun, 16 Mar 2025 04:21:33 -0400 (EDT) Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-18-Abjm5EUAM5e38TDQjGCCVg-1; Sun, 16 Mar 2025 04:21:32 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3A572195608D for ; Sun, 16 Mar 2025 08:21:31 +0000 (UTC) Received: from localhost (unknown [10.45.242.5]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4470519560AD; Sun, 16 Mar 2025 08:21:28 +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=1742113293; 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: in-reply-to:in-reply-to:references:references; bh=LV2TXMkMijmQoS7LYm2PwoDFZOWASRZQJnGuTTx/ot4=; b=Au7Q9SoM8REzfYTytcZCMIPm9K6T97KxJZjK+uhtTJm//pHH9w32rFXX3Y49iIWSt6S1HQ 6ETfuSZANHGeICU6tG4e0bId0cjKRe/2RV3jmkrCCdKMr5KjCE/xq6DY0ijDfSb85q4lam 2odetm4vMwz0xDnBZNzIQdWAqv0c3EE= X-MC-Unique: Abjm5EUAM5e38TDQjGCCVg-1 X-Mimecast-MFC-AGG-ID: Abjm5EUAM5e38TDQjGCCVg_1742113291 To: devel@lists.libvirt.org Subject: [PATCH v3 20/20] tests: add qemu test Date: Sun, 16 Mar 2025 12:18:41 +0400 Message-ID: <20250316081841.3170078-21-marcandre.lureau@redhat.com> In-Reply-To: <20250316081841.3170078-1-marcandre.lureau@redhat.com> References: <20250316081841.3170078-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: TM3ZVbCUoafNtxxwnXTbJaXNoGqIUqUtXfln3pc4lvg_1742113291 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: TXY5D57VREN7G2EM2H5IJRRAKNIJTAN2 X-Message-ID-Hash: TXY5D57VREN7G2EM2H5IJRRAKNIJTAN2 X-MailFrom: marcandre.lureau@redhat.com X-Mailman-Rule-Hits: nonmember-moderation 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 CC: mkletzan@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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: "marcandre.lureau--- via Devel" Reply-To: marcandre.lureau@redhat.com X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1742113782318019100 Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Martin Kletzander --- .../graphics-rdp.x86_64-latest.args | 35 +++++++++++++++ .../graphics-rdp.x86_64-latest.xml | 1 + tests/qemuxmlconfdata/graphics-rdp.xml | 43 +++++++++++++++++++ tests/qemuxmlconftest.c | 2 + 4 files changed, 81 insertions(+) create mode 100644 tests/qemuxmlconfdata/graphics-rdp.x86_64-latest.args create mode 120000 tests/qemuxmlconfdata/graphics-rdp.x86_64-latest.xml create mode 100644 tests/qemuxmlconfdata/graphics-rdp.xml diff --git a/tests/qemuxmlconfdata/graphics-rdp.x86_64-latest.args b/tests/= qemuxmlconfdata/graphics-rdp.x86_64-latest.args new file mode 100644 index 0000000000..292f283493 --- /dev/null +++ b/tests/qemuxmlconfdata/graphics-rdp.x86_64-latest.args @@ -0,0 +1,35 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/va= r/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine pc,usb=3Doff,dump-guest-core=3Doff,memory-backend=3Dpc.ram,acpi= =3Doff \ +-accel tcg \ +-cpu qemu64 \ +-m size=3D219136k \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server=3Don,wait=3Doff \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot strict=3Don \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ +-audiodev '{"id":"audio1","driver":"dbus"}' \ +-display dbus,addr=3Dunix:path=3D/var/run/libvirt/qemu/dbus/-1-QEMUGuest1-= dbus.sock \ +-device '{"driver":"cirrus-vga","id":"video0","bus":"pci.0","addr":"0x2"}'= \ +-chardev dbus,id=3Dcharredir0,name=3Dorg.qemu.usbredir \ +-device '{"driver":"usb-redir","chardev":"charredir0","id":"redir0","bus":= "usb.0","port":"1"}' \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxmlconfdata/graphics-rdp.x86_64-latest.xml b/tests/q= emuxmlconfdata/graphics-rdp.x86_64-latest.xml new file mode 120000 index 0000000000..7bb46ae7c4 --- /dev/null +++ b/tests/qemuxmlconfdata/graphics-rdp.x86_64-latest.xml @@ -0,0 +1 @@ +graphics-rdp.xml \ No newline at end of file diff --git a/tests/qemuxmlconfdata/graphics-rdp.xml b/tests/qemuxmlconfdata= /graphics-rdp.xml new file mode 100644 index 0000000000..7d65320f41 --- /dev/null +++ b/tests/qemuxmlconfdata/graphics-rdp.xml @@ -0,0 +1,43 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + qemu64 + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + +
+ + +
+ + + + + + + + +