From nobody Tue Sep 9 03:20:55 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 --- 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