From nobody Mon Feb 9 16:35:12 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=1681907022; cv=none; d=zohomail.com; s=zohoarc; b=YR8T2OBK4wrb4rv7Z3F5feSM4yTTUZzrmYKGeomMiXlRQZ4oOWp8XU+fDQp5vDxsM5CBLz8vTINd9FXAcEKsg6MCbN1sIV8tvBb/5eMIQu9LfP+BNva7H5a5u9Nx9hlbygK5qRZzROWAc2BgPEAfQ3UkkgpNNGQH823CX9PkvSQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681907022; 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=dSByu7q2Ebpuni7w8e78PAUecpqoyVJwg8mFKv8TKps=; b=WayFnjEY9x7VGITteCzJxbpy2ivycasW+PCc3wW2RuDZgA8J12gLJ5i/+8tsPRTlKKYs3x+uO+yU/tA0NTgt0qsE98scbENSsEMGBphEeZZIz/ALlmPdOqAWspNHDhAvzvDopLs/aQLjTJ8bXUrnpjbQ9eQ+8iVT+S27RqRoWR8= 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 1681907022249920.2553929819367; Wed, 19 Apr 2023 05:23:42 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-320-x_Z8GIZ3N3OSChEy2qRwdg-1; Wed, 19 Apr 2023 08:23:38 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5CE701C08973; Wed, 19 Apr 2023 12:23:35 +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 44EC92166B44; Wed, 19 Apr 2023 12:23:35 +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 6889119465B3; Wed, 19 Apr 2023 12:23:34 +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 8413719465A0 for ; Wed, 19 Apr 2023 12:05:06 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 67BFE492B05; Wed, 19 Apr 2023 12:05:06 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id D792B492B04 for ; Wed, 19 Apr 2023 12:05:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681907021; 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=dSByu7q2Ebpuni7w8e78PAUecpqoyVJwg8mFKv8TKps=; b=XrU9FQIOHUVdlaBrTytqCMgl6ig/wRBD7gNedo2xvzpPWlRtcxc9Cu+Oan43340KFaa2Te HnjQNVMwHVwjLQMuCXhAB52J1tjP4vgF55tb3W4whfQbT1egPauXvdb0kqWjwvViiY4E+Y lUU5IBlFuFPCdvp0LzQ7buIj2jdrixA= X-MC-Unique: x_Z8GIZ3N3OSChEy2qRwdg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH v3 25/25] qemu: Use configured iothread poll parameters on startup Date: Wed, 19 Apr 2023 14:04:42 +0200 Message-Id: <0eb1a9aa652c4f5b344840572a2f24aadbe962ef.1681905482.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 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 3.1 on 10.11.54.6 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: 1681907023608100001 Content-Type: text/plain; charset="utf-8" Implement the support for the persisted poll parameters and remove restrictions on saving config when modifying them during runtime. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 18 +++++++++++ src/qemu/qemu_driver.c | 30 ++++++++++--------- ...othreads-ids-pool-sizes.x86_64-latest.args | 6 ++-- 3 files changed, 37 insertions(+), 17 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 4ca93bf3dc..f5b1971f07 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7298,6 +7298,24 @@ qemuBuildIOThreadCommandLine(virCommand *cmd, NULL) < 0) return -1; + if (iothread->set_poll_max_ns && + virJSONValueObjectAdd(&props, + "U:poll-max-ns", iothread->poll_max_ns, + NULL) < 0) + return -1; + + if (iothread->set_poll_grow && + virJSONValueObjectAdd(&props, + "U:poll-grow", iothread->poll_grow, + NULL) < 0) + return -1; + + if (iothread->set_poll_shrink && + virJSONValueObjectAdd(&props, + "U:poll-shrink", iothread->poll_shrink, + NULL) < 0) + return -1; + if (qemuBuildObjectCommandlineFromJSON(cmd, props, qemuCaps) < 0) return -1; } diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index dafe8af8a6..1917e7e079 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -5067,23 +5067,30 @@ qemuDomainHotplugModIOThread(virDomainObj *vm, } -static int +static void qemuDomainHotplugModIOThreadIDDef(virDomainIOThreadIDDef *def, qemuMonitorIOThreadInfo mondef) { - /* These have no representation in domain XML */ - if (mondef.set_poll_grow || - mondef.set_poll_max_ns || - mondef.set_poll_shrink) - return -1; + if (mondef.set_poll_max_ns) { + def->poll_max_ns =3D mondef.poll_max_ns; + def->set_poll_max_ns =3D true; + } + + if (mondef.set_poll_grow) { + def->poll_grow =3D mondef.poll_grow; + def->set_poll_grow =3D true; + } + + if (mondef.set_poll_shrink) { + def->poll_shrink =3D mondef.poll_shrink; + def->set_poll_shrink =3D true; + } if (mondef.set_thread_pool_min) def->thread_pool_min =3D mondef.thread_pool_min; if (mondef.set_thread_pool_max) def->thread_pool_max =3D mondef.thread_pool_max; - - return 0; } @@ -5380,12 +5387,7 @@ qemuDomainChgIOThread(virQEMUDriver *driver, if (qemuDomainIOThreadValidate(iothreaddef, iothread, false) <= 0) goto endjob; - if (qemuDomainHotplugModIOThreadIDDef(iothreaddef, iothread) <= 0) { - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", - _("configuring persistent polling values is= not supported")); - goto endjob; - } - + qemuDomainHotplugModIOThreadIDDef(iothreaddef, iothread); break; } } diff --git a/tests/qemuxml2argvdata/iothreads-ids-pool-sizes.x86_64-latest.= args b/tests/qemuxml2argvdata/iothreads-ids-pool-sizes.x86_64-latest.args index 4f5a11aab1..1422e94e35 100644 --- a/tests/qemuxml2argvdata/iothreads-ids-pool-sizes.x86_64-latest.args +++ b/tests/qemuxml2argvdata/iothreads-ids-pool-sizes.x86_64-latest.args @@ -18,9 +18,9 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -overcommit mem-lock=3Doff \ -smp 6,sockets=3D6,cores=3D1,threads=3D1 \ -object '{"qom-type":"iothread","id":"iothread2","thread-pool-min":0,"thre= ad-pool-max":60}' \ --object '{"qom-type":"iothread","id":"iothread4","thread-pool-min":1,"thre= ad-pool-max":1}' \ --object '{"qom-type":"iothread","id":"iothread1"}' \ --object '{"qom-type":"iothread","id":"iothread3"}' \ +-object '{"qom-type":"iothread","id":"iothread4","thread-pool-min":1,"thre= ad-pool-max":1,"poll-max-ns":123}' \ +-object '{"qom-type":"iothread","id":"iothread1","poll-grow":456,"poll-shr= ink":789}' \ +-object '{"qom-type":"iothread","id":"iothread3","poll-max-ns":123000,"pol= l-grow":456,"poll-shrink":789}' \ -object '{"qom-type":"iothread","id":"iothread5"}' \ -object '{"qom-type":"main-loop","id":"main-loop","thread-pool-min":8,"thr= ead-pool-max":16}' \ -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ --=20 2.39.2