From nobody Mon Feb 9 03:13:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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.129.124]) by mx.zohomail.com with SMTPS id 1631719926188481.0867328110088; Wed, 15 Sep 2021 08:32:06 -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-6-A-fIy32QNRCHE4XGpcG2jg-1; Wed, 15 Sep 2021 11:31:29 -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 0BD5A100CCC4; Wed, 15 Sep 2021 15:31:23 +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 C4E706D987; Wed, 15 Sep 2021 15:31:20 +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 777274EA3A; Wed, 15 Sep 2021 15:31:20 +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 18FFVB4g028891 for ; Wed, 15 Sep 2021 11:31:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1AA70208747B; Wed, 15 Sep 2021 15:31:11 +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 16A172087A23 for ; Wed, 15 Sep 2021 15:31:11 +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 F370A91C7D3 for ; Wed, 15 Sep 2021 15:31:10 +0000 (UTC) Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-56--LRV_XAsNNaIRn781IUf5Q-1; Wed, 15 Sep 2021 11:31:09 -0400 Received: by mail-pg1-f177.google.com with SMTP id e7so3090946pgk.2 for ; Wed, 15 Sep 2021 08:31:08 -0700 (PDT) Received: from localhost ([103.149.249.103]) by smtp.gmail.com with ESMTPSA id g11sm332141pgn.41.2021.09.15.08.31.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Sep 2021 08:31:07 -0700 (PDT) X-MC-Unique: A-fIy32QNRCHE4XGpcG2jg-1 X-MC-Unique: -LRV_XAsNNaIRn781IUf5Q-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=AYfQu4KYTAhgGcquOrISnJieYS2D53+Hl/gd7FzwRic=; b=rX3s8CBJl7rBfh/YhOrqdHENah8JP1c8sMyW2LmZy4F2UERxjy5SETxwz3dff7E6Lz o8PkxywYzlAmUcd+gjp9H4WejT4B22izJD8G7dL6jsw+n0dvRID6zDX64yEby/z/JmPU bbyJ3YFIG0GGJV9Gda5H+d7Inr98jmxgOedI+LmVuUHMDLBdt/0xWdL60vWV9Oa/WTnY Eq09eSTum7cqz4uMVo7bZbhz7ezCJzyxoVxOAE3HjYkH0cCV+x8qMzl1nRkDZ7hO/odX bGuD/K7NGhKn3FWckM+G30NYNzAkftPa/ZtA6yCV4ac/EWkzVTfoZSJhzFL74vU20XGD DMrA== X-Gm-Message-State: AOAM5312DUqcCs0peAa/31g0Gv/onwm8eD2LPWplBPc/+2OHs+3WBUoG CQAK/xh4dOQde8kFjBl8TcsRcPJ6j8yybms8 X-Google-Smtp-Source: ABdhPJyRxKe2lxz0VGY6e684En8AmY9WNX+Ay77gNRStiYiOKWmaIp7xyp7vU/wo4bqMVJzAAmxGuA== X-Received: by 2002:a62:ddd8:0:b0:435:4de8:2652 with SMTP id w207-20020a62ddd8000000b004354de82652mr104411pff.53.1631719867699; Wed, 15 Sep 2021 08:31:07 -0700 (PDT) From: Luke Yue To: libvir-list@redhat.com Subject: [PATCH v4 07/11] test_driver: Implement virDomainPinIOThread Date: Wed, 15 Sep 2021 23:30:28 +0800 Message-Id: <20210915153032.121221-8-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.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: 1631719927748100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Luke Yue --- src/test/test_driver.c | 50 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 0971661c89..43c0822c87 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -9743,6 +9743,55 @@ testDomainDelIOThread(virDomainPtr dom, return ret; } =20 +static int +testDomainPinIOThread(virDomainPtr dom, + unsigned int iothread_id, + unsigned char *cpumap, + int maplen, + unsigned int flags) +{ + int ret =3D -1; + virDomainObj *vm; + virDomainDef *def; + virDomainIOThreadIDDef *iothrid; + virBitmap *cpumask =3D NULL; + + virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | + VIR_DOMAIN_AFFECT_CONFIG, -1); + + if (!(vm =3D testDomObjFromDomain(dom))) + goto cleanup; + + if (!(def =3D virDomainObjGetOneDef(vm, flags))) + goto cleanup; + + if (!(cpumask =3D virBitmapNewData(cpumap, maplen))) + goto cleanup; + + if (virBitmapIsAllClear(cpumask)) { + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("Empty iothread cpumap list for pinning")); + goto cleanup; + } + + if (!(iothrid =3D virDomainIOThreadIDFind(def, iothread_id))) { + virReportError(VIR_ERR_INVALID_ARG, + _("iothreadid %d not found"), iothread_id); + goto cleanup; + } + + virBitmapFree(iothrid->cpumask); + iothrid->cpumask =3D g_steal_pointer(&cpumask); + iothrid->autofill =3D false; + + ret =3D 0; + + cleanup: + virBitmapFree(cpumask); + virDomainObjEndAPI(&vm); + return ret; +} + /* * Test driver */ @@ -9812,6 +9861,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainGetIOThreadInfo =3D testDomainGetIOThreadInfo, /* 7.8.0 */ .domainAddIOThread =3D testDomainAddIOThread, /* 7.8.0 */ .domainDelIOThread =3D testDomainDelIOThread, /* 7.8.0 */ + .domainPinIOThread =3D testDomainPinIOThread, /* 7.8.0 */ .domainGetSecurityLabel =3D testDomainGetSecurityLabel, /* 7.5.0 */ .nodeGetSecurityModel =3D testNodeGetSecurityModel, /* 7.5.0 */ .domainGetXMLDesc =3D testDomainGetXMLDesc, /* 0.1.4 */ --=20 2.33.0