From nobody Sat Feb 7 04:40:36 2026 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=1654696650; cv=none; d=zohomail.com; s=zohoarc; b=E9Xm0W0qKFXfAk1HSaNZkFNlxeKBR19G8r/r5TRIZGCrJ4uanYJve/P0ShUCSZhj8Bd5zDFJVkj9asIOerUjBAUsN6qBNHh9QQu2BgXHyU19I2++2z93JfI/hL9PS0iTZTfdy1PgtdZ7agCkmAVD4TFJGU4S9qtPz6Sved5imxY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654696650; 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=9e5JiVJnLmKNPC/Gum94uWg78nSRKgqnH7QgkrudgMU=; b=Thq18cpiCFzjBqT7Id6ajqc293D6nzehaOzVCKbXmlfzVNRkB0kaaEXE27EU4EE9YgdojTVEh6XyfID73p8SP4rSw/n1WPaSHOACLB/dm1WXuIXESSL8WzU8NVK96VqcNR3ul4iT0QhJWqAut/P6RCnLK58rFggYZy+Wwhvo+Ng= 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 1654696650290916.8149064073848; Wed, 8 Jun 2022 06:57:30 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-444-XmlvGiSaM_iB5vKpiu5WPA-1; Wed, 08 Jun 2022 09:57:25 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7B573101E986; Wed, 8 Jun 2022 13:57:23 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 671CA1121315; Wed, 8 Jun 2022 13:57:23 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 1A2741947B92; Wed, 8 Jun 2022 13:57:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D61EB1947040 for ; Wed, 8 Jun 2022 13:43:15 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id C9CE2492CA3; Wed, 8 Jun 2022 13:43:15 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 721AF492C3B for ; Wed, 8 Jun 2022 13:43:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654696649; 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=9e5JiVJnLmKNPC/Gum94uWg78nSRKgqnH7QgkrudgMU=; b=f3s3+hNy75tltgG1gsi7MOr4UDpqmGGcVTnDqQm21K2pvjH8ReD86QgT9IHjXu9Z2Fe4N7 egR4UB8ZhsplQEewThx839eWMo4dj99nn62L/mNqPW4RN0sH93+vOmBZ2Vqw7Q+ArzdhBD WNsxFCGsn1RUlv71T+YMK/EiX0r/STs= X-MC-Unique: XmlvGiSaM_iB5vKpiu5WPA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v3 08/15] qemu_validate: Check if QEMU's capable of setting iothread pool size Date: Wed, 8 Jun 2022 15:43:02 +0200 Message-Id: <5ccbe368acef4072a1da0c6534a37e70b070192b.1654695585.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 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: 1654696651421100003 Content-Type: text/plain; charset="utf-8"; x-default="true" Now that we have a capability that reflects whether QEMU is capable of setting iothread pool size, let's introduce a validator check to make sure users are not trying to use this feature with QEMU that doesn't support it. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/qemu/qemu_validate.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 9b6245e6d7..7d11ae2c92 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -384,6 +384,27 @@ qemuValidateDomainDefCpu(virQEMUDriver *driver, } =20 =20 +static int +qemuValidateDomainDefIOThreads(const virDomainDef *def, + virQEMUCaps *qemuCaps) +{ + size_t i; + + for (i =3D 0; i < def->niothreadids; i++) { + virDomainIOThreadIDDef *iothread =3D def->iothreadids[i]; + + if ((iothread->thread_pool_min !=3D -1 || iothread->thread_pool_ma= x !=3D -1) && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_IOTHREAD_THREAD_POOL_MAX))= { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("thread_pool_min and thread_pool_max is not s= upported by this QEMU binary")); + return -1; + } + } + + return 0; +} + + static int qemuValidateDomainDefClockTimers(const virDomainDef *def, virQEMUCaps *qemuCaps) @@ -1168,6 +1189,9 @@ qemuValidateDomainDef(const virDomainDef *def, if (qemuDomainDefValidateMemoryHotplug(def, NULL) < 0) return -1; =20 + if (qemuValidateDomainDefIOThreads(def, qemuCaps) < 0) + return -1; + if (qemuValidateDomainDefClockTimers(def, qemuCaps) < 0) return -1; =20 --=20 2.35.1