From nobody Sun Feb 8 22:06: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; 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 1627560710163898.4539187092358; Thu, 29 Jul 2021 05:11:50 -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-424-gl-D0eRvNK27kaKj8NcShQ-1; Thu, 29 Jul 2021 08:11:47 -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 73B8B1084F4B; Thu, 29 Jul 2021 12:11:42 +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 58FC860843; Thu, 29 Jul 2021 12:11:42 +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 23528181A2AC; Thu, 29 Jul 2021 12:11:42 +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 16TCBZXK014756 for ; Thu, 29 Jul 2021 08:11:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id DC798113B5F; Thu, 29 Jul 2021 12:11:35 +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 D7A5C10FADA for ; Thu, 29 Jul 2021 12:11:35 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (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 C0AEB1066682 for ; Thu, 29 Jul 2021 12:11:35 +0000 (UTC) Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-472-Ugaiheo_OE-YFJspGq5MNA-1; Thu, 29 Jul 2021 08:11:33 -0400 Received: by mail-pj1-f49.google.com with SMTP id ds11-20020a17090b08cbb0290172f971883bso15337398pjb.1 for ; Thu, 29 Jul 2021 05:11:32 -0700 (PDT) Received: from localhost ([103.138.53.99]) by smtp.gmail.com with ESMTPSA id b6sm9724786pjl.17.2021.07.29.05.11.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jul 2021 05:11:31 -0700 (PDT) X-MC-Unique: gl-D0eRvNK27kaKj8NcShQ-1 X-MC-Unique: Ugaiheo_OE-YFJspGq5MNA-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=bS5D99Z03SQXwEW+xgomOFBFhm6+deEJn9aIBUfPrO8=; b=N+XrCxILCdMHIWNR2Jf7l2mrfleWdTELckE7efFJG86vDhtN4mwVxAmbhtWLgNz7We SSuGeA4k7PYCfuXSFbcYoY6RxC0tQcxm9hLnxbGJZyTbIM3Nx1NbfBCBj2XRw3y1hjzz gzzkxQ8JZ0OPP3PnwEG+Tg0Nr+/crDdTpwa7BSUEC2iCshbvV9lpzxVPXfeNWDG/a0F0 8Y9lXdRFbAOe/zSwnAsWofCc7u6+e1/obCFWb2HEicyEhzQd4cd+mdTa9QXjKiwyVydK FjRfOkamu+fdru0P028NfKgmctWny8Ci4s3q64HrjNoBxnTZ66DRrJFzsTWbleXGwkqr 7/Hw== X-Gm-Message-State: AOAM530Gx+3kFGIOVLjfMPdbYZoI/B/F8jXRGnWKjoo8UsT9HPWLbTBz szA6+KAz7E+7+8QXWO4OInpT4GzJuID0KohwwshAtA== X-Google-Smtp-Source: ABdhPJxsIbEfFT7b2QVOjSkp18lTJ8RdqiDazLq5UDezXW6mYH6g8DRgkO3WDGYSTQBYtIuQEFmUYA== X-Received: by 2002:a62:7b86:0:b029:32b:364a:e7e4 with SMTP id w128-20020a627b860000b029032b364ae7e4mr4802013pfc.49.1627560691892; Thu, 29 Jul 2021 05:11:31 -0700 (PDT) From: Luke Yue To: libvir-list@redhat.com Subject: [PATCH v2 10/11] test_driver: Introduce testDomainGetStatsIOThread Date: Thu, 29 Jul 2021 20:10:57 +0800 Message-Id: <20210729121058.454431-11-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.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: 1627560710532100003 Content-Type: text/plain; charset="utf-8" Introduce testDomainGetStatsIOThread to add support for testConnectGetAllDomainStats to get IOThread infos. Signed-off-by: Luke Yue --- src/test/test_driver.c | 44 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 5da7f23a9b..24f6062b42 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -9696,6 +9696,46 @@ testDomainGetStatsState(virDomainObj *dom, return 0; } =20 +static int +testDomainGetStatsIOThread(virDomainObj *dom, + virTypedParamList *params) +{ + testDomainObjPrivate *priv =3D dom->privateData; + size_t i; + int niothreads =3D 0; + + if (!virDomainObjIsActive(dom)) + return 0; + + niothreads =3D priv->iothreads->len; + + if (niothreads =3D=3D 0) { + return 0; + } + + if (virTypedParamListAddUInt(params, niothreads, "iothread.count") < 0) + return -1; + + for (i =3D 0; i < niothreads; i++) { + testIOThreadInfo iothread =3D g_array_index(priv->iothreads, + testIOThreadInfo, i); + if (virTypedParamListAddULLong(params, iothread.poll_max_ns, + "iothread.%u.poll-max-ns", + iothread.iothread_id) < 0) + return -1; + if (virTypedParamListAddUInt(params, iothread.poll_grow, + "iothread.%u.poll-grow", + iothread.iothread_id) < 0) + return -1; + if (virTypedParamListAddUInt(params, iothread.poll_shrink, + "iothread.%u.poll-shrink", + iothread.iothread_id) < 0) + return -1; + } + + return 0; +} + typedef int (*testDomainGetStatsFunc)(virDomainObj *dom, virTypedParamList *list); @@ -9707,6 +9747,7 @@ struct testDomainGetStatsWorker { =20 static struct testDomainGetStatsWorker testDomainGetStatsWorkers[] =3D { { testDomainGetStatsState, VIR_DOMAIN_STATS_STATE }, + { testDomainGetStatsIOThread, VIR_DOMAIN_STATS_IOTHREAD }, { NULL, 0 } }; =20 @@ -9753,7 +9794,8 @@ testConnectGetAllDomainStats(virConnectPtr conn, VIR_CONNECT_LIST_DOMAINS_FILTERS_PERSIS= TENT | VIR_CONNECT_LIST_DOMAINS_FILTERS_STATE); =20 - unsigned int supported =3D VIR_DOMAIN_STATS_STATE; + unsigned int supported =3D VIR_DOMAIN_STATS_STATE | + VIR_DOMAIN_STATS_IOTHREAD; virDomainObj **vms =3D NULL; size_t nvms; virDomainStatsRecordPtr *tmpstats =3D NULL; --=20 2.32.0