From nobody Sun Feb 8 22:06:33 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1563877124; cv=none; d=zoho.com; s=zohoarc; b=DEokn7416zdvWF4lv4qnZd3Ci/qYDlO7GzEsCaJkXJDIJlRdy+AlXiXcziL1PanQpowNeaof1Msfjjx48nzcC3Rkmt6QII9zss0EREpQ7U/jdGVSjDZfgIqlpHoy1sdlX7yDKZYRhPAyDcdxr7xInoE3t0raHzJ4VRm4wyl8Nlo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563877124; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=GvN9hl9Kd333BipnlcMmkQL/FGIU3Rm/OkvkfMD/uQ0=; b=FsUEfN/CxuDXAqkJkx+48443tBR9iEoOFw5i+eoFAaOwar5Gri6kryIYDlBAVcUfqNA7k+JC9QDVv/FxBO/QsR4h+Mj2n+1TNsbL99t0XGoQLur4vTg/BD6YBCTY5hPeRh70ms0r1o+nKxcvd2NoDli3FryxWoatgywtp8IyIIU= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1563877124863254.27462265618112; Tue, 23 Jul 2019 03:18:44 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 6F39C3082B6D; Tue, 23 Jul 2019 10:18:43 +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 3A09A61352; Tue, 23 Jul 2019 10:18:43 +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 F14FF41F66; Tue, 23 Jul 2019 10:18:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x6NAIgMn018361 for ; Tue, 23 Jul 2019 06:18:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 146BE5C234; Tue, 23 Jul 2019 10:18:42 +0000 (UTC) Received: from mx1.redhat.com (ext-mx11.extmail.prod.ext.phx2.redhat.com [10.5.110.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0E02E5C230 for ; Tue, 23 Jul 2019 10:18:42 +0000 (UTC) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 205893084242 for ; Tue, 23 Jul 2019 10:18:41 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id g67so33872233wme.1 for ; Tue, 23 Jul 2019 03:18:41 -0700 (PDT) Received: from archpc.localdomain (x8d1ee222.agdsn.tu-dresden.de. [141.30.226.34]) by smtp.gmail.com with ESMTPSA id y6sm36270081wrp.12.2019.07.23.03.18.38 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 23 Jul 2019 03:18:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=8OL7bwG3Lj4V/eSOpqBZcgb9zLAn0AiD7iyDl2JltfE=; b=tvpyHwWIG1DO3G/4JBuDnhmIh951E2k5tI59tuifVHNCRy/suqSeQEKIHLLPgezLCs Dm8bs/+hvLnpUo+NcUJSS4yKFG9xoXhVzJyDKThPB+HfWKixJzeoOB38oaBBMn5mcoCU 2Wokry2toiuPCuEH0Uao4XcPbZy89Jf4nQiZFiXj7IXdOqO2YHvSRxBZGpMrYszx2+K9 x5MfY6c2p6Db8GsgYt4uUEZFcPDiZR0dj9MkhWn4RuhUwp0X3pPXbAYumwVBRvK4ahfy ANAOULWqHJRVAd3moSd2nwMyzMvNgO7zBz6wDps6kTOr1OWnmrcg7RTslLwl1epSK7zl CC/w== 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=8OL7bwG3Lj4V/eSOpqBZcgb9zLAn0AiD7iyDl2JltfE=; b=HsZrYXSMILcmCLTyYMEC9KVjb6fCwQJcsM5AD7zK80EtVELArajnJjKuxfO/1pnJKa n2HPEvvGZI08NiowytvzmdfaLsFosCyBsk4egIEnP3BAqK6mHCGpVOMVelze09aJoajZ xrVvZV8aqN3banu3IgB3TRgcey2Ax9lj09DYo4Lz7KpTxK+0b2GFrokSDYTg//6DAn15 gmFmR3fwuxsV8n7VuJmDEuMHy5Tvdj462hWD+9ROi7w7aPnRLyIwoyMETyRM8VUsPvbF nj+Mt9tMD/e0SQkEukuvgglCZer6yxA4MEqLkwdt8r6n402iTcrYj6HotmuZummHz3IJ A2PA== X-Gm-Message-State: APjAAAXCy352SnPgMH0YslnWR1+jo9QkNYHbO/wqCvhay59Ok1NjCrs6 V+LaMDlNwVzb0MResCXhYwspdOtAH4Hjyg== X-Google-Smtp-Source: APXvYqwUJY+E9mXTZzAhvwVEN9sKESVVCZC1D8MdykkTWCBEa3/5Wl0pNbynCG0xHnKUsbq40fujRA== X-Received: by 2002:a7b:c766:: with SMTP id x6mr70922972wmk.40.1563877119452; Tue, 23 Jul 2019 03:18:39 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Tue, 23 Jul 2019 12:17:55 +0200 Message-Id: <20190723101757.1927-3-stamatis.iliass@gmail.com> In-Reply-To: <20190723101757.1927-1-stamatis.iliass@gmail.com> References: <20190723101757.1927-1-stamatis.iliass@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 23 Jul 2019 10:18:41 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 23 Jul 2019 10:18:41 +0000 (UTC) for IP:'209.85.128.67' DOMAIN:'mail-wm1-f67.google.com' HELO:'mail-wm1-f67.google.com' FROM:'stamatis.iliass@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.1 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS) 209.85.128.67 mail-wm1-f67.google.com 209.85.128.67 mail-wm1-f67.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.40 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/4] test_driver: implement virDomainDelIOThread 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Tue, 23 Jul 2019 10:18:43 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Ilias Stamatis --- src/test/test_driver.c | 72 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 313cf5e7ef..29262e4d34 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -2653,6 +2653,77 @@ testDomainAddIOThread(virDomainPtr dom, } +static int +testDomainDelIOThread(virDomainPtr dom, + unsigned int iothread_id, + unsigned int flags) +{ + virDomainObjPtr vm =3D NULL; + virDomainDefPtr def =3D NULL; + size_t i, j; + 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 (!(def =3D virDomainObjGetOneDef(vm, flags))) + goto cleanup; + + if (!virDomainIOThreadIDFind(def, iothread_id)) { + virReportError(VIR_ERR_INVALID_ARG, + _("cannot find IOThread '%u' in iothreadids list"), + iothread_id); + goto cleanup; + } + + for (i =3D 0; i < def->ndisks; i++) { + if (def->disks[i]->iothread =3D=3D iothread_id) { + virReportError(VIR_ERR_INVALID_ARG, + _("cannot remove IOThread %u since it " + "is being used by disk '%s'"), + iothread_id, def->disks[i]->dst); + goto cleanup; + } + } + + for (i =3D 0; i < def->ncontrollers; i++) { + if (def->controllers[i]->iothread =3D=3D iothread_id) { + virReportError(VIR_ERR_INVALID_ARG, + _("cannot remove IOThread '%u' since it " + "is being used by controller"), + iothread_id); + goto cleanup; + } + } + + for (i =3D 0; i < def->niothreadids; i++) { + if (def->iothreadids[i]->iothread_id =3D=3D iothread_id) { + for (j =3D i + 1; j < def->niothreadids; j++) + def->iothreadids[j]->autofill =3D false; + + virDomainIOThreadIDDefFree(def->iothreadids[i]); + VIR_DELETE_ELEMENT(def->iothreadids, i, def->niothreadids); + + break; + } + } + + ret =3D 0; + cleanup: + virDomainObjEndAPI(&vm); + return ret; +} + + static int testDomainSetUserPassword(virDomainPtr dom, const char *user ATTRIBUTE_UNUSED, @@ -7793,6 +7864,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainCoreDump =3D testDomainCoreDump, /* 0.3.2 */ .domainCoreDumpWithFormat =3D testDomainCoreDumpWithFormat, /* 1.2.3 */ .domainAddIOThread =3D testDomainAddIOThread, /* 5.6.0 */ + .domainDelIOThread =3D testDomainDelIOThread, /* 5.6.0 */ .domainSetUserPassword =3D testDomainSetUserPassword, /* 5.6.0 */ .domainSetVcpus =3D testDomainSetVcpus, /* 0.1.4 */ .domainSetVcpusFlags =3D testDomainSetVcpusFlags, /* 0.8.5 */ -- 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list