From nobody Tue Feb 10 13:33:09 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 1628765556428351.608524076393; Thu, 12 Aug 2021 03:52:36 -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-517-Ch0fmo3GNwu-Jjn9v38pzw-1; Thu, 12 Aug 2021 06:52:34 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BB9A31008065; Thu, 12 Aug 2021 10:52:28 +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 9B48A5D9DE; Thu, 12 Aug 2021 10:52:28 +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 688904A7C9; Thu, 12 Aug 2021 10:52:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17CAoYh2015198 for ; Thu, 12 Aug 2021 06:50:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id 00A41117C2D4; Thu, 12 Aug 2021 10:50:34 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F06AE117C2D2 for ; Thu, 12 Aug 2021 10:50:33 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.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 D88D496B05C for ; Thu, 12 Aug 2021 10:50:33 +0000 (UTC) Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-457-paid294fNkqdAVnkKQn_cg-1; Thu, 12 Aug 2021 06:50:31 -0400 Received: by mail-pj1-f48.google.com with SMTP id mq2-20020a17090b3802b0290178911d298bso10091948pjb.1 for ; Thu, 12 Aug 2021 03:50:31 -0700 (PDT) Received: from localhost ([38.94.109.214]) by smtp.gmail.com with ESMTPSA id h16sm2834542pfn.215.2021.08.12.03.50.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Aug 2021 03:50:29 -0700 (PDT) X-MC-Unique: Ch0fmo3GNwu-Jjn9v38pzw-1 X-MC-Unique: paid294fNkqdAVnkKQn_cg-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=1EYGKGQKFt/JWX050GVWcZ+KKCG7W13BD4sTikONV28=; b=L/VfffcLH8+fUHMPIvFJQEVJQqq0L4O84gsANBd94gB20nDeTp9aGWAt9XqsGyw7nI 1aPm4Jmghfj2ZB9dXRIIckMjK50RqyMKXeH9XX+sESPM3QD5WczrMQncPidW6ZVxfPL/ XALYjSPzeYBE6iA021mPwg45aigcTcOICvuXLO7USMKWWlLOInleuBfwAgwIjMQOu0q8 UPU9wD6nOsfbMEyHS1YR0XpwEEvx0rgwIsjj3WKq3b3WL/OdTNh1lbtjhKosHTDtZe/O ahIXH19ZubmE9kmImur63KB49gMegYe/1cBLzTojJpY0f983uuPoHJP1vCXfDVzrW1zX q3Jg== X-Gm-Message-State: AOAM530ndRA3tGDBWpTKBPzRNMu/kY/VxqmWSGHY4ywuzJ6luI3bew9n ysgzCC0h5bOcFx2kUhV0rzJallhtc4rWXzS+r6g= X-Google-Smtp-Source: ABdhPJwdmfDbHtrbsGrwf9rJM+oxgu5LQ6vaBbcLy8EPoubNvIvDLAE1eElJVBjGHwSEKNplKiiEqA== X-Received: by 2002:a17:90b:33ce:: with SMTP id lk14mr15554767pjb.118.1628765430334; Thu, 12 Aug 2021 03:50:30 -0700 (PDT) From: Luke Yue To: libvir-list@redhat.com Subject: [PATCH v3 07/11] test_driver: Implement virDomainPinIOThread Date: Thu, 12 Aug 2021 18:49:58 +0800 Message-Id: <20210812105002.197134-8-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.3 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.14 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: 1628765556848100003 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 67337879ef..385c8b3ad3 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -9647,6 +9647,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 */ @@ -9716,6 +9765,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainGetIOThreadInfo =3D testDomainGetIOThreadInfo, /* 7.7.0 */ .domainAddIOThread =3D testDomainAddIOThread, /* 7.7.0 */ .domainDelIOThread =3D testDomainDelIOThread, /* 7.7.0 */ + .domainPinIOThread =3D testDomainPinIOThread, /* 7.7.0 */ .domainGetSecurityLabel =3D testDomainGetSecurityLabel, /* 7.5.0 */ .nodeGetSecurityModel =3D testNodeGetSecurityModel, /* 7.5.0 */ .domainGetXMLDesc =3D testDomainGetXMLDesc, /* 0.1.4 */ --=20 2.32.0