From nobody Mon Feb 9 08:28:43 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 1631719887285570.9002974784839; Wed, 15 Sep 2021 08:31:27 -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-290-r8qt5MLdNDi-0Ta3j1ThCA-1; Wed, 15 Sep 2021 11:31:24 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B38AD84A5E8; Wed, 15 Sep 2021 15:31:17 +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 9256E60C81; Wed, 15 Sep 2021 15:31:17 +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 540C54EA2F; Wed, 15 Sep 2021 15:31:17 +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 18FFV9bl028884 for ; Wed, 15 Sep 2021 11:31:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8682F2087A21; Wed, 15 Sep 2021 15:31:09 +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 820BB208747A for ; Wed, 15 Sep 2021 15:31:09 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.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 61A0318A01A5 for ; Wed, 15 Sep 2021 15:31:09 +0000 (UTC) Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-223-Ov5qI9vxNlWAN0YmTQ29ug-1; Wed, 15 Sep 2021 11:31:06 -0400 Received: by mail-pj1-f43.google.com with SMTP id g13-20020a17090a3c8d00b00196286963b9so5209028pjc.3 for ; Wed, 15 Sep 2021 08:31:05 -0700 (PDT) Received: from localhost ([103.149.249.103]) by smtp.gmail.com with ESMTPSA id d16sm124077pjd.54.2021.09.15.08.31.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Sep 2021 08:31:04 -0700 (PDT) X-MC-Unique: r8qt5MLdNDi-0Ta3j1ThCA-1 X-MC-Unique: Ov5qI9vxNlWAN0YmTQ29ug-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=4H6bPpyZKElbDEYalROcqeKjXgiT+jGarnAOeUbTA/I=; b=hVsoKuf/V5XWEiU5OVLCbrlABmom5nR3yx55jUTOUg8LHUaWD7cWlocaRs3x0pIUx4 1NOUQ53l2EOebdvKxBFbYk5GDnuhmwKMey3H1fz+5d/lBP4xZNa0+WIfOuGpwgsp6Ols kRQfU7W2EbCdv4cqLuamqvyUPCboa8uXvI3yljiuEZhGRuK66757EGdhBEBTgMNHmPrx uR+IsMDwG59MlCJeyRzRYTCizN2fzaZunicjBRc3CIJUM5FYQwSZOj2pA0ckiZx0ISvI tTgzsbH3iVsr+2OD4+PAw6Cdv2O2haOLof7YcaFdkF95XZB09tF/THeVUWtOwCi0UGct rNwg== X-Gm-Message-State: AOAM532fjocfxA1usqqMMSOI/248asZsvYhbsmKTCidC/FZhBG+Oxksy PdbyyqXLxvYbuyorvmuESIrzUxQFI5JfKq8qfXw= X-Google-Smtp-Source: ABdhPJwsccf8B+upAHymyNmXQtdBj9RDxUyYD6St5UMYcH6gMzZ87prf5CsvcQc7SGOtgff8YRLDRQ== X-Received: by 2002:a17:90a:44:: with SMTP id 4mr428913pjb.130.1631719864537; Wed, 15 Sep 2021 08:31:04 -0700 (PDT) From: Luke Yue To: libvir-list@redhat.com Subject: [PATCH v4 06/11] test_driver: Implement virDomainGetIOThreadInfo Date: Wed, 15 Sep 2021 23:30:27 +0800 Message-Id: <20210915153032.121221-7-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.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.12 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: 1631719890154100001 Content-Type: text/plain; charset="utf-8" If we use test driver on different machines, and use 0 as bitmap_size for virDomainDriverGetIOThreadsConfig(), we would get different results for the `CPU Affinity`, because it's depending on the host CPU's bitmap. In order to get a stable result for testing, use result of virDomainDefGetVcpus() as bitmap_size instead. Signed-off-by: Luke Yue --- src/test/test_driver.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index b588bbc32e..0971661c89 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -9586,6 +9586,34 @@ testDomainGetMessages(virDomainPtr dom, return rv; } =20 +static int +testDomainGetIOThreadInfo(virDomainPtr dom, + virDomainIOThreadInfoPtr **info, + unsigned int flags) +{ + virDomainObj *vm; + virDomainDef *targetDef =3D NULL; + unsigned int bitmap_size =3D 0; + int ret =3D -1; + + virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | + VIR_DOMAIN_AFFECT_CONFIG, -1); + + if (!(vm =3D testDomObjFromDomain(dom))) + goto cleanup; + + if (!(targetDef =3D virDomainObjGetOneDef(vm, flags))) + goto cleanup; + + bitmap_size =3D virDomainDefGetVcpus(targetDef); + + ret =3D virDomainDriverGetIOThreadsConfig(targetDef, info, bitmap_size= ); + + cleanup: + virDomainObjEndAPI(&vm); + return ret; +} + typedef enum { VIR_DOMAIN_IOTHREAD_ACTION_ADD, VIR_DOMAIN_IOTHREAD_ACTION_DEL, @@ -9781,6 +9809,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainGetVcpus =3D testDomainGetVcpus, /* 0.7.3 */ .domainGetVcpuPinInfo =3D testDomainGetVcpuPinInfo, /* 1.2.18 */ .domainGetMaxVcpus =3D testDomainGetMaxVcpus, /* 0.7.3 */ + .domainGetIOThreadInfo =3D testDomainGetIOThreadInfo, /* 7.8.0 */ .domainAddIOThread =3D testDomainAddIOThread, /* 7.8.0 */ .domainDelIOThread =3D testDomainDelIOThread, /* 7.8.0 */ .domainGetSecurityLabel =3D testDomainGetSecurityLabel, /* 7.5.0 */ --=20 2.33.0