From nobody Sat Feb 7 04:40:43 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1654697328; cv=none; d=zohomail.com; s=zohoarc; b=MApxF55xSqinJBbh0JiSdlwh+GVul0TPvaZ9nL5vIhBlSRK597L8Fw8lAhOh/c6tdulV/hx8B2Pe/sxksdVJaSTETCj2gkiD9+7zVCc50SUf/6BM8kld9ThNUKJxECVwP5XpjC8fV4UM+luivgZdYbtqzUl2HCKM6g7/Udrvv+w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654697328; 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=4JuUHdkqhtT0DGNtjcI+Dys7yIURrz+EyeBain7/kYc=; b=geAGFka7HsvO3CrWxNa71BzyTfYJPlxZmyxQN16bk6PbB9fr1j0ytKCuRcqKdQlPHywtaVDbghbrC/iicjSyb5lhpEYPS9V+ogmb0ZKLEubJJ6rWJqauKZuINir48E51paUEHpMfFOzTcbvrIV1g/A+95m9zKQ0WgND+y7l7kTI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1654697328947658.9713176002907; Wed, 8 Jun 2022 07:08:48 -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-629-mhQtQHO9OY-CyyEjg1VNUg-1; Wed, 08 Jun 2022 10:08:43 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CD5551066688; Wed, 8 Jun 2022 14:08:36 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id AB96640E80E8; Wed, 8 Jun 2022 14:08:36 +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 1923D194705B; Wed, 8 Jun 2022 14:08:36 +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 723691947040 for ; Wed, 8 Jun 2022 13:43:19 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 5ECFB492CA3; Wed, 8 Jun 2022 13:43:19 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 07667492C3B for ; Wed, 8 Jun 2022 13:43:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654697327; 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=4JuUHdkqhtT0DGNtjcI+Dys7yIURrz+EyeBain7/kYc=; b=A0yJFQCp+TCmFF8wke0NJ4u90xBv09DIH1wwBgo5kk7MCBPx8eZLIwpAQM1XAD/KFdqhFv AP5bFozfmrtZyOFppg9zGmvQC1eW1l8i/i9RpvUKoLTXwtxcKmhLIyI9xHF5rH95iTZ3JO RkURn8iXXhYONmNk4NkxMipyoxcj3sA= X-MC-Unique: mhQtQHO9OY-CyyEjg1VNUg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v3 14/15] qemu_validate: Check if QEMU's capable of setting pool size Date: Wed, 8 Jun 2022 15:43:08 +0200 Message-Id: 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.84 on 10.11.54.2 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: 1654697330691100002 Content-Type: text/plain; charset="utf-8"; x-default="true" Since the main-loop and iothread classes are derived from the same class (EventLoopBaseClass) we don't need new capability and can use QEMU_CAPS_IOTHREAD_THREAD_POOL_MAX directly to check whether QEMU's capable of setting defaultiothread pool size. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/qemu/qemu_validate.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 7d11ae2c92..654850f925 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -389,18 +389,30 @@ qemuValidateDomainDefIOThreads(const virDomainDef *de= f, virQEMUCaps *qemuCaps) { size_t i; + bool needsThreadPoolCap =3D false; =20 for (i =3D 0; i < def->niothreadids; i++) { virDomainIOThreadIDDef *iothread =3D def->iothreadids[i]; =20 - 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; + if (iothread->thread_pool_min !=3D -1 || iothread->thread_pool_max= !=3D -1) { + needsThreadPoolCap =3D true; + break; } } =20 + if (def->defaultIOThread && + (def->defaultIOThread->thread_pool_min >=3D 0 || + def->defaultIOThread->thread_pool_max >=3D 0)) { + needsThreadPoolCap =3D true; + } + + if (needsThreadPoolCap && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_IOTHREAD_THREAD_POOL_MAX)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("thread_pool_min and thread_pool_max is not suppo= rted by this QEMU binary")); + return -1; + } + return 0; } =20 --=20 2.35.1