From nobody Sat Feb 7 07:12:00 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=1654697102; cv=none; d=zohomail.com; s=zohoarc; b=RqMtXNXmVfX1Oi4Cwz+a5LSXd4idRH1ffMVoLJbZTOpZOZw1Z4/PE1H3ZYhZRoXz1nD1RvZae30vIJY/jxbLvmeErT02SliZfaYh6LZ9SGwcb0Fc1/YAEdzVmFRCc2gDVMUR/XRJoFUL8g/5Xezd++kgB67ozjVf/BScXgNlJUo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654697102; 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=KP+Pzq2gWm9sqLgWTHixguVFJmtB+aJoV1HfoNp5W/8=; b=UiHHyfHa4hCLjtSY2J9E8IjhNkq9+YE4K6GXeGEo0b0tfFtQBuoqCf4aVvfOGAONmdgpa98w4qOyPBDyRYwdfizYL+PoSfta8dFgHvaWexN8uvp+qbHUbumC1Qk3dlS0jkQGkeAiafMjqnhBtCx5ByUrdAX9oyKFpJtUkNYn2TE= 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 1654697102699350.8493936153759; Wed, 8 Jun 2022 07:05:02 -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-487-XsDaOA8RNluwMkiWXTi5qg-1; Wed, 08 Jun 2022 10:04:59 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F2472803B22; Wed, 8 Jun 2022 14:04:56 +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 DF1494328C9; Wed, 8 Jun 2022 14:04:56 +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 9B7921947041; Wed, 8 Jun 2022 14:04:56 +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 423D81947040 for ; Wed, 8 Jun 2022 13:43:18 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 3140A492CA3; Wed, 8 Jun 2022 13:43:18 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id CD9B0492C3B for ; Wed, 8 Jun 2022 13:43:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654697101; 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=KP+Pzq2gWm9sqLgWTHixguVFJmtB+aJoV1HfoNp5W/8=; b=Zvvo3p9HN7tIhqHQlzPg+UcK9bK/ARXOnpJCzzAGZw+8Jd6ACRYFyqPBRe8KFnPILAz6yI Lun1OQmwMuzwhI0mHfwrxtou1qEWx/ywgjxZRTIBBCVEKuoV0gJrdrwFO7b0OSxf4685Iu FeN7e5ZOTQd0ebucTh72YBbjoOtfRMw= X-MC-Unique: XsDaOA8RNluwMkiWXTi5qg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v3 12/15] virsh: Wire up new virDomainSetIOThreadParams parameters Date: Wed, 8 Jun 2022 15:43:06 +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.85 on 10.11.54.10 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: 1654697104725100002 Content-Type: text/plain; charset="utf-8"; x-default="true" Since virsh implements a wrapper over virDomainSetIOThreadParams() (command iothreadset) let's wire up new typed parameters there too. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- docs/manpages/virsh.rst | 13 ++++++++++++- tools/virsh-domain.c | 24 +++++++++++++++++++++++- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index faac996536..580245adb1 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -2999,7 +2999,8 @@ iothreadset :: =20 iothreadset domain iothread_id [[--poll-max-ns ns] [--poll-grow factor] - [--poll-shrink divisor]] + [--poll-shrink divisor] [--thread-pool-min value] + [--thread-pool-max value]] [[--config] [--live] | [--current]] =20 Modifies an existing iothread of the domain using the specified @@ -3016,6 +3017,16 @@ for a running guest. Saving, destroying, stopping, e= tc. the guest will result in the polling values returning to hypervisor defaults at the next start, restore, etc. =20 +The *--thread-pool-min* and *--thread-pool-max* options then set lower and +upper bound, respectively of number of threads in worker pool of given +iothread. For changes to an inactive configuration -1 can be specified to +remove corresponding boundary from the domain configuration. For changes t= o a +running guest it's recommended to set the upper boundary first +(*--thread-pool-max*) and only after that set the lower boundary +(*--thread-pool-min*). It is allowed for the lower boundary to be the same= as +the upper boundary, however it's not allowed for the upper boundary to be = value +of zero. + If *--live* is specified, affect a running guest. If the guest is not running an error is returned. If *--current* is specified or *--live* is not specified, then handle diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index cfdaac1942..06ed6ba9cf 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -7796,7 +7796,15 @@ static const vshCmdOptDef opts_iothreadset[] =3D { }, {.name =3D "poll-shrink", .type =3D VSH_OT_INT, - .help =3D N_("set the value for reduction of the IOThread polling tim= e ") + .help =3D N_("set the value for reduction of the IOThread polling tim= e") + }, + {.name =3D "thread-pool-min", + .type =3D VSH_OT_INT, + .help =3D N_("lower boundary for worker thread pool") + }, + {.name =3D "thread-pool-max", + .type =3D VSH_OT_INT, + .help =3D N_("upper boundary for worker thread pool") }, VIRSH_COMMON_OPT_DOMAIN_LIVE, VIRSH_COMMON_OPT_DOMAIN_CURRENT, @@ -7816,6 +7824,7 @@ cmdIOThreadSet(vshControl *ctl, const vshCmd *cmd) int maxparams =3D 0; unsigned long long poll_max; unsigned int poll_val; + int thread_val; int rc; =20 if (live) @@ -7853,6 +7862,19 @@ cmdIOThreadSet(vshControl *ctl, const vshCmd *cmd) =20 #undef VSH_IOTHREAD_SET_UINT_PARAMS =20 +#define VSH_IOTHREAD_SET_INT_PARAMS(opt, param) \ + thread_val =3D -1; \ + if ((rc =3D vshCommandOptInt(ctl, cmd, opt, &thread_val)) < 0) \ + goto cleanup; \ + if (rc > 0 && \ + virTypedParamsAddInt(¶ms, &nparams, &maxparams, \ + param, thread_val) < 0) \ + goto save_error; + + VSH_IOTHREAD_SET_INT_PARAMS("thread-pool-min", VIR_DOMAIN_IOTHREAD_THR= EAD_POOL_MIN) + VSH_IOTHREAD_SET_INT_PARAMS("thread-pool-max", VIR_DOMAIN_IOTHREAD_THR= EAD_POOL_MAX) +#undef VSH_IOTHREAD_SET_INT_PARAMS + if (nparams =3D=3D 0) { vshError(ctl, _("Not enough arguments passed, nothing to set")); goto cleanup; --=20 2.35.1