From nobody Tue Sep 9 23:39:23 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 173815834854924.22218576539683; Wed, 29 Jan 2025 05:45:48 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 6CDB31398; Wed, 29 Jan 2025 08:45:48 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 466C517D3; Wed, 29 Jan 2025 08:42:14 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 4766115FA; Wed, 29 Jan 2025 08:42:10 -0500 (EST) 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 22F9A16D0 for ; Wed, 29 Jan 2025 08:41:54 -0500 (EST) 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-624-xPh7FVRrNv-gMwAS8LyuPA-1; Wed, 29 Jan 2025 08:41:52 -0500 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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AB3DF1801F17 for ; Wed, 29 Jan 2025 13:41:51 +0000 (UTC) Received: from localhost (unknown [10.39.208.35]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6155719560A3; Wed, 29 Jan 2025 13:41:49 +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, HEADER_FROM_DIFFERENT_DOMAINS,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=1738158113; 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=nZMLxC/LxPl3iFldMyKwOB/diD0tbWCR34FznUFhGbg=; b=c/aTVm/mMqPdICJ5G9ZPMgz2VDVFEo0d6FhXYsmv3KUArtAbbIo3P7Pg9RwfdBnSgCwECZ fMWZw+qc9wLXlTtQN9w2YGeFHM1is6nGw0JR5vd554MxMgqfREHWpEzTq85r56J2vmoeuc N3xubsdB6SDDjzxbTRVYrVU+lHlo/ak= X-MC-Unique: xPh7FVRrNv-gMwAS8LyuPA-1 X-Mimecast-MFC-AGG-ID: xPh7FVRrNv-gMwAS8LyuPA From: marcandre.lureau@redhat.com To: devel@lists.libvirt.org Subject: [PATCH 11/19] qemu: add RDP ports range allocator Date: Wed, 29 Jan 2025 17:40:33 +0400 Message-ID: <20250129134042.1282472-12-marcandre.lureau@redhat.com> In-Reply-To: <20250129134042.1282472-1-marcandre.lureau@redhat.com> References: <20250129134042.1282472-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: y1RTYkZHVzhwddad4XVAozYlnNRxZenr8t6j1UAvhOE_1738158111 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 2I7LSMJLVF6F7UPRCBWT46JG5ODL6EYT X-Message-ID-Hash: 2I7LSMJLVF6F7UPRCBWT46JG5ODL6EYT 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: =?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: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1738158355237019000 Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau RDP server use port 3389 by default. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 --- 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 4c8bfb97a9..2a6827bd79 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -64,6 +64,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 @@ -247,6 +250,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 3ab1c19e57..532487c6f0 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 @@ -311,6 +314,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 5a6e7fa062..d105a21244 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -724,6 +724,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, @@ -1071,6 +1078,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