From nobody Sun Apr 28 22:14:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1638889127; cv=none; d=zohomail.com; s=zohoarc; b=X2NUF6CF8HcFQFueSRTy34uCyyv3xduTYtsa0mHRxyU+RK80AN3yK4hmuGTK5A4A2gTloNfe+rECjiLb0zgKgImUZXfN0vHOS1TO7KDZWIhA3fiHI15RDVwcTYMiLKM42barqGSRfqczmsJv1LuZQEs0Z3c+w3bUj6Z6lyDcuoY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1638889127; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=XxfzzscIN2Or+DW/VV9v0xMGhvE2SbmBjf3tZYZ0uvs=; b=Z0EHPFyOuTGAppAoYN0BZt9fblPI3dCvHwnjAZ4eBdamFSGrKb6i42JGE00Stm0Y/2DTQnHDU0PYnQPO1IcCFym8UIMAO3WYJfC89ykz+VIywAhRnq7+OYE6PaimN7mcOOAyWOrt4mKBiv8xYqpgBqes4WvDzxfX/MwIzydUE3k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1638889127537566.9146809955345; Tue, 7 Dec 2021 06:58:47 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-294-eT9QVsU8NQq3W2AkQ_FS0g-1; Tue, 07 Dec 2021 09:58:45 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 80060190A7CD; Tue, 7 Dec 2021 14:58:39 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 09381101E594; Tue, 7 Dec 2021 14:58:39 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 5DABD4BB7C; Tue, 7 Dec 2021 14:58:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1B7EwW29019807 for ; Tue, 7 Dec 2021 09:58:32 -0500 Received: by smtp.corp.redhat.com (Postfix) id E9E8310074FD; Tue, 7 Dec 2021 14:58:31 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4E6311002390 for ; Tue, 7 Dec 2021 14:58:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638889126; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=XxfzzscIN2Or+DW/VV9v0xMGhvE2SbmBjf3tZYZ0uvs=; b=hIu0czfFnrAXo9s7TYFwY21jKKmocyU8EQn45USYKPEQM7Ocamc225UuM48yWO4IotUoxn bZzpQj6XV+nTDe+mqkjDj0VWYyaM/S7mV9bhpRvXvv2a4WnHKtfr6XEyB89t0DSZEctukJ xj+o+tUyZuDP+cPaOhKDxiNnapNspjg= X-MC-Unique: eT9QVsU8NQq3W2AkQ_FS0g-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/2] qemuValidateDomainDeviceDefDiskFrontend: Fix error message if io='native' is unsupported Date: Tue, 7 Dec 2021 15:58:10 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1638889129287100001 Content-Type: text/plain; charset="utf-8" The error is a hard error, so the part about fallback doesn't make sense. Spell the attribute the same way as it's in XML. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_validate.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 1de6e05101..4ec3d18c52 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -2865,9 +2865,7 @@ qemuValidateDomainDeviceDefDiskFrontend(const virDoma= inDiskDef *disk, disk->cachemode !=3D VIR_DOMAIN_DISK_CACHE_DIRECTSYNC && disk->cachemode !=3D VIR_DOMAIN_DISK_CACHE_DISABLE) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("native I/O needs either no disk cache " - "or directsync cache mode, QEMU will fallback " - "to aio=3Dthreads")); + _("io=3D'native' needs either no disk cache or dire= ctsync cache mode")); return -1; } --=20 2.31.1 From nobody Sun Apr 28 22:14:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1638889174; cv=none; d=zohomail.com; s=zohoarc; b=Fq27bKHixnmQPPodPq9ANZBF4yyKgEiU2lxL4ucq5JvJ5hB+HaEXimNrirjXT6+NIggoGDNEO5Q9cgGHdcinAlDqTjOYRJQQubzZOQroB99TDtwarbRJyOJodsJMFWxJFTXXDDPIVcAONYnD4cB/8FWRGormhMId1ZoSqiznfFM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1638889174; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=1FdW1fcOHuEoWZiWbpv34u9zQeAvKlBYkMPu7QEUvWI=; b=fqHgrepZLdnUHfNseVHCXBbZv/Ij7EHExqYKbr1SkSIEtjRBgu4ze1wEcxQeLu+4HkmhbxiMjmtykIJHXbeXY+INkPcvjbLkkxpRJiCVVjMBPTyiW3ovT7KZYKrgXoeV2QqAZ+9zxOEzcMRtrrfj686IhRhBjgoxzpuxjht+F18= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1638889174181555.3375662092279; Tue, 7 Dec 2021 06:59:34 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-546-ok-l7d7LOFiS7JAutNYdog-1; Tue, 07 Dec 2021 09:59:31 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 13AC2814331; Tue, 7 Dec 2021 14:59:23 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A34175BE0A; Tue, 7 Dec 2021 14:59:22 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7398B4A7C9; Tue, 7 Dec 2021 14:59:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1B7EwdM4019827 for ; Tue, 7 Dec 2021 09:58:39 -0500 Received: by smtp.corp.redhat.com (Postfix) id C9152101E59D; Tue, 7 Dec 2021 14:58:39 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1ED1E10074FD for ; Tue, 7 Dec 2021 14:58:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638889173; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=1FdW1fcOHuEoWZiWbpv34u9zQeAvKlBYkMPu7QEUvWI=; b=bIaC7cSgTBEZGMYPRaCAjtQSAGTvQsQUjeN2bbCpu3JWp3oRbgH/LEvnMK/flMHqKI+U+A P5Xui7WJ9eZE7OuAWWv5myUDKWzCjA60gtMzw1E3R+kGaNUO9V/CManCO39rIcR+rM9QIs IgHIl27ov48Zule2gnB8Epa3J7nOBB4= X-MC-Unique: ok-l7d7LOFiS7JAutNYdog-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/2] qemuValidateDomainDeviceDefDiskFrontend: Aggregate disk iomode validation Date: Tue, 7 Dec 2021 15:58:11 +0100 Message-Id: <1a6a8b79508d47efeb2336c5a355caf1bc47d1c5.1638889059.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1638889176018100001 Content-Type: text/plain; charset="utf-8" Move the two checks under a common block and fix error messages. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_validate.c | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 4ec3d18c52..29b01495ad 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -2861,12 +2861,28 @@ qemuValidateDomainDeviceDefDiskFrontend(const virDo= mainDiskDef *disk, } } - if (disk->iomode =3D=3D VIR_DOMAIN_DISK_IO_NATIVE && - disk->cachemode !=3D VIR_DOMAIN_DISK_CACHE_DIRECTSYNC && - disk->cachemode !=3D VIR_DOMAIN_DISK_CACHE_DISABLE) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("io=3D'native' needs either no disk cache or dire= ctsync cache mode")); - return -1; + switch (disk->iomode) { + case VIR_DOMAIN_DISK_IO_NATIVE: + if (disk->cachemode !=3D VIR_DOMAIN_DISK_CACHE_DIRECTSYNC && + disk->cachemode !=3D VIR_DOMAIN_DISK_CACHE_DISABLE) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("io=3D'native' needs either no disk cache or = directsync cache mode")); + return -1; + } + break; + + case VIR_DOMAIN_DISK_IO_URING: + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_AIO_IO_URING)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("io uring is not supported by this QEMU binar= y")); + return -1; + } + break; + + case VIR_DOMAIN_DISK_IO_THREADS: + case VIR_DOMAIN_DISK_IO_DEFAULT: + case VIR_DOMAIN_DISK_IO_LAST: + break; } if (disk->serial && @@ -2892,14 +2908,6 @@ qemuValidateDomainDeviceDefDiskFrontend(const virDom= ainDiskDef *disk, return -1; } - if (disk->iomode =3D=3D VIR_DOMAIN_DISK_IO_URING) { - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_AIO_IO_URING)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("io uring is not supported by this QEMU binar= y")); - return -1; - } - } - if (disk->serial && qemuValidateDomainDeviceDefDiskSerial(disk->serial) < 0) return -1; --=20 2.31.1