From nobody Mon Feb 9 15:45:47 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=1654154357; cv=none; d=zohomail.com; s=zohoarc; b=d3L7hMikWODW+wAahm+1rxh1EUe7jw21oSYy0QwsGw+UkiwOL5+Vf7yCH+FkGEByGvJ1xe/nrfUf5Q/8gjY+S7Op/fkpBI2J8ZS9YjSEl2Qe6b7KUVuNljrYgh8QXwdN032MtEaepv3XW72LkRrNDNrprjBRwOy89nx+E9PYhbc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654154357; 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=pixasDHr2PNU64leXCozXb3KZ7/tXtT9voTZ81l7oK4=; b=CQjRxPt5JV3MDzoNSTRPX+veQL18qpDZzzCo3wOmNlxHP1pNqNA2Dz3GSkcHWqlXox+yjVatVSOFZZVZBZW33gihPB92K5GM9k+pYhwWriMVazsFXdW2cjeeYYLD6oTsn6aO1vm3kpSO7kzFM7X4uWZr/hPAa/LsbB9vns1K+rQ= 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 1654154357433772.4920447799591; Thu, 2 Jun 2022 00:19:17 -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-240-1nyFs3krOpaTzWePGLHI7w-1; Thu, 02 Jun 2022 03:18: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 48AE310666A6; Thu, 2 Jun 2022 07:18:22 +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 300691121314; Thu, 2 Jun 2022 07:18:22 +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 A271D1954F5E; Thu, 2 Jun 2022 07:18:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 1AC7C1947B83 for ; Thu, 2 Jun 2022 07:18:20 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id F3A9B2166B26; Thu, 2 Jun 2022 07:18:19 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6AB422166B2C for ; Thu, 2 Jun 2022 07:18:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654154356; 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=pixasDHr2PNU64leXCozXb3KZ7/tXtT9voTZ81l7oK4=; b=bOEzCEhsuE1RrCBOYjr2JC/DjBUiItCeCIcZl3dJ+D++5sO7ap5NTXZzPE6Wa+tqSk4iQT SU8bKD7TZpwXsIjWeggf73wEo3GAWE7dNU6iWJejkvaP+ax7fv40OrN0XTxtnMG+VEKzPj NnC86Ky2X2jgS/2u54uOSbRYEJQhenI= X-MC-Unique: 1nyFs3krOpaTzWePGLHI7w-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 13/16] virsh: Wire up new virDomainSetIOThreadParams parameters Date: Thu, 2 Jun 2022 09:18:03 +0200 Message-Id: <29c961ad5cde04e35ff8d0b0f841e87a0cf80d2f.1654154053.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 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: 1654154358933100002 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 | 7 ++++++- tools/virsh-domain.c | 24 +++++++++++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index 965b89c99d..8c066c9176 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -2993,7 +2993,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 @@ -3010,6 +3011,10 @@ 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. + 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 bac4cc0fb6..f652695c2d 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -7782,7 +7782,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, @@ -7802,6 +7810,7 @@ cmdIOThreadSet(vshControl *ctl, const vshCmd *cmd) int maxparams =3D 0; unsigned long long poll_max; unsigned int poll_val; + long long thread_val; int rc; =20 if (live) @@ -7839,6 +7848,19 @@ cmdIOThreadSet(vshControl *ctl, const vshCmd *cmd) =20 #undef VSH_IOTHREAD_SET_UINT_PARAMS =20 +#define VSH_IOTHREAD_SET_LLONG_PARAMS(opt, param) \ + thread_val =3D -1; \ + if ((rc =3D vshCommandOptLongLong(ctl, cmd, opt, &thread_val)) < 0) \ + goto cleanup; \ + if (rc > 0 && \ + virTypedParamsAddLLong(¶ms, &nparams, &maxparams, \ + param, thread_val) < 0) \ + goto save_error; + + VSH_IOTHREAD_SET_LLONG_PARAMS("thread-pool-min", VIR_DOMAIN_IOTHREAD_T= HREAD_POOL_MIN) + VSH_IOTHREAD_SET_LLONG_PARAMS("thread-pool-max", VIR_DOMAIN_IOTHREAD_T= HREAD_POOL_MAX) +#undef VSH_IOTHREAD_SET_LLONG_PARAMS + if (virDomainSetIOThreadParams(dom, id, params, nparams, flags) < 0) goto cleanup; =20 --=20 2.35.1