From nobody Thu May 2 04:56:39 2024 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=1563877116; cv=none; d=zoho.com; s=zohoarc; b=TcpdLr9B0UlLeb6+//VNot31h6L4vBPXkPVOBUiDYG4zso50U7VgKDTAhxyH//Z/g4Q+vCjIGsCg2gkQsaXYAKkPT6Yg3dU/RKnZOKyGW7XJ+DynBwRYDQXkUPt6qrTCj5GwMYbaZ/rkWwERYetXtq5Itm3Cp/AYbSG3/w9pwpc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563877116; 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=3osBxJzkrOjTy9RplXMnTqgJadJnAcXgvump7JUu/aM=; b=lYTlujaCbDMSIA9vRMTZNHyvJWFBO6FaVUis9K+WqPow/vUXg6xzyI2F8/zqV5FPcnzTNN5d99uzDg+Y+0ugkthrG8MWZFf/wDZjCAYtOyCg99WKRKCEGr0P3f7tC9v1dM8SyP89oizWDRVvf8v4SXS/qOxN8dA8OX1rRhoTSa4= 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 1563877116535878.4975440267416; Tue, 23 Jul 2019 03:18:36 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 0C90430821A0; Tue, 23 Jul 2019 10:18:35 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DE7525D9CC; Tue, 23 Jul 2019 10:18:34 +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 77F4518089C8; Tue, 23 Jul 2019 10:18:34 +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 x6NAIWXf018343 for ; Tue, 23 Jul 2019 06:18:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id 82C275C230; Tue, 23 Jul 2019 10:18:32 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7CC005C220 for ; Tue, 23 Jul 2019 10:18:30 +0000 (UTC) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) (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 21E1D2CD7E6 for ; Tue, 23 Jul 2019 10:18:29 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id n9so42622135wru.0 for ; Tue, 23 Jul 2019 03:18:29 -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.26 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 23 Jul 2019 03:18:26 -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=wM2KWNiOGMVXByhjCweJWN9r75AayE6s+9lY44/oyUI=; b=B/DYKPHq87jt7pX1HLQQEYa2YMDwitJD3crvI++/AdwXFffpDl7B9+o3U0rvOT1W3b aY5SFxP6NTRG99/UJPzPnymWLRH7FFsQc5nwUkk3+eC9NG1wgSHh2UA5QkebHciQy9hP oTI1r6CUPhT4ciKP9vFlioWomHLH+0fCgGTJh1bu/XKkC7YkxbSoiDe98SvWboUcH57R hRCVceLIeBt9SvRPEpC78VUc5AO85joWGIZkxZiTIf6Q60MirlDOLaQF20FFM9wNJ3gp Q5/wiurYXIzzV93NwuIZUk9cYqqJatcngKJkFqGuqEMWHm1MbH2EMeDaawnuWpMaJclA jvxA== 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=wM2KWNiOGMVXByhjCweJWN9r75AayE6s+9lY44/oyUI=; b=jUe6SYHwQIag0C4HwOANIRILuzIlqFeFgVJXvZXQEK85kW66Ey8eHUdKJqhYcopLUf AeIK0yDaOAawnP2jTly5USET06KTIF6RO2nCa7v/6XG1ix1DZh5ADTVAhPpqnU3t8Adw HgRxXtyJKpos4K6YOi83VxoT2kKAdqNpEQq0Gh3Ej7gyUr5t+Z/lymzGDY4q4DsWS0J3 PJTkj36alvv/5FALCKUKO2bkX3KOOw7N8xOLKC2C5P4uLcszKFHCuzYJ/KRyAYXRZXp3 fbsfHn5c1njr3/Y4P+OZdiXmEmPsYnhGVPpuGfKmKL/tLaoadF1FOvS7bUc2pWz4NPIg 6QUg== X-Gm-Message-State: APjAAAUdIrBX5SKAv700aXQsAgPU02ANSKjM3Z6OpyKXEdCV4q+teMTM O4kVoI2BQ8+9sai657VAbUI/JmVYjto1iw== X-Google-Smtp-Source: APXvYqwuiJjxaxeOw7xV3IHfdZ9OChcvUCoi2Fx9hgQKwmGca4hhux0ll46w+FGNv4No+nXuxWMSfQ== X-Received: by 2002:adf:eb49:: with SMTP id u9mr77419209wrn.215.1563877107473; Tue, 23 Jul 2019 03:18:27 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Tue, 23 Jul 2019 12:17:54 +0200 Message-Id: <20190723101757.1927-2-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.29]); Tue, 23 Jul 2019 10:18:29 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 23 Jul 2019 10:18:29 +0000 (UTC) for IP:'209.85.221.65' DOMAIN:'mail-wr1-f65.google.com' HELO:'mail-wr1-f65.google.com' FROM:'stamatis.iliass@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.099 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS) 209.85.221.65 mail-wr1-f65.google.com 209.85.221.65 mail-wr1-f65.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/4] test_driver: implement virDomainAddIOThread 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Tue, 23 Jul 2019 10:18:35 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Ilias Stamatis Reviewed-by: Erik Skultety --- src/test/test_driver.c | 51 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 2e33a9dd55..313cf5e7ef 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -2603,6 +2603,56 @@ testDomainSetVcpusFlags(virDomainPtr domain, unsigne= d int nrCpus, } +static int +testDomainAddIOThread(virDomainPtr dom, + unsigned int iothread_id, + unsigned int flags) +{ + virDomainObjPtr vm =3D NULL; + virDomainDefPtr def =3D NULL; + virDomainIOThreadIDDefPtr iothrid =3D NULL; + 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, + _("an IOThread is already using iothread_id '%u'"), + iothread_id); + goto cleanup; + } + + if (VIR_ALLOC(iothrid) < 0) + goto cleanup; + + iothrid->iothread_id =3D iothread_id; + + if (VIR_APPEND_ELEMENT_COPY(def->iothreadids, def->niothreadids, iothr= id) < 0) + goto cleanup; + + ret =3D 0; + + cleanup: + if (ret < 0) + virDomainIOThreadIDDefFree(iothrid); + virDomainObjEndAPI(&vm); + return ret; +} + + static int testDomainSetUserPassword(virDomainPtr dom, const char *user ATTRIBUTE_UNUSED, @@ -7742,6 +7792,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainSaveImageGetXMLDesc =3D testDomainSaveImageGetXMLDesc, /* 5.5.0= */ .domainCoreDump =3D testDomainCoreDump, /* 0.3.2 */ .domainCoreDumpWithFormat =3D testDomainCoreDumpWithFormat, /* 1.2.3 */ + .domainAddIOThread =3D testDomainAddIOThread, /* 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 From nobody Thu May 2 04:56:39 2024 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 From nobody Thu May 2 04:56:39 2024 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=1563877137; cv=none; d=zoho.com; s=zohoarc; b=RQomKKbRgVTYYU27GxPsSQL/yp5PV/Z4cKdRTIT64Ts0u94ILanz9qFCwHfpA27ReQ3uDGv8r6URCtJ/GsbIzMnFoTY2UQwliQi/vh38iGv3p3xqCpH33jTinR9CmNyPKONU3fus06SZZKstblZvrm4qvlC9PMy6N0qQF90Enk0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563877137; 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=ptDXMRKAzP3A9Gy4XS4PEuNP2SIaJaBPZVmWDaZhYGU=; b=LB8TykYvryLNeTvNNk0gDLW+qHGG2VbN0OOKcz0+IklFardBBaqkOJYp62/nuPpDBJHi4tO+Xrtda62iGps+RtULkPLSJkgMTojALxc32p6YwrZKsIA+jht4zL7zWSyubzT/NCmp8qhG8AvAcaie5eKHO7vK+JFiU4RcJMh1dUc= 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 1563877137140102.37031967343455; Tue, 23 Jul 2019 03:18:57 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C64FA30C62A4; Tue, 23 Jul 2019 10:18:55 +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 8BA905B685; Tue, 23 Jul 2019 10:18:55 +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 33DBC3FA9A; Tue, 23 Jul 2019 10:18:55 +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 x6NAIsK4018388 for ; Tue, 23 Jul 2019 06:18:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9D3315C28C; Tue, 23 Jul 2019 10:18:54 +0000 (UTC) Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 973F05C234 for ; Tue, 23 Jul 2019 10:18:51 +0000 (UTC) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) (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 13691859FB for ; Tue, 23 Jul 2019 10:18:50 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id v19so37997516wmj.5 for ; Tue, 23 Jul 2019 03:18:50 -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.47 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 23 Jul 2019 03:18:47 -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=qtolFFwxJOG8K+vCKe/6m7XkSQiH2Nx6HWTTDIS2TCI=; b=X/cYq63Xj2HU07tyMxliXHXUgalAKn2+r/HhYyp++9GP5MXqJ40or2uXlIiE+CLBMd Kdzf2ohT+B7SIGwktrwpMo+GLqNM7Ov49+iEE/FVVaWUrfqUFwDEpDOTn5Q7tPmBAvrC uST4ILvJmpE8nKumg6yu12wEOelKWBL4mwLMHD7QHiIa8uGg5exoeLp+D4vBpV0AcGCt cBQjHKuaYqPGglqh5PCx1JCCKCRreQW0T8vfdPHg5gCnbrr52HsuPO3uzyFfh95jS9n1 cmuAEUTNM70b45w4yprNJGgqkBCEtQxl4iwwf+XyMxmd7OYnxSbFpe2LVUROM14sm/Kv nMUw== 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=qtolFFwxJOG8K+vCKe/6m7XkSQiH2Nx6HWTTDIS2TCI=; b=cX1KZm0Q4ssAADOaV0X49zpgKuDY+p35oPCdKxIkZOpa5r7OZrd6QsV7CIFv9PmE1t 688XYjtS3cYnXcvgvL71CbbHeaB5IzA1IwZDMH8ZvY5n2SaKDzC1lhAH+X+kj0XBIBIU JUBBBKeYZg+zSS2u8uc3UJNrBYCjeysVvwwR2L5V/+BSE2GCxaM+HssUePx1S/aKsGfG ZGNc+wdSZNAcUQX5ptCUHRwJRWucrT1vwYiYEyUfBl6Wosd87ff0kvefbyEQub0qTha6 cISXPtDVLOBOc+cGOVPkNJQDxX7AU+kgORfhjc41sptghNew/Sq4TOcDUDXdJGQG2Fs4 ifTg== X-Gm-Message-State: APjAAAV8Xfz1CAD58cfYCPVRHgiNPkNO1tvATdHa5f+c2vp5OwDmJdBI EGfXKzXGeOAO3OnuyQl/PVFdbZPfEcwDmQ== X-Google-Smtp-Source: APXvYqzvbACBiIS9n1R6+eb0T7PRHKV1eA2MUuB22ri4n3zuIaFoit+LMrBdTx0rYX21B7OXbxfPtg== X-Received: by 2002:a05:600c:20d:: with SMTP id 13mr68763901wmi.141.1563877128394; Tue, 23 Jul 2019 03:18:48 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Tue, 23 Jul 2019 12:17:56 +0200 Message-Id: <20190723101757.1927-4-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.26]); Tue, 23 Jul 2019 10:18:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 23 Jul 2019 10:18:50 +0000 (UTC) for IP:'209.85.128.65' DOMAIN:'mail-wm1-f65.google.com' HELO:'mail-wm1-f65.google.com' FROM:'stamatis.iliass@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.099 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS) 209.85.128.65 mail-wm1-f65.google.com 209.85.128.65 mail-wm1-f65.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/4] test_driver: implement virDomainPinIOThread 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Tue, 23 Jul 2019 10:18:56 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Ilias Stamatis Reviewed-by: Erik Skultety --- src/test/test_driver.c | 51 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 29262e4d34..47e28a01ec 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -2724,6 +2724,56 @@ testDomainDelIOThread(virDomainPtr dom, } +static int +testDomainPinIOThread(virDomainPtr dom, + unsigned int iothread_id, + unsigned char *cpumap, + int maplen, + unsigned int flags) +{ + int ret =3D -1; + virDomainObjPtr vm =3D NULL; + virDomainDefPtr def =3D NULL; + virDomainIOThreadIDDefPtr iothrid =3D NULL; + virBitmapPtr 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 cpumask; + iothrid->autofill =3D false; + + ret =3D 0; + cleanup: + if (ret < 0) + virBitmapFree(cpumask); + virDomainObjEndAPI(&vm); + return ret; +} + + static int testDomainSetUserPassword(virDomainPtr dom, const char *user ATTRIBUTE_UNUSED, @@ -7865,6 +7915,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainCoreDumpWithFormat =3D testDomainCoreDumpWithFormat, /* 1.2.3 */ .domainAddIOThread =3D testDomainAddIOThread, /* 5.6.0 */ .domainDelIOThread =3D testDomainDelIOThread, /* 5.6.0 */ + .domainPinIOThread =3D testDomainPinIOThread, /* 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 From nobody Thu May 2 04:56:39 2024 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=1563877149; cv=none; d=zoho.com; s=zohoarc; b=eZoUPLjqf/oRtXoTmCmoMcXouw3Y8q9vsrT35jBIyhg0LarOYNRpAV9HTbrxyUiMxgNoqwCatC2wen8OlEnFA3PrHMFWj4ZoiPKWkw83mJOMS7XOTnl1mGTHlqWVkQp8hMUeKN4HMB/C1dF4t967JrG2Z+WVwpHNkDR83yqj0OI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563877149; 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=iN/6bY59IwotZt1qVfDqxDBvpbtbVt4ibX8U6FVeYd0=; b=VR5iXCtD29AG+fUp3wgmzKtTRxuAOALMrgOGRlEk1Ak9zMnuOZNuw2pJwCE10sJMZs+bSyPQDhpZAtuocVY8nMnESb7yxQFzQEPzDNZaZos7cwGaYnFH3AAm2qfb6TDjHNTMsAf2o28/bEBpqYlpoC3+qpenuIzBFO7/YoQkihM= 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 15638771490839.626132387546477; Tue, 23 Jul 2019 03:19:09 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AB1408E22B; Tue, 23 Jul 2019 10:19:07 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 82EA01018A31; Tue, 23 Jul 2019 10:19:07 +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 487011800206; Tue, 23 Jul 2019 10:19:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x6NAJ6cY018437 for ; Tue, 23 Jul 2019 06:19:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id 80AAA6061E; Tue, 23 Jul 2019 10:19:06 +0000 (UTC) Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 786D460606 for ; Tue, 23 Jul 2019 10:19:01 +0000 (UTC) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) (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 91D8A3C92D for ; Tue, 23 Jul 2019 10:19:00 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id f9so42507504wre.12 for ; Tue, 23 Jul 2019 03:19:00 -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.58 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 23 Jul 2019 03:18:58 -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=f+PTmA1nRkP5Qy4V+IkbU1uwG6IILw40oVQhVpkz78A=; b=XMsuheQYe/gwCggK24sVebgUL2DuTSBljeDqaD8CeUqVp2tOnIzjJ8C4+1xS9Eewzd L1PHPjWyrNLy6hGNny0ATdYoAxakKbA+Nvk/LVoYvISqPbsmbMwXpjVrO/ktfeNcR+e2 6rgD8nhds2gXnoBnlyErklOCogWhcWBnCj3+RkAEjkf1Ezpre0SuedcGY3tvYwKcqTTa TuWouAAgzrkwXcefZHBHEqFLWJZf3GWKTkcecLflK4zL+1HL8KAPTBdUdl/jy/5Kkwqu rpfgLQv3Uh1ZjRwaTcImeesK9YIiL/Ttn6lWEZMtk0xV86JQWHAebTbmaq1dlQ2sOATG E9jQ== 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=f+PTmA1nRkP5Qy4V+IkbU1uwG6IILw40oVQhVpkz78A=; b=lpwNDt4VZbBWjVyYxzUbL7GuG+LSPtVTMZUbxI/alYCDCMsFre6rt2/9oonuh3oyWJ kNXuWJRAgoRpAHUvTVXoWGSC4CTRQacUkq+bweFTUF3wU3C+aBdzHQDdHBORSenwklo+ 9essK3RP8FE76EaroMilZg+4F36AwU/82eY024hL0QtRGD9+pEYqSuv+oUC48I3m310n JtOg6XjCXHKJ2VFpqei9e6r4lE2ANOZq5EOaE8W59OLmXq6zztPykmkwPgkXnhN0u3O4 NE9uz7VEEvVYRW739hJgV8d9ocibb8g6L/srIluPAmWZ7zqrI6acxidlvfjgrtp3Q+3C sLmA== X-Gm-Message-State: APjAAAXBSEidWZKltz53UltU15a16jvUwSfkRUMFJLqAuCjDBcO/jlPc g877C2l+Kx7JkXc48t09hs4Hj96IBz+sZg== X-Google-Smtp-Source: APXvYqxBWKNjiHCPaJ/PZYWSbuuBMgK0m7DxCWG9CCEp0xS3koYnFFE+N8DUzl9PYQ39fcCjE4sn9g== X-Received: by 2002:adf:e602:: with SMTP id p2mr43462148wrm.306.1563877138982; Tue, 23 Jul 2019 03:18:58 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Tue, 23 Jul 2019 12:17:57 +0200 Message-Id: <20190723101757.1927-5-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.39]); Tue, 23 Jul 2019 10:19:00 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 23 Jul 2019 10:19:00 +0000 (UTC) for IP:'209.85.221.66' DOMAIN:'mail-wr1-f66.google.com' HELO:'mail-wr1-f66.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.221.66 mail-wr1-f66.google.com 209.85.221.66 mail-wr1-f66.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.39 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/4] test_driver: implement virDomainGetIOThreadInfo 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 23 Jul 2019 10:19:08 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Ilias Stamatis Reviewed-by: Erik Skultety --- src/test/test_driver.c | 74 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 47e28a01ec..4c6f3db8de 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -2774,6 +2774,79 @@ testDomainPinIOThread(virDomainPtr dom, } +static int +testDomainGetIOThreadInfo(virDomainPtr dom, + virDomainIOThreadInfoPtr **info, + unsigned int flags) +{ + virDomainObjPtr vm =3D NULL; + virDomainDefPtr def =3D NULL; + virBitmapPtr cpumask =3D NULL; + virBitmapPtr bitmap =3D NULL; + virDomainIOThreadInfoPtr *info_ret =3D NULL; + size_t i; + int hostcpus; + int ret =3D -1; + + 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 (def->niothreadids =3D=3D 0) + return 0; + + if ((hostcpus =3D virHostCPUGetCount()) < 0) + goto cleanup; + + if (VIR_ALLOC_N(info_ret, def->niothreadids) < 0) + goto cleanup; + + for (i =3D 0; i < def->niothreadids; i++) { + if (VIR_ALLOC(info_ret[i]) < 0) + goto cleanup; + + info_ret[i]->iothread_id =3D def->iothreadids[i]->iothread_id; + + cpumask =3D def->iothreadids[i]->cpumask; + if (!cpumask) { + if (def->cpumask) { + cpumask =3D def->cpumask; + } else { + if (!(bitmap =3D virBitmapNew(hostcpus))) + goto cleanup; + virBitmapSetAll(bitmap); + cpumask =3D bitmap; + } + } + + if (virBitmapToData(cpumask, &info_ret[i]->cpumap, + &info_ret[i]->cpumaplen) < 0) + goto cleanup; + + virBitmapFree(bitmap); + bitmap =3D NULL; + } + + VIR_STEAL_PTR(*info, info_ret); + ret =3D def->niothreadids; + + cleanup: + if (info_ret) { + for (i =3D 0; i < def->niothreadids; i++) + virDomainIOThreadInfoFree(info_ret[i]); + VIR_FREE(info_ret); + } + virBitmapFree(bitmap); + virDomainObjEndAPI(&vm); + return ret; +} + + static int testDomainSetUserPassword(virDomainPtr dom, const char *user ATTRIBUTE_UNUSED, @@ -7916,6 +7989,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainAddIOThread =3D testDomainAddIOThread, /* 5.6.0 */ .domainDelIOThread =3D testDomainDelIOThread, /* 5.6.0 */ .domainPinIOThread =3D testDomainPinIOThread, /* 5.6.0 */ + .domainGetIOThreadInfo =3D testDomainGetIOThreadInfo, /* 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