From nobody Tue Feb 10 03:57:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1628765837731331.63925649045837; Thu, 12 Aug 2021 03:57:17 -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-371-bTLCwDUbMD-YRoClLQ0jBg-1; Thu, 12 Aug 2021 06:57:15 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 127861082924; Thu, 12 Aug 2021 10:57:09 +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 8D45518032; Thu, 12 Aug 2021 10:57:08 +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 6CA974BB7C; Thu, 12 Aug 2021 10:57:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17CAoisB015251 for ; Thu, 12 Aug 2021 06:50:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 57A44208DDB6; Thu, 12 Aug 2021 10:50:44 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 52D61208DDA5 for ; Thu, 12 Aug 2021 10:50:41 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.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 DA23D18A01A9 for ; Thu, 12 Aug 2021 10:50:41 +0000 (UTC) Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-439-4gqs5JbdNQuGY9mULkkJJQ-1; Thu, 12 Aug 2021 06:50:40 -0400 Received: by mail-pl1-f170.google.com with SMTP id t3so6733840plg.9 for ; Thu, 12 Aug 2021 03:50:39 -0700 (PDT) Received: from localhost ([38.94.109.214]) by smtp.gmail.com with ESMTPSA id j5sm3198994pgg.41.2021.08.12.03.50.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Aug 2021 03:50:38 -0700 (PDT) X-MC-Unique: bTLCwDUbMD-YRoClLQ0jBg-1 X-MC-Unique: 4gqs5JbdNQuGY9mULkkJJQ-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=rTpDw2Pi84JmU5gklDy2GDJI9l/IXO3nY9Mwq+xbbpg=; b=S4+2WkhpLQPYydATmX9UZcs+gdPLJ7MWjwDZgwgUuP0O2J0yjcTiLHyTwy57Uye1xS SM2slK8d6cdBOfnchvO4FO/cbNs+TNkalnLXrsbyGQFS/YqR3+BpGm+GPVq+adfAceKe Y/1M6C/MjlFI2Y9/MOHTEWTTExdIHX1tS90di0Ig+tzuoCSL4U0a7R4oeGSmNTKoDbnF phsdDXI0FWldz5cgdwXORui/RC9+BMcMrpZCFCe3Yrk3vOx3lwICVvaP9079xa5pFhr3 Y9jFkLikGo9p+7brGFCzPnzpPGz6wLpXXjqGMb5IBoZQKDBXboTztMDQoL3cdRX4/F4X kBDw== X-Gm-Message-State: AOAM5313cy1yG/hAVEdocOYKuaCDfgH3rEDUDTJo3ntw0G36Ziuebt0V 2zn+5x2TRXRkOP6iBGsR2ExtJ9mWv0LkDD/hJ5g= X-Google-Smtp-Source: ABdhPJz5xUP2p4wqGikfzGpHRSQQkgZt7wD1Hc9NwW8rv+d3PJGc5Vphfy8wRfHFvxzvs6dAZcmCGA== X-Received: by 2002:a17:90a:7d11:: with SMTP id g17mr3736809pjl.150.1628765438634; Thu, 12 Aug 2021 03:50:38 -0700 (PDT) From: Luke Yue To: libvir-list@redhat.com Subject: [PATCH v3 10/11] test_driver: Introduce testDomainGetStatsIOThread Date: Thu, 12 Aug 2021 18:50:01 +0800 Message-Id: <20210812105002.197134-11-lukedyue@gmail.com> In-Reply-To: <20210812105002.197134-1-lukedyue@gmail.com> References: <20210812105002.197134-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.4 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.16 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: 1628765838558100001 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 6eebd85cf3..3c4015a67d 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -9798,6 +9798,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); @@ -9809,6 +9849,7 @@ struct testDomainGetStatsWorker { =20 static struct testDomainGetStatsWorker testDomainGetStatsWorkers[] =3D { { testDomainGetStatsState, VIR_DOMAIN_STATS_STATE }, + { testDomainGetStatsIOThread, VIR_DOMAIN_STATS_IOTHREAD }, { NULL, 0 } }; =20 @@ -9855,7 +9896,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