From nobody Mon Feb 9 08:56:21 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 163171994893095.24272842043547; Wed, 15 Sep 2021 08:32:28 -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-536-p4kN_PISNPqxnyw6_QFTew-1; Wed, 15 Sep 2021 11:31:03 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 64F961006B1D; Wed, 15 Sep 2021 15:30:58 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 196007D9C6; Wed, 15 Sep 2021 15:30:58 +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 B56C3180598A; Wed, 15 Sep 2021 15:30:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 18FFUsKV028840 for ; Wed, 15 Sep 2021 11:30:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id D267EE2A61; Wed, 15 Sep 2021 15:30:54 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CCF39DEECD for ; Wed, 15 Sep 2021 15:30:54 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (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 B4A418038E3 for ; Wed, 15 Sep 2021 15:30:54 +0000 (UTC) Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-528-YV-X7JsHMKur0_xbyFYMLA-1; Wed, 15 Sep 2021 11:30:52 -0400 Received: by mail-pg1-f169.google.com with SMTP id k24so3071585pgh.8 for ; Wed, 15 Sep 2021 08:30:52 -0700 (PDT) Received: from localhost ([103.149.249.103]) by smtp.gmail.com with ESMTPSA id k29sm304285pfp.200.2021.09.15.08.30.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Sep 2021 08:30:50 -0700 (PDT) X-MC-Unique: p4kN_PISNPqxnyw6_QFTew-1 X-MC-Unique: YV-X7JsHMKur0_xbyFYMLA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=f05S+K1UfXIJ7RYK2t6+vUSHcGsSGE0NKpgG6hLEbHo=; b=l5KjkXUGUt5kqlsuz027LtqWGdHNIQgQOUjgVAjuUsQ8YBhAuDUN6MKQjnsV9PCK9h rX1ydB7cfcJAUuGWvUekZVs08L/uEYEg3c3uzIFdrlptPTmQ3x9ZKuv7Qo6+NjSbvEIV xz90TKtRduD7cv+N0su4Cvy1ItvfGtSF0ATac/aMQDvj2n/8dbaS9+FdUppLdD8PjEw/ Og95l9EviVPzUDKZDuxHtKtc8uN58d1t0qfw49WznMWiaAvXjrwpGr7UYBS1HftVGwF8 vUv0B30YVmelcoW+Raap31CDz1qf+cLxI5dmg0wcNSSqyX6c45i5zRgBzrv9h7UTRV7O 4Low== X-Gm-Message-State: AOAM533905PXJ1BMCpXbO0Sy4T+D1Xm67RZR15LTe+MqoyLrZCLFSeP9 9M8MYoBoJNnOONajv8xSHVBSMjOHetf+KlqnX04= X-Google-Smtp-Source: ABdhPJzRzLFjoIPRWUkVyGV3fbkbZJEdKXMFXNpKtY6Mtp3McScX0h6IVrG9oHJrKthij3Tj5rGAeg== X-Received: by 2002:a63:b50d:: with SMTP id y13mr341091pge.286.1631719850849; Wed, 15 Sep 2021 08:30:50 -0700 (PDT) From: Luke Yue To: libvir-list@redhat.com Subject: [PATCH v4 02/11] test_driver: Introduce testIOThreadInfo and generate IOThread infos Date: Wed, 15 Sep 2021 23:30:23 +0800 Message-Id: <20210915153032.121221-3-lukedyue@gmail.com> In-Reply-To: <20210915153032.121221-1-lukedyue@gmail.com> References: <20210915153032.121221-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.79 on 10.11.54.5 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.13 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: 1631719949965000001 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 2c2c6f52d1..8de8779c7f 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -183,6 +183,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) { @@ -381,6 +389,9 @@ struct _testDomainObjPrivate { /* used by get/set time APIs */ long long seconds; unsigned int nseconds; + + /* used by IOThread APIs */ + GArray *iothreads; }; =20 =20 @@ -397,6 +408,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 @@ -427,6 +440,8 @@ static void testDomainObjPrivateFree(void *data) { testDomainObjPrivate *priv =3D data; + + g_array_free(priv->iothreads, TRUE); g_free(priv); } =20 @@ -696,6 +711,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, @@ -1045,6 +1080,8 @@ testParseDomains(testDriver *privconn, =20 testDomainObjCheckTaint(obj); =20 + testDomainGenerateIOThreadInfos(obj); + virDomainObjEndAPI(&obj); } =20 --=20 2.33.0