From nobody Mon Feb 9 00:20:39 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 1627560689262819.4810790055294; Thu, 29 Jul 2021 05:11:29 -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-356-QYdeRlsKOYWYyYxdFRl2HA-1; Thu, 29 Jul 2021 08:11:26 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8DAF71006C8F; Thu, 29 Jul 2021 12:11:21 +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 5F87526DF2; Thu, 29 Jul 2021 12:11:21 +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 2B61D4BB7C; Thu, 29 Jul 2021 12:11:21 +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 16TCBKfu014615 for ; Thu, 29 Jul 2021 08:11:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id 506C62094D1F; Thu, 29 Jul 2021 12:11:20 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4C2D52094D1A for ; Thu, 29 Jul 2021 12:11:17 +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 8D30F811E78 for ; Thu, 29 Jul 2021 12:11:17 +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-390-8Nu6rbVuOyysKh0eziqa2w-1; Thu, 29 Jul 2021 08:11:15 -0400 Received: by mail-pj1-f43.google.com with SMTP id q17-20020a17090a2e11b02901757deaf2c8so9112924pjd.0 for ; Thu, 29 Jul 2021 05:11:15 -0700 (PDT) Received: from localhost ([103.138.53.99]) by smtp.gmail.com with ESMTPSA id j5sm3743716pgg.41.2021.07.29.05.11.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jul 2021 05:11:13 -0700 (PDT) X-MC-Unique: QYdeRlsKOYWYyYxdFRl2HA-1 X-MC-Unique: 8Nu6rbVuOyysKh0eziqa2w-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=mrX87H7LU2QYER2FSWqIs4PXidomj5JMklP8HnE+yjc=; b=CWZ/fHvQ4zvOum1Z8GPYhVG8bPlYN8H6BbdkV0oG9WItt918EaFgxpPvImv8PV63mk JhmhPgh3jgkfujTCUt6E/RHYwQnqrA/BZ2hQ9pM4KQbU+uCpHrA9aePMhSgFt0W6g8ES Ts2kDNfHAcCLtz7qXRUHLAggRvlttgGW4SoaOtqydZi1H1+TvPhXAQ665vc8RyzVldpp CC3vuxy9zHM0BGycOPjM46us+O4w9yhklsGpYOHLzf7lD3UYVbEvwSPmfhfFuU28UomQ oac0D1SvEuE6CM7ghYNFn5A3wnXbGXdCQXjrpfctteR1OX7G+uOslATLDKxDB0Gjei5r Bv9A== X-Gm-Message-State: AOAM531gB8KdUjCT9XJrrJBElEz+SQ8JZ5ViqXc/ovx/mURtnQJiRIcu yN3iihY/DjrdOJaRrLF+O3cINHbKusn3HtjsSXdotQ== X-Google-Smtp-Source: ABdhPJwZLZLFc9QInr1pg5/h2bqQAA6ilGsERVdQgRFhR2sOPPwn847d30PQjfeh0kb78n4bx/ZwQQ== X-Received: by 2002:a17:90a:6782:: with SMTP id o2mr14597807pjj.165.1627560673882; Thu, 29 Jul 2021 05:11:13 -0700 (PDT) From: Luke Yue To: libvir-list@redhat.com Subject: [PATCH v2 04/11] test_driver: Implement virDomainDelIOThread Date: Thu, 29 Jul 2021 20:10:51 +0800 Message-Id: <20210729121058.454431-5-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.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.84 on 10.5.11.23 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: 1627560690102100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Luke Yue --- src/test/test_driver.c | 55 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 3cabd6dc46..99d5d5b67b 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -9393,6 +9393,7 @@ testDomainCheckpointDelete(virDomainCheckpointPtr che= ckpoint, =20 typedef enum { VIR_DOMAIN_IOTHREAD_ACTION_ADD, + VIR_DOMAIN_IOTHREAD_ACTION_DEL, } virDomainIOThreadAction; =20 static int @@ -9417,6 +9418,14 @@ testDomainChgIOThread(virDomainObj *vm, return ret; =20 break; + + case VIR_DOMAIN_IOTHREAD_ACTION_DEL: + if (virDomainDriverDelIOThreadCheck(def, iothread_id) < 0) + return ret; + + virDomainIOThreadIDDel(def, iothread_id); + + break; } } =20 @@ -9466,6 +9475,51 @@ testDomainAddIOThread(virDomainPtr dom, virDomainObjEndAPI(&vm); return ret; } + +static int +testDomainDelIOThread(virDomainPtr dom, + unsigned int iothread_id, + unsigned int flags) +{ + virDomainObj *vm =3D NULL; + testDomainObjPrivate *priv; + size_t i; + int ret =3D -1; + + virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | + VIR_DOMAIN_AFFECT_CONFIG, -1); + + if (iothread_id =3D=3D 0) { + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("invalid value of 0 for iothread_id")); + return -1; + } + + if (!(vm =3D testDomObjFromDomain(dom))) + goto cleanup; + + if (testDomainChgIOThread(vm, iothread_id, + VIR_DOMAIN_IOTHREAD_ACTION_DEL, flags) < 0) + goto cleanup; + + priv =3D vm->privateData; + + for (i =3D 0; i < priv->iothreads->len; i++) { + testIOThreadInfo iothread =3D g_array_index(priv->iothreads, + testIOThreadInfo, i); + if (iothread.iothread_id =3D=3D iothread_id) { + g_array_remove_index(priv->iothreads, i); + break; + } + } + + ret =3D 0; + + cleanup: + virDomainObjEndAPI(&vm); + return ret; +} + /* * Test driver */ @@ -9533,6 +9587,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainGetVcpuPinInfo =3D testDomainGetVcpuPinInfo, /* 1.2.18 */ .domainGetMaxVcpus =3D testDomainGetMaxVcpus, /* 0.7.3 */ .domainAddIOThread =3D testDomainAddIOThread, /* 7.7.0 */ + .domainDelIOThread =3D testDomainDelIOThread, /* 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