From nobody Sun Feb 8 19:39:53 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; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com 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 1627560697883739.045694966679; Thu, 29 Jul 2021 05:11:37 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-140-B2yL2laBMWChQgzkqHJa8A-1; Thu, 29 Jul 2021 08:11:34 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 31E3B8799E0; Thu, 29 Jul 2021 12:11:29 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 13B3969FAD; Thu, 29 Jul 2021 12:11:29 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D1E884A7CD; Thu, 29 Jul 2021 12:11:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16TCBB42014571 for ; Thu, 29 Jul 2021 08:11:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id C1E60202BFB9; Thu, 29 Jul 2021 12:11:11 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BD5B2202C0EB for ; Thu, 29 Jul 2021 12:11:11 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A6903101A529 for ; Thu, 29 Jul 2021 12:11:11 +0000 (UTC) Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-125-33lEujvLOhC13gGkPIoodQ-1; Thu, 29 Jul 2021 08:11:09 -0400 Received: by mail-pl1-f176.google.com with SMTP id d1so6765393pll.1 for ; Thu, 29 Jul 2021 05:11:09 -0700 (PDT) Received: from localhost ([103.138.53.99]) by smtp.gmail.com with ESMTPSA id f3sm3576104pfe.123.2021.07.29.05.11.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jul 2021 05:11:07 -0700 (PDT) X-MC-Unique: B2yL2laBMWChQgzkqHJa8A-1 X-MC-Unique: 33lEujvLOhC13gGkPIoodQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YCE44wp0Cs3IaRKLqHdPK0AVf+2u+4NxXKESwwPP0AY=; b=hzUSIpuKFNsCvGi71Bd6oqjIwuY1ubRI2zBSZqNKnw3rSINBgHNXBgd1rLFVbLsl9L PWrG9iqq4eR5Yf4F29cIGFHCVrPMuSTKlLqI9mbz9IiPaDL0Kc+LUleGF6Ci1/Xv+wXI ckK6VctqTnUthoaKH6tMWzN6wWNTIvYelJbhlfTG5vHhXbt//hL++1VcRQv8iTP066V3 2xWr/xU8pTEu5Ht3yiHCmGOqmuJKo1lGt2VtJ0tCwOEZR7UoH5/nzt35oQNNU1QCM1Dp 4kMeOHyaF8gFKpHVMJJ5F2R7mg66Gz7JaNAcWe2yyQzMUoe0e3SpLF50HF+OKfO+20zT oORg== X-Gm-Message-State: AOAM5308CuwV0q9zYLRg6wh8CIIZgutLmOkcKiWlPxSyvJp1qI3Vxcxi P7U4TDodqspXOY2H7Pjtli8vJx5XEUFvxDVRD7iBZA== X-Google-Smtp-Source: ABdhPJyg78H5/z8jAnQLDf+DbcfXV0pCN/AakHIgpHU1rQeeFtnNW2tXFVpOnsNolJYlKr68cMoExg== X-Received: by 2002:aa7:9a08:0:b029:331:ea96:691d with SMTP id w8-20020aa79a080000b0290331ea96691dmr4665074pfj.75.1627560668290; Thu, 29 Jul 2021 05:11:08 -0700 (PDT) From: Luke Yue To: libvir-list@redhat.com Subject: [PATCH v2 02/11] test_driver: Introduce testIOThreadInfo and generate IOThread infos Date: Thu, 29 Jul 2021 20:10:49 +0800 Message-Id: <20210729121058.454431-3-lukedyue@gmail.com> In-Reply-To: <20210729121058.454431-1-lukedyue@gmail.com> References: <20210729121058.454431-1-lukedyue@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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-ZM-MESSAGEID: 1627560699061100004 Content-Type: text/plain; charset="utf-8" Introduce testIOThreadInfo to store IOThread infos: iothread_id, poll_max_ns, poll_grow and poll_shrink for future usage. Add an example of IOThread configuration to testdomfc4.xml, we also want to generate default testIOThreadInfo for the IOThread configured in the xml, so introduce testDomainGenerateIOThreadInfos, the values are taken from QEMU. Signed-off-by: Luke Yue --- examples/xml/test/testdomfc4.xml | 5 +++++ src/test/test_driver.c | 37 ++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/examples/xml/test/testdomfc4.xml b/examples/xml/test/testdomfc= 4.xml index 26b7f25a06..cb4dd0cf70 100644 --- a/examples/xml/test/testdomfc4.xml +++ b/examples/xml/test/testdomfc4.xml @@ -11,6 +11,11 @@ 261072 131072 1 + 2 + + + + diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 892dc978f2..7d9a81de54 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -182,6 +182,14 @@ struct _testDomainNamespaceDef { xmlNodePtr *snap_nodes; }; =20 +typedef struct _testIOThreadInfo testIOThreadInfo; +struct _testIOThreadInfo { + unsigned int iothread_id; + unsigned long long poll_max_ns; + unsigned int poll_grow; + unsigned int poll_shrink; +}; + static void testDomainDefNamespaceFree(void *data) { @@ -380,6 +388,9 @@ struct _testDomainObjPrivate { /* used by get/set time APIs */ long long seconds; unsigned int nseconds; + + /* used by IOThread APIs */ + GArray *iothreads; }; =20 =20 @@ -396,6 +407,8 @@ testDomainObjPrivateAlloc(void *opaque) priv->seconds =3D 627319920; priv->nseconds =3D 0; =20 + priv->iothreads =3D g_array_new(FALSE, FALSE, sizeof(testIOThreadInfo)= ); + return priv; } =20 @@ -426,6 +439,8 @@ static void testDomainObjPrivateFree(void *data) { testDomainObjPrivate *priv =3D data; + + g_array_free(priv->iothreads, TRUE); g_free(priv); } =20 @@ -695,6 +710,26 @@ testDomainGenerateIfnames(virDomainDef *domdef) return 0; } =20 +static void +testDomainGenerateIOThreadInfos(virDomainObj *obj) +{ + size_t i; + testDomainObjPrivate *priv; + + if (!obj->def->iothreadids || !obj->def->niothreadids) + return; + + priv =3D obj->privateData; + + for (i =3D 0; i < obj->def->niothreadids; i++) { + testIOThreadInfo iothread; + iothread.iothread_id =3D obj->def->iothreadids[i]->iothread_id; + iothread.poll_max_ns =3D 32768; + iothread.poll_grow =3D 0; + iothread.poll_shrink =3D 0; + g_array_append_val(priv->iothreads, iothread); + } +} =20 static void testDomainShutdownState(virDomainPtr domain, @@ -968,6 +1003,8 @@ testParseDomains(testDriver *privconn, } virDomainObjSetState(obj, nsdata->runstate, 0); =20 + testDomainGenerateIOThreadInfos(obj); + virDomainObjEndAPI(&obj); } =20 --=20 2.32.0