From nobody Mon Sep 8 21:40:31 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1748332204; cv=none; d=zohomail.com; s=zohoarc; b=OQQ1XhB22b9j9tg2wJe/jznjzMmnoiOLasJKdKjB7djkdEgZt9aWsvQRWcYiHCLo0kMd9G10eDhONhAypupPHshPuUukxdrwkgfkfLKe+ibWQhW1rKhUKRkU6tGokrVMYfEo6WuF8c+ZE2Kax8h66dXRIjehAoM4Vq3Z5NG5gFE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748332204; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=3s6QO0mY48i6XTB3e/kfM5LTZQ0FPhunKot4PNxQk1I=; b=BjlVf23vP3nC1Vs45ac4+SQuM0IhSxFTMYHILDIgb+6nE2tTfEs7ABS0vqaJXFMHVlFzrQh2x1tiG9TnVNTYE6343nXsSrcV3Ru6G4RZGb0QBoAbEYAcRRgA2OpLb8FGAJPkzeLv/xuebVX/Os6788DqWRfj0Vvor8Aqd9k+uN8= 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 1748332204277503.39108605134925; Tue, 27 May 2025 00:50:04 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 64D011825; Tue, 27 May 2025 03:50:03 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 5626E1648; Tue, 27 May 2025 03:49:16 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 54DE7B15; Tue, 27 May 2025 03:49:12 -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 D49C3B0E for ; Tue, 27 May 2025 03:49:11 -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-620-H0h2BbHVOouraon9JFBH9w-1; Tue, 27 May 2025 03:49:10 -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 2ED34180036E for ; Tue, 27 May 2025 07:49:09 +0000 (UTC) Received: from speedmetal.lan (unknown [10.44.22.3]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 458ED180047F for ; Tue, 27 May 2025 07:49:08 +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_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=1748332151; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Qt2cQtv8Mgld8Txqo0pnrz3o/y/bR3rrB38gjuVoj98=; b=C5GSvQ9vrbtGgXVWLqKkGhb3wstz6d6PEwf2GBGGM4ZINRxQnZ0UlTGHxSy33kDFRxA08R asA2qB13VQyOcIhz+xbkiKlGLNZqVquwKvhQUM+K2y9Mp+tDC6enASDqVyrvOVPFkZlAJA 6cyuHIjwwiZiu/ouOW+OFEpsza+ZYXw= X-MC-Unique: H0h2BbHVOouraon9JFBH9w-1 X-Mimecast-MFC-AGG-ID: H0h2BbHVOouraon9JFBH9w_1748332149 To: devel@lists.libvirt.org Subject: [PATCH 1/9] qemuDomainValidateStorageSource: Rework protocol validation into a switch statement Date: Tue, 27 May 2025 09:48:57 +0200 Message-ID: <5ad4b637798a60fac4898c79a8d8809fcb0fe3ca.1748332058.git.pkrempa@redhat.com> In-Reply-To: References: 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: 1qhmWsM4QJvsGhYcBsU3k2to0vKbRXwktyxUbiXI4fM_1748332149 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: Z2JYIFBQDWZRZWKROAEPWIDMFQ5T65SV X-Message-ID-Hash: Z2JYIFBQDWZRZWKROAEPWIDMFQ5T65SV X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1748332205072116600 Content-Type: text/plain; charset="utf-8" From: Peter Krempa Move the validation of TFTP and NFS into a new switch statement which will be used for validating also other protocol config in the future. Signed-off-by: Peter Krempa Reviewed-by: Pavel Hrdina --- src/qemu/qemu_domain.c | 68 +++++++++++++++++++++++++++--------------- 1 file changed, 44 insertions(+), 24 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index cc3ab0a298..11f08b8ded 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4525,34 +4525,54 @@ qemuDomainValidateStorageSource(virStorageSource *s= rc, return -1; } - /* TFTP protocol is not supported since QEMU 2.8.0 */ - if (actualType =3D=3D VIR_STORAGE_TYPE_NETWORK && - src->protocol =3D=3D VIR_STORAGE_NET_PROTOCOL_TFTP) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("'tftp' protocol is not supported with this QEMU = binary")); - return -1; - } + if (actualType =3D=3D VIR_STORAGE_TYPE_NETWORK) { + switch ((virStorageNetProtocol) src->protocol) { + case VIR_STORAGE_NET_PROTOCOL_GLUSTER: + case VIR_STORAGE_NET_PROTOCOL_VXHS: + case VIR_STORAGE_NET_PROTOCOL_HTTP: + case VIR_STORAGE_NET_PROTOCOL_HTTPS: + case VIR_STORAGE_NET_PROTOCOL_FTP: + case VIR_STORAGE_NET_PROTOCOL_FTPS: + case VIR_STORAGE_NET_PROTOCOL_ISCSI: + case VIR_STORAGE_NET_PROTOCOL_NBD: + case VIR_STORAGE_NET_PROTOCOL_RBD: + case VIR_STORAGE_NET_PROTOCOL_SSH: + case VIR_STORAGE_NET_PROTOCOL_SHEEPDOG: + break; - if (actualType =3D=3D VIR_STORAGE_TYPE_NETWORK && - src->protocol =3D=3D VIR_STORAGE_NET_PROTOCOL_NFS) { - /* NFS protocol must have exactly one host */ - if (src->nhosts !=3D 1) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("'nfs' protocol requires the usage of exactly= one host")); - return -1; - } + case VIR_STORAGE_NET_PROTOCOL_NFS: + /* NFS protocol must have exactly one host */ + if (src->nhosts !=3D 1) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("'nfs' protocol requires the usage of exa= ctly one host")); + return -1; + } - /* NFS can only use a TCP protocol */ - if (src->hosts[0].transport !=3D VIR_STORAGE_NET_HOST_TRANS_TCP) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("'nfs' host must use TCP protocol")); + /* NFS can only use a TCP protocol */ + if (src->hosts[0].transport !=3D VIR_STORAGE_NET_HOST_TRANS_TC= P) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("'nfs' host must use TCP protocol")); + return -1; + } + + /* NFS host cannot have a port */ + if (src->hosts[0].port !=3D 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("port cannot be specified in 'nfs' protoc= ol host")); + return -1; + } + break; + + /* TFTP protocol is not supported since QEMU 2.8.0 */ + case VIR_STORAGE_NET_PROTOCOL_TFTP: + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("storage protocol '%1$s' is not supported by = this QEMU"), + virStorageNetProtocolTypeToString(src->protocol= )); return -1; - } - /* NFS host cannot have a port */ - if (src->hosts[0].port !=3D 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("port cannot be specified in 'nfs' protocol h= ost")); + case VIR_STORAGE_NET_PROTOCOL_NONE: + case VIR_STORAGE_NET_PROTOCOL_LAST: + virReportEnumRangeError(virStorageNetProtocol, src->protocol); return -1; } } --=20 2.49.0 From nobody Mon Sep 8 21:40:31 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1748332227; cv=none; d=zohomail.com; s=zohoarc; b=eNEDQp6Twnl6WDs8dHRhnTua+u2+0Nm7ipSA5iqld6unu8CSNGPXi7OBMqmDAI6vHUe/8Rb4QPt+t9nIawmrgLaYGZ5nejUtY2IH2qpGYJeV3Qq4hx4CJ+rQqt40GMYsxaKI8BCdcPJVVCgTA4ov9ks5kI9xg+ObvV94EupGahE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748332227; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=S7BXwdTwT9oGTIYQVEs0mUlus9EVZTZIZ1jbVBCi6eo=; b=aRClqF+bccGZTZTLrwpuk9q5WzxhJ3xF+5lZQEfmfnT95wBM7pTyBR1HtPlHPb4uvpbDTn0O1+E8D0bbjCNFqQs0lLvCaAyRiHkMqEiMBhc3ILviEaeqJXxMmV2a2q3zw9LgUiw0hRSijoquYDs55N8gWegIACFyVfczUBWHDAc= 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 1748332227947830.5552256300431; Tue, 27 May 2025 00:50:27 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 0775315E5; Tue, 27 May 2025 03:50:26 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 1CE39143D; Tue, 27 May 2025 03:49:18 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id B4B4BB0E; Tue, 27 May 2025 03:49:13 -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 40E12B14 for ; Tue, 27 May 2025 03:49:13 -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-288-qDk7LUz5McaDdk5L3ojmhQ-1; Tue, 27 May 2025 03:49:11 -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 5532619560AD for ; Tue, 27 May 2025 07:49:10 +0000 (UTC) Received: from speedmetal.lan (unknown [10.44.22.3]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8C96E180047F for ; Tue, 27 May 2025 07:49:09 +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_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=1748332152; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+SWMDHDr7JwzOyIfnAxznpXbBJG3ga6naTPWWuXgUgI=; b=aKjRNRiQyccpL/73GbiPSmfW4pyapQXenTwFPSfxgX29MkH8ILiIwEfag1Cxnl02BIo66Q n3JITnDXIaem4j+y7ibnfpa1S8kP7Iz4mcagv7DJMIysFqCm7nzHDToDuc1MIBOw79Qwmn rqTbujPFejwIPmv4rDYijIqL77X3Jl8= X-MC-Unique: qDk7LUz5McaDdk5L3ojmhQ-1 X-Mimecast-MFC-AGG-ID: qDk7LUz5McaDdk5L3ojmhQ_1748332150 To: devel@lists.libvirt.org Subject: [PATCH 2/9] qemu: Move disk backend validation checks from qemuProcessStartValidateDisks to qemuDomainValidateStorageSource Date: Tue, 27 May 2025 09:48:58 +0200 Message-ID: In-Reply-To: References: 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: T9-t9y3yOzAa06olnAoPuZYKwzu_GRpNkGf8DiV5w7E_1748332150 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: YZHGDXIQTXH6NOECJWXWCGAN3ANCIIIJ X-Message-ID-Hash: YZHGDXIQTXH6NOECJWXWCGAN3ANCIIIJ X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1748332229260116600 Content-Type: text/plain; charset="utf-8" From: Peter Krempa Move the check forbidding VXHS disks and checking the NVME backend capability to the validation code. Remove the now unused qemuProcessStartValidateDisks. Signed-off-by: Peter Krempa Reviewed-by: Pavel Hrdina --- src/qemu/qemu_domain.c | 9 ++++++++- src/qemu/qemu_process.c | 35 ----------------------------------- 2 files changed, 8 insertions(+), 36 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 11f08b8ded..230dc86038 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4453,6 +4453,13 @@ qemuDomainValidateStorageSource(virStorageSource *sr= c, } } + if (actualType =3D=3D VIR_STORAGE_TYPE_NVME && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE_NVME)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("NVMe disks are not supported with this QEMU bina= ry")); + return -1; + } + if (src->pr && !virQEMUCapsGet(qemuCaps, QEMU_CAPS_PR_MANAGER_HELPER)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", @@ -4528,7 +4535,6 @@ qemuDomainValidateStorageSource(virStorageSource *src, if (actualType =3D=3D VIR_STORAGE_TYPE_NETWORK) { switch ((virStorageNetProtocol) src->protocol) { case VIR_STORAGE_NET_PROTOCOL_GLUSTER: - case VIR_STORAGE_NET_PROTOCOL_VXHS: case VIR_STORAGE_NET_PROTOCOL_HTTP: case VIR_STORAGE_NET_PROTOCOL_HTTPS: case VIR_STORAGE_NET_PROTOCOL_FTP: @@ -4564,6 +4570,7 @@ qemuDomainValidateStorageSource(virStorageSource *src, break; /* TFTP protocol is not supported since QEMU 2.8.0 */ + case VIR_STORAGE_NET_PROTOCOL_VXHS: case VIR_STORAGE_NET_PROTOCOL_TFTP: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("storage protocol '%1$s' is not supported by = this QEMU"), diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 54b84922d6..c13a284473 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5600,38 +5600,6 @@ qemuProcessStartValidateShmem(virDomainObj *vm) } -static int -qemuProcessStartValidateDisks(virDomainObj *vm, - virQEMUCaps *qemuCaps) -{ - size_t i; - - for (i =3D 0; i < vm->def->ndisks; i++) { - virDomainDiskDef *disk =3D vm->def->disks[i]; - virStorageSource *src =3D disk->src; - - /* This is a best effort check as we can only check if the command - * option exists, but we cannot determine whether the running QEMU - * was build with '--enable-vxhs'. */ - if (src->type =3D=3D VIR_STORAGE_TYPE_NETWORK && - src->protocol =3D=3D VIR_STORAGE_NET_PROTOCOL_VXHS) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("VxHS protocol is not supported with this QEM= U binary")); - return -1; - } - - if (src->type =3D=3D VIR_STORAGE_TYPE_NVME && - !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE_NVME)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("NVMe disks are not supported with this QEMU = binary")); - return -1; - } - } - - return 0; -} - - /* 250 parts per million (ppm) is a half of NTP threshold */ #define TSC_TOLERANCE 250 @@ -5768,9 +5736,6 @@ qemuProcessStartValidate(virQEMUDriver *driver, } } - if (qemuProcessStartValidateDisks(vm, qemuCaps) < 0) - return -1; - if (qemuProcessStartValidateTSC(driver, vm) < 0) return -1; --=20 2.49.0 From nobody Mon Sep 8 21:40:31 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1748332253; cv=none; d=zohomail.com; s=zohoarc; b=V4eKQ27WdKNEse318elHHIayeo6X3Kn38qUKsJttC349X3MhzGVdD2uwFO85HNQBmG/fpMLzOOXpp9VQD51wc3GB08ACVexHd0T+Ecn1onpUXexEl4nPHSMn1YX/qZDJ9arjNIacYKNefj/AVC1olebZL6sNjF8C8/ZIc8ham78= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748332253; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=LBHankOcVOUnVHuZVDFARJLt33+Szkj9PSufmRVYyn4=; b=DAtGijzIWhR8SE5reGe1p4kO//vLSLMoemrbB8mI9zXxhfyBaHCLfLfaxTYVXIEDl0T/KsTNHOqifmZ/mLKEL+GaGLAbvlNv/+NYCe2rg1gaqM4vJ7Kc/BHA8B5kyK20ZZxLdM+qDiDEdmvuoeLE1cuLfrj9Vkx4CYzxmjCvT+4= 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 1748332252964195.0121816650818; Tue, 27 May 2025 00:50:52 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id EF272178B; Tue, 27 May 2025 03:50:51 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id CFF6916F8; Tue, 27 May 2025 03:49:28 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 5C71114BA; Tue, 27 May 2025 03:49: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 20CC315F2 for ; Tue, 27 May 2025 03:49:16 -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-156-_N4vGYqpOMuO4thyZmqCTQ-1; Tue, 27 May 2025 03:49:12 -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 95170180045C for ; Tue, 27 May 2025 07:49:11 +0000 (UTC) Received: from speedmetal.lan (unknown [10.44.22.3]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id CD898180047F for ; Tue, 27 May 2025 07:49:10 +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_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=1748332155; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AVuDT4mBWViavCk3Pdy9tLKHbPChUgBxXWAijxy1Szg=; b=Jp0B3js+5QcJFzP9NnXrgHJNdiVagJb7LtXduOwOTRomyFtiivO7TXIyzP6bkVt4Y37ZZz +xLLICOLf0QVZhQPnciO3WG5rq+sGh9souRExVRKyxAWpLMuHW3JK/IKH52YLOQxRSHgm0 jsiMp05dvhtjoHx500LdrgWFOmh1KCU= X-MC-Unique: _N4vGYqpOMuO4thyZmqCTQ-1 X-Mimecast-MFC-AGG-ID: _N4vGYqpOMuO4thyZmqCTQ_1748332151 To: devel@lists.libvirt.org Subject: [PATCH 3/9] qemu: block: Drop code for 'vxhs' storage protocol Date: Tue, 27 May 2025 09:48:59 +0200 Message-ID: <5fa0e16fc439bc997aaee9acdc445750364826ae.1748332058.git.pkrempa@redhat.com> In-Reply-To: References: 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: 48iOxoE4-gEegPjTfUxQP4aS7uY4W7AzAYMynu-mg-M_1748332151 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: JKVTOU4F5RJF4PI25ETVMPYGKB5BBKPG X-Message-ID-Hash: JKVTOU4F5RJF4PI25ETVMPYGKB5BBKPG X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1748332255855116600 Content-Type: text/plain; charset="utf-8" From: Peter Krempa qemu-5.2 dropped support for the 'vxhs' protocol. We require qemu-5.2 since commit ce48d584cc4 and thus the block code for vxhs is now dead. Remove it. Signed-off-by: Peter Krempa Reviewed-by: Pavel Hrdina --- src/qemu/qemu_block.c | 41 +---------------------------------------- src/qemu/qemu_domain.c | 37 +------------------------------------ 2 files changed, 2 insertions(+), 76 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index b1f50b6c67..32568d4ae6 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -426,41 +426,6 @@ qemuBlockStorageSourceGetGlusterProps(virStorageSource= *src, } -static virJSONValue * -qemuBlockStorageSourceGetVxHSProps(virStorageSource *src, - bool onlytarget) -{ - g_autoptr(virJSONValue) server =3D NULL; - const char *tlsAlias =3D src->tlsAlias; - virJSONValue *ret =3D NULL; - - if (src->nhosts !=3D 1) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("VxHS protocol accepts only one host")); - return NULL; - } - - if (!(server =3D qemuBlockStorageSourceBuildJSONInetSocketAddress(&src= ->hosts[0]))) - return NULL; - - if (onlytarget) - tlsAlias =3D NULL; - - /* VxHS disk specification example: - * { driver:"vxhs", - * tls-creds:"objvirtio-disk0_tls0", - * vdisk-id:"eb90327c-8302-4725-4e85ed4dc251", - * server:{type:"tcp", host:"1.2.3.4", port:9999}} - */ - ignore_value(virJSONValueObjectAdd(&ret, - "S:tls-creds", tlsAlias, - "s:vdisk-id", src->path, - "a:server", &server, NULL)); - - return ret; -} - - static virJSONValue * qemuBlockStorageSourceGetNFSProps(virStorageSource *src) { @@ -1088,11 +1053,6 @@ qemuBlockStorageSourceGetBackendProps(virStorageSour= ce *src, return NULL; break; - case VIR_STORAGE_NET_PROTOCOL_VXHS: - driver =3D "vxhs"; - if (!(fileprops =3D qemuBlockStorageSourceGetVxHSProps(src, on= lytarget))) - return NULL; - break; case VIR_STORAGE_NET_PROTOCOL_HTTP: case VIR_STORAGE_NET_PROTOCOL_HTTPS: @@ -1134,6 +1094,7 @@ qemuBlockStorageSourceGetBackendProps(virStorageSourc= e *src, return NULL; break; + case VIR_STORAGE_NET_PROTOCOL_VXHS: case VIR_STORAGE_NET_PROTOCOL_SHEEPDOG: virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("unsupported disk protocol")); diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 230dc86038..ace42b516a 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -8798,40 +8798,6 @@ qemuDomainPrepareChardevSourceOne(virDomainDeviceDef= *dev, } -static int -qemuProcessPrepareStorageSourceTLSVxhs(virStorageSource *src, - virQEMUDriverConfig *cfg, - qemuDomainObjPrivate *priv, - const char *parentAlias) -{ - /* VxHS uses only client certificates and thus has no need for - * the server-key.pem nor a secret that could be used to decrypt - * the it, so no need to add a secinfo for a secret UUID. */ - if (src->haveTLS =3D=3D VIR_TRISTATE_BOOL_ABSENT) { - if (cfg->vxhsTLS) - src->haveTLS =3D VIR_TRISTATE_BOOL_YES; - else - src->haveTLS =3D VIR_TRISTATE_BOOL_NO; - src->tlsFromConfig =3D true; - } - - if (src->haveTLS =3D=3D VIR_TRISTATE_BOOL_YES) { - src->tlsAlias =3D qemuAliasTLSObjFromSrcAlias(parentAlias); - src->tlsCertdir =3D g_strdup(cfg->vxhsTLSx509certdir); - - if (cfg->vxhsTLSx509secretUUID) { - qemuDomainStorageSourcePrivate *srcpriv =3D qemuDomainStorageS= ourcePrivateFetch(src); - - if (!(srcpriv->tlsKeySecret =3D qemuDomainSecretInfoTLSNew(pri= v, src->tlsAlias, - cfg->= vxhsTLSx509secretUUID))) - return -1; - } - } - - return 0; -} - - static int qemuProcessPrepareStorageSourceTLSNBD(virStorageSource *src, virQEMUDriverConfig *cfg, @@ -8958,8 +8924,7 @@ qemuDomainPrepareStorageSourceTLS(virStorageSource *s= rc, switch ((virStorageNetProtocol) src->protocol) { case VIR_STORAGE_NET_PROTOCOL_VXHS: - if (qemuProcessPrepareStorageSourceTLSVxhs(src, cfg, priv, parentA= lias) < 0) - return -1; + /* vxhs is no longer supported */ break; case VIR_STORAGE_NET_PROTOCOL_NBD: --=20 2.49.0 From nobody Mon Sep 8 21:40:31 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1748332310; cv=none; d=zohomail.com; s=zohoarc; b=K3JeWDJaf7cE3Wcs8O0l7Gc2QULcPqvEmPuSKQm5ePwluxrG7EJ28BCaVRtp1vwKCrly7m93pc6IFj7y4CWn8VJhRHktvnBYcrciMkqhUwlykQ2ja7ywnM8Dr4u2sNn14t2C5egvWzu4DijdnTYYeaJZ+MBEiTbMxqWW23iifG0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748332310; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=X4LHNxXaGwgMuZ7Msa8cVQxXMTluvDTmGOZKIt6Apo8=; b=AnR86ozf7WWGoruCm7iZOEbwZNNUASkgdpu4gEhQ/xJNXUUYHD4cVQVmJ4VoibTnx5VwiF2FZ0mbU7Olq/2SWm0x4dWipg9J+fyLENHMSg5Vlc58diThKlE/R2MPJ2gT6MZpM430uEsN3zuv4jE9CvxFNlKCbBceuToxpY9ODM4= 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 1748332310108296.0749268833521; Tue, 27 May 2025 00:51:50 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id ED3031290; Tue, 27 May 2025 03:51:48 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 003EC15DE; Tue, 27 May 2025 03:49:36 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 6EA3314B5; Tue, 27 May 2025 03:49:30 -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 37CA4169B for ; Tue, 27 May 2025 03:49:17 -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-175-SybSiqZ_OYyowQmAH3BsWg-1; Tue, 27 May 2025 03:49:13 -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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D48631956080 for ; Tue, 27 May 2025 07:49:12 +0000 (UTC) Received: from speedmetal.lan (unknown [10.44.22.3]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 16F83180047F for ; Tue, 27 May 2025 07:49: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_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=1748332156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ue4fJz6jQ6/L/GS6sPPyB5TGUGMLUZmmixFvqmTeh2E=; b=h/QJJWfKHpo16juBfc/xbddfG2riPU/AtWETPVAetejFwcw2jX9UdYiyWRA9bMM0lyqQE+ VDMW6FGOeeG/bkEgLWiRjX+jVkQ5mxE9KuFKdCUBzpd0d6xGP9QmvY6Io6zm9Wt/jD1yM/ squyIYxvPjRMP/5V4mUVV1rhiJ396Zg= X-MC-Unique: SybSiqZ_OYyowQmAH3BsWg-1 X-Mimecast-MFC-AGG-ID: SybSiqZ_OYyowQmAH3BsWg_1748332152 To: devel@lists.libvirt.org Subject: [PATCH 4/9] qemu.conf: Document options for VxHS block network protocol TLS config as ignored Date: Tue, 27 May 2025 09:49:00 +0200 Message-ID: <753bf88b467903d4793fd90a4ece2d1851236f5f.1748332058.git.pkrempa@redhat.com> In-Reply-To: References: 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: X1faH_6C2-kGBs1988aRSrsfTGl14ud2ASabyKP4h0E_1748332152 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: X6AV6CQGQ4RCEIYRVFI26AF7OBHGUPP2 X-Message-ID-Hash: X6AV6CQGQ4RCEIYRVFI26AF7OBHGUPP2 X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1748332312062116600 Content-Type: text/plain; charset="utf-8" From: Peter Krempa qemu-5.2 dropped support for VxHS. As we now require at least qemu-6.2, the qemu.conf option for setting up TLS for VxHS are no longer used. Document them as such. Signed-off-by: Peter Krempa Reviewed-by: Pavel Hrdina --- src/qemu/libvirtd_qemu.aug | 2 ++ src/qemu/qemu.conf.in | 42 +++----------------------------------- 2 files changed, 5 insertions(+), 39 deletions(-) diff --git a/src/qemu/libvirtd_qemu.aug b/src/qemu/libvirtd_qemu.aug index bd744940d2..e1e479d72c 100644 --- a/src/qemu/libvirtd_qemu.aug +++ b/src/qemu/libvirtd_qemu.aug @@ -69,6 +69,8 @@ module Libvirtd_qemu =3D | bool_entry "backup_tls_x509_verify" | str_entry "backup_tls_x509_secret_uuid" + (* support for vxhs was removed from qemu and the examples were dopped = from *) + (* qemu.conf but these need to stay *) let vxhs_entry =3D bool_entry "vxhs_tls" | str_entry "vxhs_tls_x509_cert_dir" | str_entry "vxhs_tls_x509_secret_uuid" diff --git a/src/qemu/qemu.conf.in b/src/qemu/qemu.conf.in index 502adbf5c3..042bb75b50 100644 --- a/src/qemu/qemu.conf.in +++ b/src/qemu/qemu.conf.in @@ -299,48 +299,12 @@ #chardev_tls_x509_secret_uuid =3D "00000000-0000-0000-0000-000000000000" -# Enable use of TLS encryption for all VxHS network block devices that -# don't specifically disable. -# -# When the VxHS network block device server is set up appropriately, -# x509 certificates are required for authentication between the clients -# (qemu processes) and the remote VxHS server. -# -# It is necessary to setup CA and issue the client certificate before -# enabling this. +# The support for VxHS network block protocol was removed in qemu-5.2 and +# thus also dropped from libvirt's qemu driver. The following options which +# were used to configure the TLS certificates for VxHS are thus ignored. # #vxhs_tls =3D 1 - - -# In order to override the default TLS certificate location for VxHS -# backed storage, supply a valid path to the certificate directory. -# This is used to authenticate the VxHS block device clients to the VxHS -# server. -# -# If the provided path does not exist, libvirtd will fail to start. -# If the path is not provided, but vxhs_tls =3D 1, then the -# default_tls_x509_cert_dir path will be used. -# -# VxHS block device clients expect the client certificate and key to be -# present in the certificate directory along with the CA master certificat= e. -# If using the default environment, default_tls_x509_verify must be config= ured. -# Since this is only a client the server-key.pem certificate is not needed. -# Thus a VxHS directory must contain the following: -# -# ca-cert.pem - the CA master certificate -# client-cert.pem - the client certificate signed with the ca-cert.pem -# client-key.pem - the client private key -# #vxhs_tls_x509_cert_dir =3D "/etc/pki/libvirt-vxhs" - - -# Uncomment and use the following option to override the default secret -# UUID provided in the default_tls_x509_secret_uuid parameter. -# -# NB This default all-zeros UUID will not work. Replace it with the -# output from the UUID for the TLS secret from a 'virsh secret-list' -# command and then uncomment the entry -# #vxhs_tls_x509_secret_uuid =3D "00000000-0000-0000-0000-000000000000" --=20 2.49.0 From nobody Mon Sep 8 21:40:31 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1748332284; cv=none; d=zohomail.com; s=zohoarc; b=ENUAN3Lst7C72ACDXjL2PFfNNgNPHKsHebTO7cY4xnOHH4dIEWw9qmr8c4VJ/QnQDuWproc5a6/IFUBIlaoUS3UCuzLQrIJrbNAHGAyJkHR/D4Oehw59JOOGK6j3zNvXRJFCz7ajzBgIOIU9wa+JMiU6CHTro9rrqrDLZHwoVO4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748332284; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=X+3okX4A8D2WErciyez3PrDGe/n5AqT5hJG1v/TYhCM=; b=IwM+5pDeCsewzlBCbp4E93qUPWls7xwv+A6XZc1GFes1iYj6ShgSFPkTMhp6ZwBuzWgZ6oFpY0FtDH4rGRTFJ0kSlqXdSMRwoaamP4wj0Qvu9VCZFURDV33TZsD4pwZIOXNaN97m2zidwUn3XMFzQrWinlNN42dMnlNgFi8X/Sc= 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 1748332284833494.1458715538662; Tue, 27 May 2025 00:51:24 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id D5895147A; Tue, 27 May 2025 03:51:23 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 4EFBC143E; Tue, 27 May 2025 03:49:34 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id B02C8152E; Tue, 27 May 2025 03:49:29 -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 F04DA1689 for ; Tue, 27 May 2025 03:49:16 -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-269-L_sAVVszMDOjqvd1KH2O4w-1; Tue, 27 May 2025 03:49:14 -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 1FD061800873 for ; Tue, 27 May 2025 07:49:14 +0000 (UTC) Received: from speedmetal.lan (unknown [10.44.22.3]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 57BC818003FD for ; Tue, 27 May 2025 07:49:13 +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_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=1748332156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h4gjcEFVD284am3ByKEtEMTNwwb06eDOZo9kBtmcJCQ=; b=esqe3VUV4uwoL6LWhoh4dWuti2m7amrJN6NLEXJC7RcO9iFsnLBMsxq3CIq7wwxYJ+gwDp 5gGQT2Zg9p00hOn3hpGw1L77zff6l6e8NX6ADqfGcPNPhc0tYfow5rFMERDyfXlo/27qYp Xjz99RADzhpfIKANO6dq8pDzRUWpJGk= X-MC-Unique: L_sAVVszMDOjqvd1KH2O4w-1 X-Mimecast-MFC-AGG-ID: L_sAVVszMDOjqvd1KH2O4w_1748332154 To: devel@lists.libvirt.org Subject: [PATCH 5/9] qemu: conf: Drop handling of 'vxhs' config options Date: Tue, 27 May 2025 09:49:01 +0200 Message-ID: <8fa274d9f19246c293895c23343892e489486610.1748332058.git.pkrempa@redhat.com> In-Reply-To: References: 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: ybjeTJRGxMMbqoRM6sNNqF3DVewpJ04wIJUH1eTDTLE_1748332154 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: FJOLTTEOHIY2IJ6Y7KLQBHEMNNYBVK4O X-Message-ID-Hash: FJOLTTEOHIY2IJ6Y7KLQBHEMNNYBVK4O X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1748332286157116600 Content-Type: text/plain; charset="utf-8" From: Peter Krempa Remove the config file handling for the config options we no longer use. Signed-off-by: Peter Krempa Reviewed-by: Pavel Hrdina --- src/qemu/qemu_conf.c | 17 ----------------- src/qemu/qemu_conf.h | 4 ---- tests/qemuxmlconftest.c | 4 ---- tests/testutilsqemu.c | 2 -- 4 files changed, 27 deletions(-) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 8ffbcacaf2..9bf12fc179 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -385,9 +385,6 @@ static void virQEMUDriverConfigDispose(void *obj) g_free(cfg->chardevTLSx509certdir); g_free(cfg->chardevTLSx509secretUUID); - g_free(cfg->vxhsTLSx509certdir); - g_free(cfg->vxhsTLSx509secretUUID); - g_free(cfg->nbdTLSx509certdir); g_free(cfg->nbdTLSx509secretUUID); @@ -553,8 +550,6 @@ virQEMUDriverConfigLoadSpecificTLSEntry(virQEMUDriverCo= nfig *cfg, { int rv; - if (virConfGetValueBool(conf, "vxhs_tls", &cfg->vxhsTLS) < 0) - return -1; if (virConfGetValueBool(conf, "nbd_tls", &cfg->nbdTLS) < 0) return -1; if (virConfGetValueBool(conf, "chardev_tls", &cfg->chardevTLS) < 0) @@ -591,8 +586,6 @@ virQEMUDriverConfigLoadSpecificTLSEntry(virQEMUDriverCo= nfig *cfg, GET_CONFIG_TLS_CERTINFO_COMMON(backup); GET_CONFIG_TLS_CERTINFO_SERVER(backup); - GET_CONFIG_TLS_CERTINFO_COMMON(vxhs); - GET_CONFIG_TLS_CERTINFO_COMMON(nbd); #undef GET_CONFIG_TLS_CERTINFO_COMMON @@ -1416,14 +1409,6 @@ virQEMUDriverConfigValidate(virQEMUDriverConfig *cfg) return -1; } - if (cfg->vxhsTLSx509certdir && - !virFileExists(cfg->vxhsTLSx509certdir)) { - virReportError(VIR_ERR_CONF_SYNTAX, - _("vxhs_tls_x509_cert_dir directory '%1$s' does not= exist"), - cfg->vxhsTLSx509certdir); - return -1; - } - if (cfg->nbdTLSx509certdir && !virFileExists(cfg->nbdTLSx509certdir)) { virReportError(VIR_ERR_CONF_SYNTAX, @@ -1452,7 +1437,6 @@ virQEMUDriverConfigSetDefaults(virQEMUDriverConfig *c= fg) SET_TLS_SECRET_UUID_DEFAULT(chardev); SET_TLS_SECRET_UUID_DEFAULT(migrate); SET_TLS_SECRET_UUID_DEFAULT(backup); - SET_TLS_SECRET_UUID_DEFAULT(vxhs); SET_TLS_SECRET_UUID_DEFAULT(nbd); #undef SET_TLS_SECRET_UUID_DEFAULT @@ -1481,7 +1465,6 @@ virQEMUDriverConfigSetDefaults(virQEMUDriverConfig *c= fg) SET_TLS_X509_CERT_DEFAULT(chardev); SET_TLS_X509_CERT_DEFAULT(migrate); SET_TLS_X509_CERT_DEFAULT(backup); - SET_TLS_X509_CERT_DEFAULT(vxhs); SET_TLS_X509_CERT_DEFAULT(nbd); #undef SET_TLS_X509_CERT_DEFAULT diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h index f6b13c828d..1ce9dbe4a8 100644 --- a/src/qemu/qemu_conf.h +++ b/src/qemu/qemu_conf.h @@ -159,10 +159,6 @@ struct _virQEMUDriverConfig { bool backupTLSx509verifyPresent; char *backupTLSx509secretUUID; - bool vxhsTLS; - char *vxhsTLSx509certdir; - char *vxhsTLSx509secretUUID; - bool nbdTLS; char *nbdTLSx509certdir; char *nbdTLSx509secretUUID; diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 9a29262d1b..0f1c935267 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -1593,16 +1593,12 @@ mymain(void) DO_TEST_CAPS_LATEST("disk-network-source-auth"); DO_TEST_CAPS_LATEST("disk-network-source-curl"); DO_TEST_CAPS_LATEST("disk-network-nfs"); - driver.config->vxhsTLS =3D 1; driver.config->nbdTLSx509secretUUID =3D g_strdup("6fd3f62d-9fe7-4a4e-a= 869-7acd6376d8ea"); - driver.config->vxhsTLSx509secretUUID =3D g_strdup("6fd3f62d-9fe7-4a4e-= a869-7acd6376d8ea"); DO_TEST_CAPS_LATEST("disk-network-tlsx509-nbd"); DO_TEST_CAPS_VER_PARSE_ERROR("disk-network-tlsx509-nbd-hostname", "6.2= .0"); DO_TEST_CAPS_LATEST("disk-network-tlsx509-nbd-hostname"); DO_TEST_CAPS_LATEST("disk-network-http"); VIR_FREE(driver.config->nbdTLSx509secretUUID); - VIR_FREE(driver.config->vxhsTLSx509secretUUID); - driver.config->vxhsTLS =3D 0; DO_TEST_CAPS_LATEST("disk-network-ssh"); DO_TEST_CAPS_LATEST("disk-no-boot"); DO_TEST_CAPS_LATEST("disk-nvme"); diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 9038a37869..78ec521266 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -396,8 +396,6 @@ int qemuTestDriverInit(virQEMUDriver *driver) 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); - cfg->vxhsTLSx509certdir =3D g_strdup("/etc/pki/libvirt-vxhs"); VIR_FREE(cfg->nbdTLSx509certdir); cfg->nbdTLSx509certdir =3D g_strdup("/etc/pki/libvirt-nbd"); VIR_FREE(cfg->migrateTLSx509certdir); --=20 2.49.0 From nobody Mon Sep 8 21:40:31 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1748332328; cv=none; d=zohomail.com; s=zohoarc; b=XrxZ1AYBxtwqKHcrn1K6nOdEH7MqUnZCaHHMZ4P69QIPpr2Rdy9+6Px2djb3cx6Am1PCJzk/fyUVAyqJMK1A+tc3nqwbCPBS6LSaDtFyIwRRUay/rL25WW+KqM524KjclOdQeE1TBrT5bM+lDefssr9a2L1wADTWfjaNyRkGHag= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748332328; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=tbA4t5/I+Jgw2JEvVcxppxBHJnV9ZyEZuuke39msDt0=; b=KyTvSZtylMJQjB/O451wYIwyb56xRlLWgghIz+fHj2pvzyz6WrK4A48tm5YjmgMo6FhbgVTcly16Zy9ie0zuF76G+3QZ757AvXv5aKHn9i52Y1K0sfv52/+UDxHevFA5eledR0WZBjYBIqmg/kgGKXMyg3edFzEv6il/z8eYFSU= 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 1748332328120575.3448019831233; Tue, 27 May 2025 00:52:08 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 22B8616B2; Tue, 27 May 2025 03:52:07 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id B3BE1177A; Tue, 27 May 2025 03:49:38 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id BA83F1290; Tue, 27 May 2025 03:49:31 -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 E219212C2 for ; Tue, 27 May 2025 03:49:18 -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-189-Bk653UToNQuqQ3VkoCzNpw-1; Tue, 27 May 2025 03:49:16 -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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 656021956080 for ; Tue, 27 May 2025 07:49:15 +0000 (UTC) Received: from speedmetal.lan (unknown [10.44.22.3]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9662318001DB for ; Tue, 27 May 2025 07:49:14 +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_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=1748332158; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=q5LfOfbv5/riJyTuVSK2IZ7KoYWDFBJUSlOLL/HsRF4=; b=G15ptHGpIg4cyhN6DYsEWAUwjh5Za9QLxj9JsVHT64Etoz4Mipkkpyes8vqbjP/YZ7Ij1m +MM/NWxkk5lR6KuiE9nil1B2h0jRJkXLa5TMmwE4o4a5qojxU7V287DUvKWdUcKkZETgYW vbmL4iyt9KhlHq9Hb+nzx+AeiohOAyg= X-MC-Unique: Bk653UToNQuqQ3VkoCzNpw-1 X-Mimecast-MFC-AGG-ID: Bk653UToNQuqQ3VkoCzNpw_1748332155 To: devel@lists.libvirt.org Subject: [PATCH 6/9] qemu: Move logic from qemuProcessStartValidateShmem to qemuValidateDomainDeviceDefShmem Date: Tue, 27 May 2025 09:49:02 +0200 Message-ID: <01f0b7b9eef5924fb50daa96ef6467feb3caea6f.1748332058.git.pkrempa@redhat.com> In-Reply-To: References: 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: t1or7f-2O-b_c77_Naw-W2MzBlqdSYe0pe5wwqnLnVg_1748332155 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: BB5TYA6LRTUGQSAFZIYOF46BZKKMSID7 X-Message-ID-Hash: BB5TYA6LRTUGQSAFZIYOF46BZKKMSID7 X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1748332330238116600 Content-Type: text/plain; charset="utf-8" From: Peter Krempa Move the check to the appropriate central place. Signed-off-by: Peter Krempa Reviewed-by: Pavel Hrdina --- src/qemu/qemu_process.c | 23 ----------------------- src/qemu/qemu_validate.c | 7 +++++++ 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index c13a284473..9fbb03ee8b 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5580,26 +5580,6 @@ qemuProcessStartValidateGraphics(virDomainObj *vm) } -static int -qemuProcessStartValidateShmem(virDomainObj *vm) -{ - size_t i; - - for (i =3D 0; i < vm->def->nshmems; i++) { - virDomainShmemDef *shmem =3D vm->def->shmems[i]; - - if (strchr(shmem->name, '/')) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("shmem name '%1$s' must not contain '/'"), - shmem->name); - return -1; - } - } - - return 0; -} - - /* 250 parts per million (ppm) is a half of NTP threshold */ #define TSC_TOLERANCE 250 @@ -5707,9 +5687,6 @@ qemuProcessStartValidate(virQEMUDriver *driver, if (qemuProcessStartValidateGraphics(vm) < 0) return -1; - if (qemuProcessStartValidateShmem(vm) < 0) - return -1; - if (vm->def->cpu) { if (virCPUValidateFeatures(vm->def->os.arch, vm->def->cpu) < 0) return -1; diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index e45f636418..0e7dd3fc58 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -5472,6 +5472,13 @@ static int qemuValidateDomainDeviceDefShmem(virDomainShmemDef *shmem, virQEMUCaps *qemuCaps) { + if (strchr(shmem->name, '/')) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("shmem name '%1$s' must not contain '/'"), + shmem->name); + return -1; + } + if (shmem->size > 0) { if (shmem->size < 1024 * 1024 || !VIR_IS_POW2(shmem->size)) { --=20 2.49.0 From nobody Mon Sep 8 21:40:31 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1748332348; cv=none; d=zohomail.com; s=zohoarc; b=O8/0Nfjls2UFpGLs9Dl3AeE+DimwWkDLVA0r/N2dng4wT8HpwGCWoF/ajTMNgSB8Ziy7NyM6Mrs1j4SzIfqvydFNSSbyZKpsvzvsrEKJkfmB7AMlcvzfLsY0OHhaHq/4YiTOVHoirZbP0fV0XuY8DR2XTDHsGV1/ZPTbEtcBvSA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748332348; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=7gi8R69oda+J+I2MuOYFXFa0D21/f1S6iTryw4zqFY8=; b=aoyLCIbMSr5vZogXe6Q0FXPBlKdfj3XhvOJpL7ODjI5HzzM2VdRYUSxVPiR8P6eahbOdBzWl8qz37V/oSaidaaimrEl79TTmFXFOCuGzb4C4QP/6AOBEdgzr4DtzeLIUBq42NWUfcTmluYYG3VSMbrnb+C2bN660W12PPN0wBgc= 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 1748332348354380.29541151388094; Tue, 27 May 2025 00:52:28 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 5D52414BA; Tue, 27 May 2025 03:52:27 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 17540177B; Tue, 27 May 2025 03:49:42 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 8B43A163B; Tue, 27 May 2025 03:49: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 66A9516E8 for ; Tue, 27 May 2025 03:49:20 -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-18-fdvzdKrwPC69cdJe1uK9BA-1; Tue, 27 May 2025 03:49:17 -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 C6D8A1955DAD for ; Tue, 27 May 2025 07:49:16 +0000 (UTC) Received: from speedmetal.lan (unknown [10.44.22.3]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E1D20180047F for ; Tue, 27 May 2025 07:49: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_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=1748332160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hf0mlKBzMoHrtri8XSNeKwZxuWb7sgm1v7hq2VMLci0=; b=OMgQnrykyLiwAvTG3S5z0xQlLBhgWbB8awG5rXVj0sf9nCo/f+/lq264DlXpFqktESOZln +QTJz70udKKERc1QGVNl/ecGiu5WBxjd7C4wNyYeJ+0bEGx5WoqP3Tba4fJeMDYMaU2384 ezDkrOSOiV84rScQeG+PTDc2PKwoIdQ= X-MC-Unique: fdvzdKrwPC69cdJe1uK9BA-1 X-Mimecast-MFC-AGG-ID: fdvzdKrwPC69cdJe1uK9BA_1748332156 To: devel@lists.libvirt.org Subject: [PATCH 7/9] qemu: Move checks for number of listening sockets of graphics to validation code Date: Tue, 27 May 2025 09:49:03 +0200 Message-ID: <3dc427090f90a687e445ab57fcb7f3a056070352.1748332058.git.pkrempa@redhat.com> In-Reply-To: References: 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: d9Rtxr9B_-uv9ctccV_X4il1k-zyWzJVQmpTjdK6oxA_1748332156 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: EAQPR4ZO3Y4SW6MMXWWURZ5MPG7JL3GK X-Message-ID-Hash: EAQPR4ZO3Y4SW6MMXWWURZ5MPG7JL3GK X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1748332350570116600 Content-Type: text/plain; charset="utf-8" From: Peter Krempa Move the checks from 'qemuProcessStartValidateGraphics' to the correspodning graphics validation functions in qemu_validate.c: - qemuValidateDomainDeviceDefSPICEGraphics - qemuValidateDomainDeviceDefVNCGraphics - qemuValidateDomainDeviceDefRDPGraphics Signed-off-by: Peter Krempa Reviewed-by: Pavel Hrdina --- src/qemu/qemu_process.c | 10 ---------- src/qemu/qemu_validate.c | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 9fbb03ee8b..b99602c5ed 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5537,19 +5537,9 @@ qemuProcessStartValidateGraphics(virDomainObj *vm) switch (graphics->type) { case VIR_DOMAIN_GRAPHICS_TYPE_VNC: case VIR_DOMAIN_GRAPHICS_TYPE_SPICE: - if (graphics->nListens > 1) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("QEMU does not support multiple listens f= or one graphics device.")); - return -1; - } break; 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.")); diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 0e7dd3fc58..1aa54bf59f 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -4425,6 +4425,12 @@ qemuValidateDomainDeviceDefSPICEGraphics(const virDo= mainGraphicsDef *graphics, virDomainGraphicsListenDef *glisten =3D NULL; int tlsPort =3D graphics->data.spice.tlsPort; + if (graphics->nListens > 1) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("QEMU does not support multiple listens for one g= raphics device.")); + return -1; + } + glisten =3D virDomainGraphicsGetListen((virDomainGraphicsDef *)graphic= s, 0); if (!glisten) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -4472,6 +4478,12 @@ static int qemuValidateDomainDeviceDefVNCGraphics(const virDomainGraphicsDef *graphic= s, virQEMUCaps *qemuCaps) { + if (graphics->nListens > 1) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("QEMU does not support multiple listens for one g= raphics device.")); + return -1; + } + if (graphics->data.vnc.powerControl !=3D VIR_TRISTATE_BOOL_ABSENT && !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VNC_POWER_CONTROL)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", @@ -4512,6 +4524,12 @@ qemuValidateDomainDeviceDefDBusGraphics(const virDom= ainGraphicsDef *graphics, static int qemuValidateDomainDeviceDefRDPGraphics(const virDomainGraphicsDef *graphic= s) { + if (graphics->nListens > 1) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("qemu-rdp does not support multiple listens for o= ne graphics device.")); + return -1; + } + if (graphics->data.rdp.replaceUser) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("RDP doesn't support 'replaceUser'")); --=20 2.49.0 From nobody Mon Sep 8 21:40:31 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1748332372; cv=none; d=zohomail.com; s=zohoarc; b=TxqaWd++ley8aBOYczEAWnyMHvppd/K+uNZgGCbFxKG7N2p7f79eNLbTOZdv6kJ/8/bEW1zhR4XsXwoAgjCLLOkkKRb2+nlRxAvF+E4ao5oiPooxvxCob2QgXrT9X46bb70i2OEemtNOHv78kC6fmq8JufFrWYv/0HLITj0Mk6A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748332372; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=eI8fRaWW5V5fIoN3EDEE0mIfuhL4W/3MszenHTZJHMw=; b=d7471FR/GD6tDyuRRqz7DgSvVFOEQd7nUhgG2gVSuvxsgjTUVlKYTCtLvDOYz7V3WY0nweXrTp8clInLs/hh90V/Oe0tVJtlC+VCi+AiY44B1L6nAbfpDdnI1DUaPuD+dLdAzvX3yADpI3ZXra4u4HHUVhtLKFOZTupixFdOvAI= 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 1748332372130505.0463530425204; Tue, 27 May 2025 00:52:52 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 2CB0A14D3; Tue, 27 May 2025 03:52:51 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 8EE5814C7; Tue, 27 May 2025 03:49:45 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id E49E5143B; Tue, 27 May 2025 03:49:40 -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 158B8165D for ; Tue, 27 May 2025 03:49:22 -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-32-IHzDR9jQOv-Cvvywv8TmgA-1; Tue, 27 May 2025 03:49: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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 16DAF1800772 for ; Tue, 27 May 2025 07:49:18 +0000 (UTC) Received: from speedmetal.lan (unknown [10.44.22.3]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4A3CB18003FD for ; Tue, 27 May 2025 07:49:17 +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_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=1748332161; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TeLS6U3vsTKAFETVg4eKuKzf91BF3kaPkUetls1Vyko=; b=HeX2llSBVqtgk2vEasrw8RD5tG2qEYObu/h3PXNtG5xb8w5CXiqtLsDyJ4btX4J1NmNANQ 0C2yqdXN8IFmH7gnyLyxgEbekDXVp7GH/ObA/OC5bpW8ZvTaEfk+UC5yyFgcKgj33RcgTv rSdT9kH+kGpS1s3LKprNWf06smkfFpI= X-MC-Unique: IHzDR9jQOv-Cvvywv8TmgA-1 X-Mimecast-MFC-AGG-ID: IHzDR9jQOv-Cvvywv8TmgA_1748332158 To: devel@lists.libvirt.org Subject: [PATCH 8/9] qemuProcessStartValidateGraphics: Remove redundant checks for RDP protocol features Date: Tue, 27 May 2025 09:49:04 +0200 Message-ID: <30debee0650c7535fca31e0046e3d2d470a71d17.1748332058.git.pkrempa@redhat.com> In-Reply-To: References: 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: 06P--GLsHxKErXRXg7DrnCe-OujqERneoblYQqpy3IU_1748332158 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 4FTI4GTTRV2AMD3ES5EKG546CRMIFIJU X-Message-ID-Hash: 4FTI4GTTRV2AMD3ES5EKG546CRMIFIJU X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1748332372597116600 Content-Type: text/plain; charset="utf-8" From: Peter Krempa Both the 'replaceUser' and 'multiUser' field are already validated in qemuValidateDomainDeviceDefRDPGraphics. Signed-off-by: Peter Krempa Reviewed-by: Pavel Hrdina --- src/qemu/qemu_process.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index b99602c5ed..920adef7df 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5540,16 +5540,6 @@ qemuProcessStartValidateGraphics(virDomainObj *vm) break; case VIR_DOMAIN_GRAPHICS_TYPE_RDP: - 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.")); --=20 2.49.0 From nobody Mon Sep 8 21:40:31 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1748332393; cv=none; d=zohomail.com; s=zohoarc; b=Epo3kiPx08NrxXvxVNNyS4Yol1sIDx6HpTGRz0MSH7JJbQtg2JRmLIhyJsLuMyS0rkKDVhsWqmFn0BHQc+3B4nxm6l1AsuoeOAMdUIvn7Vwf82RMH8EcsValV9JiWHPMypJur5++AjBkBGwVM6mwVjDcS7GbdGHtKFPDoOryFfM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1748332393; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=vfPzrsOsXJWbtObCizGfF0D4vIvF3D7tgu4iAbjnrnQ=; b=nyf8GDJFic1bUQ3Quf+mGb4RP3D0cdgQMv/GE/wOGJjabDxHA3tuUkMlxtrB4LD6sGdHiZ6dhvMU99bK/7Th5JYDG0i292aRQxMikTRGpR6P3Sg3uZi8FLuCQoC+X8RaPQbARQCznA7Ws21NozgLM3I6/NiZ01VMn+vgRyyXo1Y= 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 1748332393648908.2866975398; Tue, 27 May 2025 00:53:13 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id A0E70B69; Tue, 27 May 2025 03:53:12 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 55D071643; Tue, 27 May 2025 03:49:48 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 50EC216C1; Tue, 27 May 2025 03:49: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 65E8214EF for ; Tue, 27 May 2025 03:49:22 -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-516-Sg4KWzvBPOS8eC8nEhtA8Q-1; Tue, 27 May 2025 03:49:20 -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 55F8F1800ECC for ; Tue, 27 May 2025 07:49:19 +0000 (UTC) Received: from speedmetal.lan (unknown [10.44.22.3]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8BB8D180047F for ; Tue, 27 May 2025 07:49:18 +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_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=1748332162; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WLp/o5TDbem562nkc+MbppwCP1mt+OyeGsuW5cuwgOQ=; b=H39Fw7uqm3U0eeUcr0wsdvfG8B6T9m0+CPcVEqXs818use9JU9N6lBGTSFX2I8TuBijqYI WbeeeUA4+cR74UFm2UjJOFk1LpMYohghV8c60FUGN9INBGq96zsPpZrxpNLYMpBIUsIybk sYK64TQS0v+ccYZzeSBVKFir2bU/tgU= X-MC-Unique: Sg4KWzvBPOS8eC8nEhtA8Q-1 X-Mimecast-MFC-AGG-ID: Sg4KWzvBPOS8eC8nEhtA8Q_1748332159 To: devel@lists.libvirt.org Subject: [PATCH 9/9] qemuProcessStartValidateGraphics: Move RDP validation logic to qemu_validate.c Date: Tue, 27 May 2025 09:49:05 +0200 Message-ID: <31e2d1606a6e04a7e2b1b896f1bc1bf6ed969e99.1748332058.git.pkrempa@redhat.com> In-Reply-To: References: 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: QlHB5_TqW-rkN-jF0LkkWKy2V9P1J9HR6wu4Xnn8-po_1748332159 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: ZXZU7RUWQ4QUD7XIWO3NU6LPBUIXW5GD X-Message-ID-Hash: ZXZU7RUWQ4QUD7XIWO3NU6LPBUIXW5GD X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1748332395012116600 Content-Type: text/plain; charset="utf-8" From: Peter Krempa Move the rest of the RDP graphics validation code to qemuValidateDomainDeviceDefRDPGraphics together with the rest of the validation. Signed-off-by: Peter Krempa Reviewed-by: Pavel Hrdina --- src/qemu/qemu_process.c | 54 ---------------------------------------- src/qemu/qemu_validate.c | 20 +++++++++++++-- 2 files changed, 18 insertions(+), 56 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 920adef7df..82cab3f76e 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5509,57 +5509,6 @@ qemuProcessMakeDir(virQEMUDriver *driver, } -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) -{ - size_t i; - - for (i =3D 0; i < vm->def->ngraphics; i++) { - virDomainGraphicsDef *graphics =3D vm->def->graphics[i]; - - switch (graphics->type) { - case VIR_DOMAIN_GRAPHICS_TYPE_VNC: - case VIR_DOMAIN_GRAPHICS_TYPE_SPICE: - break; - - case VIR_DOMAIN_GRAPHICS_TYPE_RDP: - 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: - case VIR_DOMAIN_GRAPHICS_TYPE_LAST: - break; - } - } - - return 0; -} - - /* 250 parts per million (ppm) is a half of NTP threshold */ #define TSC_TOLERANCE 250 @@ -5664,9 +5613,6 @@ qemuProcessStartValidate(virQEMUDriver *driver, if (virDomainDefValidate(vm->def, 0, driver->xmlopt, qemuCaps) < 0) return -1; - if (qemuProcessStartValidateGraphics(vm) < 0) - return -1; - if (vm->def->cpu) { if (virCPUValidateFeatures(vm->def->os.arch, vm->def->cpu) < 0) return -1; diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 1aa54bf59f..de391ce34d 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -4522,8 +4522,11 @@ qemuValidateDomainDeviceDefDBusGraphics(const virDom= ainGraphicsDef *graphics, static int -qemuValidateDomainDeviceDefRDPGraphics(const virDomainGraphicsDef *graphic= s) +qemuValidateDomainDeviceDefRDPGraphics(const virDomainGraphicsDef *graphic= s, + const virDomainDef *def) { + size_t i; + if (graphics->nListens > 1) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("qemu-rdp does not support multiple listens for o= ne graphics device.")); @@ -4546,6 +4549,19 @@ qemuValidateDomainDeviceDefRDPGraphics(const virDoma= inGraphicsDef *graphics) return -1; } + for (i =3D 0; i < def->ngraphics; i++) { + virDomainGraphicsDef *g =3D def->graphics[i]; + + if (g->type =3D=3D VIR_DOMAIN_GRAPHICS_TYPE_DBUS && g->data.dbus.p= 2p =3D=3D false) + break; + } + + if (i =3D=3D def->ngraphics) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("qemu-rdp support requires a D-Bus bus graphics d= evice.")); + return -1; + } + return 0; } @@ -4623,7 +4639,7 @@ qemuValidateDomainDeviceDefGraphics(const virDomainGr= aphicsDef *graphics, break; case VIR_DOMAIN_GRAPHICS_TYPE_RDP: - if (qemuValidateDomainDeviceDefRDPGraphics(graphics) < 0) + if (qemuValidateDomainDeviceDefRDPGraphics(graphics, def) < 0) return -1; break; --=20 2.49.0