From nobody Thu Apr 25 19:55:47 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=1565622863; cv=none; d=zoho.com; s=zohoarc; b=OAKNmW9DupV9aUQ0OiFiRp7QA2tpMAipfL15uzNZgQTJnogMtwGGmnIKCfCUXDa8SHzm2U7Eo6NCfr7Z53UC3l+vkz3IaASOSOQcHMySCUf0Z8SbxOuoZtS16VGjiEBlfSYOQ/5X++j6Q7NEFkQ9NzY8XJtGg1lnzvuFadXcEVk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565622863; 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=TlOmAP4FrpDqOd0AZS3vH0qlCkoZh7OH0CmKTPnPmsA=; b=e5QKYgnsvHN2UTzPwjrYB8VE/KZu8/SfbEWdbYbuGRIOKXOoBXpfEsrUe5IynnaRJGxD/tawCw+6cAlvCTqSpuA6ij6pugz4l2fIC/Wq/Gl+LUi4LSSAFCH14fIQYOL4wvCwro74gpcoLecykmaa9tAknzb1SaOC+5BGdxaSb3s= 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 156562286327159.84983631039586; Mon, 12 Aug 2019 08:14:23 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 9CF213071549; Mon, 12 Aug 2019 15:14: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 7ACC029359; Mon, 12 Aug 2019 15:14: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 38C0C24FDE; Mon, 12 Aug 2019 15:14:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7CFEJ3G025936 for ; Mon, 12 Aug 2019 11:14:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3B8E28022C; Mon, 12 Aug 2019 15:14:19 +0000 (UTC) Received: from mx1.redhat.com (ext-mx12.extmail.prod.ext.phx2.redhat.com [10.5.110.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 36BC980235 for ; Mon, 12 Aug 2019 15:14:18 +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 41E5D3172D89 for ; Mon, 12 Aug 2019 15:14:17 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id f72so12497096wmf.5 for ; Mon, 12 Aug 2019 08:14:17 -0700 (PDT) Received: from archlap.localdomain ([185.32.231.210]) by smtp.gmail.com with ESMTPSA id 24sm10369223wmf.10.2019.08.12.08.14.14 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 12 Aug 2019 08:14:14 -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=J9WiaNzXIbeNvhAOqrbYokDsHFD7WAQX4rYzUy6oCOQ=; b=PIH4HSumeRHeDlznhTO7Z7rsOBZZcHelsWkX3JoxC+8/6lcOOns0QShCnYu5xjenFe hwR6P58sh1YMR6/NFH+vQ8xRNFiobba2bFYHz1rXVpXMOpwr6kqtsLQVsPrxJAEF9kf3 h2as5sv4fMTkBCt/h6FqyMBDQv40DxySfFIzyw4EQKPpKWIfERE6Rb5mN1EbFEQhchNL aH1XtHwvr5Rn+LJJuKQVpxbg9bwo9kxxgyVqnkuXRKq9V8zU3PoxpORd756sjFSAS7mQ m5QZiKFSTuABi/nOSCqoa5ZJ5z5qsxRsrWRWvRZSiW2P7Fv0PBo6TtgtqNug9qeYQwhd FxKA== 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=J9WiaNzXIbeNvhAOqrbYokDsHFD7WAQX4rYzUy6oCOQ=; b=BdqNDKGI795a8zCKii2PG239x4op5F2fT3fib2xxiQF5FmmOVzujYE9N/HMtbw/Qyf hT2LRPrpJCWWDS6FxvMEd4ZZLrmvciejFAtHkzD+e0ZTnbu6VT6pSDt4rKafNZn6Vft9 eJ0mRb/xweItmXR717GiYAXU9Dghj+v52pC7WFXlaFfvZ2fD9tTtcu5AVzXIL6VDrq2b QigdAuW7HSjhEfEBiUW8HqkHpSyjkiNbPsD2Fl7foj40mU7ZXML6xmMZtBFWLtW2oAxS cAN2q3E0Z/iDsbeLmAPfdqAOmHoYN9ZdELxv3xIMwTfeQSZhiN9Dc7L0E8+UC4GAqKJ6 pugg== X-Gm-Message-State: APjAAAXJov6dI1hSY8BBdY9YqQYQhc1bcq9oGksGONFSzpmiKw9isG8f 9jvgrUu6dAIGvjBK30oWW0RHV0HzKUY= X-Google-Smtp-Source: APXvYqzizmhb6A6wOAwoxkXu9MqiocQDbUTVcm0mOMtC382Y/TD08tQHMhf0eCQP7F0odnPzakfSTQ== X-Received: by 2002:a7b:c157:: with SMTP id z23mr8516233wmi.104.1565622855596; Mon, 12 Aug 2019 08:14:15 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Mon, 12 Aug 2019 18:13:10 +0300 Message-Id: <20190812151313.24329-2-stamatis.iliass@gmail.com> In-Reply-To: <20190812151313.24329-1-stamatis.iliass@gmail.com> References: <20190812151313.24329-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.41]); Mon, 12 Aug 2019 15:14:17 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Mon, 12 Aug 2019 15:14:17 +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.84 on 10.5.110.41 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 1/5] 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Mon, 12 Aug 2019 15:14:22 +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 | 67 ++++++++++++++++++++++++++++++++++++++++++ src/test/test_driver.h | 11 +++++++ 2 files changed, 78 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 5f5c512571..7acde811ef 100755 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -396,6 +396,10 @@ struct _testDomainObjPrivate { /* used by get/set time APIs */ long long seconds; unsigned int nseconds; + + /* used by IOThread APIs */ + size_t num_iothreads; + testIOThreadInfoPtr *iothreads; }; @@ -413,6 +417,9 @@ testDomainObjPrivateAlloc(void *opaque) priv->seconds =3D 627319920; priv->nseconds =3D 0; + priv->num_iothreads =3D 0; + priv->iothreads =3D NULL; + return priv; } @@ -2897,6 +2904,65 @@ 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; + testDomainObjPrivatePtr priv; + testIOThreadInfoPtr info; + 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 (!virDomainIOThreadIDAdd(def, iothread_id)) + goto cleanup; + + priv =3D vm->privateData; + + if (VIR_ALLOC(info) < 0) + goto cleanup; + + info->id =3D iothread_id; + info->poll_max_ns =3D 32768; + + if (VIR_APPEND_ELEMENT(priv->iothreads, priv->num_iothreads, info) < 0) + goto cleanup; + + ret =3D 0; + cleanup: + if (ret < 0) { + virDomainIOThreadIDDefFree(iothrid); + VIR_FREE(info); + } + virDomainObjEndAPI(&vm); + return ret; +} + + static int testDomainSetUserPassword(virDomainPtr dom, const char *user ATTRIBUTE_UNUSED, @@ -9351,6 +9417,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.7.0 */ .domainSetUserPassword =3D testDomainSetUserPassword, /* 5.6.0 */ .domainPinEmulator =3D testDomainPinEmulator, /* 5.6.0 */ .domainGetEmulatorPinInfo =3D testDomainGetEmulatorPinInfo, /* 5.6.0 */ diff --git a/src/test/test_driver.h b/src/test/test_driver.h index 8c8a462db7..0ef913fdd3 100644 --- a/src/test/test_driver.h +++ b/src/test/test_driver.h @@ -23,4 +23,15 @@ #include "internal.h" + +typedef struct _testIOThreadInfo testIOThreadInfo; +typedef testIOThreadInfo *testIOThreadInfoPtr; + +struct _testIOThreadInfo { + unsigned int id; + unsigned long long poll_max_ns; + unsigned int poll_grow; + unsigned int poll_shrink; +}; + int testRegister(void); -- 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu Apr 25 19:55:47 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=1565622877; cv=none; d=zoho.com; s=zohoarc; b=UU11vaTctWulj+NL/IW/f8jbmSLxU5cNArfUjQbUcWlZy2Y02HP1LcjKIoWEu2FzHJMyvUCq8aDi+cjqOT0N7fpxpTS4FIIe2AF5vQAuGeUK4iTdxRP33wZMSRoKbDVWdOYzJoq/J46Woiyp4PXhDF1iqdsDBSSS6t+/OVMhCpU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565622877; 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=BTOfgYiRkwDO9DsWUeCLvKki25DTRChovT8UvXnWnnE=; b=S/ybwVL+N1j/kpgL1XrtZBBhdeX/cmUq/RwMVO/k1/Vg4vOuLG5Ej47CuRW0jieKs7HsobtiFfCX5ddcZAVubqZq8y0hX+qRgXmch4NVrvzEBY08xkIEz9Ie8a69v4H2822NgAG+J9JvFiUddF1LlJI6COJMGmGPYNXuhSEbdlM= 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 1565622877343622.1612828925581; Mon, 12 Aug 2019 08:14:37 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id D737B33026D; Mon, 12 Aug 2019 15:14: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 AB82E28DE2; Mon, 12 Aug 2019 15:14:35 +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 DE7A118005B9; Mon, 12 Aug 2019 15:14:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7CFEXLs025964 for ; Mon, 12 Aug 2019 11:14:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id DD0C3277CD; Mon, 12 Aug 2019 15:14:33 +0000 (UTC) Received: from mx1.redhat.com (ext-mx17.extmail.prod.ext.phx2.redhat.com [10.5.110.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D645329348 for ; Mon, 12 Aug 2019 15:14:31 +0000 (UTC) Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) (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 DA18630605F7 for ; Mon, 12 Aug 2019 15:14:29 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id v15so12527288wml.0 for ; Mon, 12 Aug 2019 08:14:29 -0700 (PDT) Received: from archlap.localdomain ([185.32.231.210]) by smtp.gmail.com with ESMTPSA id 24sm10369223wmf.10.2019.08.12.08.14.27 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 12 Aug 2019 08:14:27 -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=gl+3e6XdHZlxJTanl57gOoF8TSw6zl5b3a3wixZbbq0=; b=ogzjHIJqv3RINxI4kve/4GnQnZteN93JHqFkzShwW10OYtJVj+XFxS1LM+oNN2kLZW r6aTf75jJY9cKOkxo2L5ej4cD/6tIC5dbH3Xan/gxYA4EIZmNFRqztTTYXeUELJfrzhE D/DskQPswdY1ah8GR0onk5pxQRQ2Y3WU1JsiEqf1+Ieq0oS240YWOs6xRMF/ELTTZFm7 uouibcaPtoAcup1x3HW9DRA2LGqk/KB+QhlWlf5ZrhL90GdoUO6BUb7Oh9EGUMvWyL2I NOx5Ezoj102MlIFm3pdk8r6mSpFk1Vwo6PSNAuA6GESAFLP2VYYuKuqC91E0H297ducZ gY2Q== 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=gl+3e6XdHZlxJTanl57gOoF8TSw6zl5b3a3wixZbbq0=; b=rw8baVu9O6peLQJzdpeMSduNbIIoN49Zf9m9xn8pX7bxiH5mRvSi2ukBIAV/lmbnkl d3DG0KaE5RkiBTCNmQ0SHjRmrfhevNqq8o38olbg3NWi8eF3ko2jVYneqhiiVHa5cL2+ ooQxC3N0VqHnilr3I1ELJ3j/0lQwl+6pouNZidz37+Vj2VfFnGOynyHUpKL2O90fDrQh cYkzq+aVWOcsMYwrG0qtz9IZvyizQStsfRSXVdUctbn0U29d/aufdn4jqzUhRLcnD047 edKiskQl7DC77fc1JAR0HubMmpeJy3zFtfy7dJEZYjAtqTrGS9VlNt398Oig7biuBKid PvZg== X-Gm-Message-State: APjAAAXH7Q57+YEzUJxL1B87x5mWEsStVmM1lEMcJ4ENFClEXEGgFkEu qjHXova0WQR7O/bDClN8r7bNPuhMUWQ= X-Google-Smtp-Source: APXvYqySKEgXWJ3a7eOcmDNo+ZGBkFv/cpZ7PMXrpLeUxJIV+mdhmG3ilrUZO/T52aWwZB6PM8yozg== X-Received: by 2002:a1c:24c3:: with SMTP id k186mr4119776wmk.126.1565622868233; Mon, 12 Aug 2019 08:14:28 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Mon, 12 Aug 2019 18:13:11 +0300 Message-Id: <20190812151313.24329-3-stamatis.iliass@gmail.com> In-Reply-To: <20190812151313.24329-1-stamatis.iliass@gmail.com> References: <20190812151313.24329-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.46]); Mon, 12 Aug 2019 15:14:30 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Mon, 12 Aug 2019 15:14:30 +0000 (UTC) for IP:'209.85.128.68' DOMAIN:'mail-wm1-f68.google.com' HELO:'mail-wm1-f68.google.com' FROM:'stamatis.iliass@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.541 (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.68 mail-wm1-f68.google.com 209.85.128.68 mail-wm1-f68.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.46 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 2/5] 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 12 Aug 2019 15:14:36 +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 | 85 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 7acde811ef..b4a883cb54 100755 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -2963,6 +2963,90 @@ testDomainAddIOThread(virDomainPtr dom, } +static int +testDomainDelIOThread(virDomainPtr dom, + unsigned int iothread_id, + unsigned int flags) +{ + virDomainObjPtr vm =3D NULL; + virDomainDefPtr def =3D NULL; + testDomainObjPrivatePtr priv; + 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; + } + } + + /* We have already deleted the iothread from the domain definition, now + * let's delete the info structure too from the domain-private data. */ + + priv =3D vm->privateData; + + for (i =3D 0; i < priv->num_iothreads; i++) { + if (iothread_id =3D=3D priv->iothreads[i]->id) { + VIR_DELETE_ELEMENT(priv->iothreads, i, priv->num_iothreads); + break; + } + } + + ret =3D 0; + cleanup: + virDomainObjEndAPI(&vm); + return ret; +} + + static int testDomainSetUserPassword(virDomainPtr dom, const char *user ATTRIBUTE_UNUSED, @@ -9418,6 +9502,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainCoreDump =3D testDomainCoreDump, /* 0.3.2 */ .domainCoreDumpWithFormat =3D testDomainCoreDumpWithFormat, /* 1.2.3 */ .domainAddIOThread =3D testDomainAddIOThread, /* 5.7.0 */ + .domainDelIOThread =3D testDomainDelIOThread, /* 5.7.0 */ .domainSetUserPassword =3D testDomainSetUserPassword, /* 5.6.0 */ .domainPinEmulator =3D testDomainPinEmulator, /* 5.6.0 */ .domainGetEmulatorPinInfo =3D testDomainGetEmulatorPinInfo, /* 5.6.0 */ -- 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu Apr 25 19:55:47 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=1565622889; cv=none; d=zoho.com; s=zohoarc; b=V6PozZkYtaiwqbUE+FBKXIn1Gk0Gaq5IsYT9Aj9ORHjLoiZdg5Q5LRV8Zs30VjR1bhQaTzlMu+OEHXIwqmP+uYflJQS/UZdB2a6X6kY6OO6RKFFXYZNxrmbbTZ77F2SvJzN0LC4HC8Jax+iz9gaOzyAop5Y8VDadzCCaQwKMjdc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565622889; 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=hzgRwpEfF4StWJlx8emi6KGucNAhqZKs4bGGFj6K49o=; b=enfgfnFHd+l7QLSeiDo6gyWxK5Mwi8TAUWL7T2egiPcHsrmpyW0LdbpGU5Vvf6qirqXqaCRToc67PKRhZDDUwpC7uerP++cITlxZMh6cDA1JP45amlWfvDp0RIaCrVKqtRhuUAJnT6M1REAuDZWUnAALWPWVDrHM+eBmXrHeD5Y= 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 1565622889430630.579754675488; Mon, 12 Aug 2019 08:14:49 -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 1522F3066FD9; Mon, 12 Aug 2019 15:14:48 +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 E80AC7D2FE; Mon, 12 Aug 2019 15:14:47 +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 AFEE618005C7; Mon, 12 Aug 2019 15:14:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7CFEktf026018 for ; Mon, 12 Aug 2019 11:14:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id 961F71902F; Mon, 12 Aug 2019 15:14:46 +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 9122113AD1 for ; Mon, 12 Aug 2019 15:14:43 +0000 (UTC) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.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 BBB6913A82 for ; Mon, 12 Aug 2019 15:14:42 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id j16so2630152wrr.8 for ; Mon, 12 Aug 2019 08:14:42 -0700 (PDT) Received: from archlap.localdomain ([185.32.231.210]) by smtp.gmail.com with ESMTPSA id 24sm10369223wmf.10.2019.08.12.08.14.40 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 12 Aug 2019 08:14:40 -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=BpS5IUib2elJrpqJLqQbNumeCG31eR44THPQdHGWuWw=; b=YCYrV+s2R026BmGNaqJbK83HYP5TvxPDsB0yg33NCIw8d/2Hs2b7pWnjqFtrRCA07k w0QopnqHi6GfVXNheYVhC561JVEjz0oiUuSjqJROPootbtcGRHIxoOqixNNsVnVSTfnv gqlaM5owvkzExCd57wiOJqOrWwBWDY1oJz5lD2Wcw5yiECkiTPwqkaX56ssdTvJVzLVz gFbg5I6awSOxdi11uJXQGZYXSQyUfDTkaLiJwqwMqihC7GyGT5YBJZntiKy0b8qRw8RW kOBNJXSsChzAelvaQpV3ay9ViiLZHgmWnVFzWnjUju7LXoRkJBcZx68LeZt0PeqOirQc ZNCA== 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=BpS5IUib2elJrpqJLqQbNumeCG31eR44THPQdHGWuWw=; b=mc2izqsVb6l6n6LL4LlyEkpbae6nSAMQxxMyET0jQiS99UhjV/iGCKClyjocreBjtS WY87UHpgLG+QJuYFiYCDIDg4OktJ3Cg6x+kULPU4rHeBw1RmJf7stwKlf/27eO/pYYJM fUBv8Dt2sMK0YvTyLNWvUDeIpV2nBDscPaXipAC4vwBDCD5RoKhnFDiJoTa9BPMJuWyL GN7HuwZSzTt26hFVXs9cxUmmGZLQ8mWX8Y9s8ajrRKfuC9Djg+SQrATQazMZi82PNv91 5YvMcGEuDuWPlqpldwmA7nPHIT8NDLQL7LI6ReC5UFrfVgLxsSgGSanxdU6NcyuUOcb8 8PAw== X-Gm-Message-State: APjAAAVaMS5I5mo1pWYypIZzW48K7HfUXPwnokd2dEP0o0AU7UvkMc2G 2SgG1RxCdVUsUqROQsifFzWVe1m2iUw= X-Google-Smtp-Source: APXvYqzM12w2Rs2+Vel946vJw2gaMOGJG40C6A9MvH7mkHwAI8GHiQSigJ7WiSf0lyviYIOw6sZDiw== X-Received: by 2002:a5d:63d0:: with SMTP id c16mr36626949wrw.22.1565622881121; Mon, 12 Aug 2019 08:14:41 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Mon, 12 Aug 2019 18:13:12 +0300 Message-Id: <20190812151313.24329-4-stamatis.iliass@gmail.com> In-Reply-To: <20190812151313.24329-1-stamatis.iliass@gmail.com> References: <20190812151313.24329-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]); Mon, 12 Aug 2019 15:14:43 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 12 Aug 2019 15:14:43 +0000 (UTC) for IP:'209.85.221.67' DOMAIN:'mail-wr1-f67.google.com' HELO:'mail-wr1-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.221.67 mail-wr1-f67.google.com 209.85.221.67 mail-wr1-f67.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 3/5] 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Mon, 12 Aug 2019 15:14:48 +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 b4a883cb54..60d611245d 100755 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -3047,6 +3047,56 @@ testDomainDelIOThread(virDomainPtr dom, } =20 =20 +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, @@ -9503,6 +9553,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainCoreDumpWithFormat =3D testDomainCoreDumpWithFormat, /* 1.2.3 */ .domainAddIOThread =3D testDomainAddIOThread, /* 5.7.0 */ .domainDelIOThread =3D testDomainDelIOThread, /* 5.7.0 */ + .domainPinIOThread =3D testDomainPinIOThread, /* 5.7.0 */ .domainSetUserPassword =3D testDomainSetUserPassword, /* 5.6.0 */ .domainPinEmulator =3D testDomainPinEmulator, /* 5.6.0 */ .domainGetEmulatorPinInfo =3D testDomainGetEmulatorPinInfo, /* 5.6.0 */ --=20 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu Apr 25 19:55:47 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=1565622910; cv=none; d=zoho.com; s=zohoarc; b=XYFkJpgnsbIcZkbwMA33MI7ZdVz4M8Mob5nxyCYK2w6dQJbPGgQfSe0CMyepw9ceuuLzwnnYX/wpPX2ULeySllCt7SP9fE245plg7Axvs7DjtWz1S2WfXjvHiRW5TWD5+Gwsxsy3S/+kjC3QE8Bx959PVAYJUSnJhGdqAs9U+fA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565622910; 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=Vncz/tsjpxgsP6xwWzLpHTTYwJIrGQZi3QieDMnKC2A=; b=PUPtfHHWIgS0jMHdIIP44ehHAtjnNVgJodrYNAMzYZszHFra0IN0Zep3UBGcaMgYhkigya+iM5NrNDLQ6gVhR6EO7kgRsCWxJ1KS21W3ysYz3ZufYXx1RvUyEBLy0aYSH+EyjCTag5btIXX4RPlA3wIrKWNTjdJ7xAYpLr+WVYg= 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 1565622910976692.0895968004493; Mon, 12 Aug 2019 08:15:10 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 8886630EA19F; Mon, 12 Aug 2019 15:15:09 +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 59FD32A16F; Mon, 12 Aug 2019 15:15:09 +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 E9FEB24F30; Mon, 12 Aug 2019 15:15:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7CFF72k026079 for ; Mon, 12 Aug 2019 11:15:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4252E1009976; Mon, 12 Aug 2019 15:15:07 +0000 (UTC) Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3B580100EBD4 for ; Mon, 12 Aug 2019 15:15:02 +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 DA79FC075BD2 for ; Mon, 12 Aug 2019 15:15:00 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id v15so12529099wml.0 for ; Mon, 12 Aug 2019 08:15:00 -0700 (PDT) Received: from archlap.localdomain ([185.32.231.210]) by smtp.gmail.com with ESMTPSA id 24sm10369223wmf.10.2019.08.12.08.14.58 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 12 Aug 2019 08:14: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=uI2dq/XuxfikOKNb+XED3AwTVuv9FcD1vFzGqdJvLHU=; b=WiyXpS1sW8UNOGKV89U8cOuEl0lqiApkQgofOmWHlQkK4ySFikG0fPt9pBySORyvks DQxGDl3ClZ07T4/+TBUB9XMuTUJ/ntuCl1Hn6IXelVbr0JQt0GWNZ7kiu7uX2QueZrRc n/PNo8X0J8J9vHC17TVf7Hck/It07XF5fJrkTffB6ypNnoLCiaOrYScMl31CAKiB9e+8 1uyuyxWb4zTIebpXJOL8DCon8dHyRUSjfcHdoIlgYHsLQzIBGf+GWNYt0M+2gu8Hmh9H HdHFHVvSh8BMQFjUUp56DIW1gdqkWl0DVeYjySR8OzNPqQmkctSjdI3qDhiKj021H04U bEDw== 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=uI2dq/XuxfikOKNb+XED3AwTVuv9FcD1vFzGqdJvLHU=; b=cSJgvR7P9MN0aE4RrHrqtxJBHiv4Tvh22OZfKCqjcPfYGdZUff8yKkzXlyXaSvhafl 8t+amJyJK4zpI4Dfrbuniayd8T9/1g+V9hjyu7nTIdhhWIDvOCJtpXngJRvAmn8nX40C I9a+qYfc28TWcWzaRk7x5bFJkT9R4285UadByoJNP1fCKueki21f+aCn2aBr7092XtWM XEnWWiEj4KDW2zlZPIEfihB5MHQR5i6JLUOAYop0lCSkTQE87Bv7N+FH1E//iZw/xNoO 8JOp9dgqYAOh/Gs1P8VmnhYaIx0kmtd8rKXyv4PwXGiud4hvR4uLj8u3Q93YoHYLcrBp lh7A== X-Gm-Message-State: APjAAAUcjKOc5bBCMmcC7kY9E+C6tFqf/Mwhd8MHqiPjIwIrXZ/erCl1 7Q3a4T/0Cgdik7Eo0ZsFIIh3DpQXkAw= X-Google-Smtp-Source: APXvYqxeZ4uJdQMvnrVdlLHLjB9wUbHS88MJpDZOCXXPYbDN+WHCUFPUtl8eM5nIcbMpmTmbkgpNEw== X-Received: by 2002:a7b:c310:: with SMTP id k16mr27096433wmj.133.1565622899240; Mon, 12 Aug 2019 08:14:59 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Mon, 12 Aug 2019 18:13:13 +0300 Message-Id: <20190812151313.24329-5-stamatis.iliass@gmail.com> In-Reply-To: <20190812151313.24329-1-stamatis.iliass@gmail.com> References: <20190812151313.24329-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.31]); Mon, 12 Aug 2019 15:15:01 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 12 Aug 2019 15:15:01 +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.31 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 4/5] 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.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Mon, 12 Aug 2019 15:15:10 +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 60d611245d..7eef54bb05 100755 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -3097,6 +3097,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) + goto cleanup; + + 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, @@ -9554,6 +9627,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainAddIOThread =3D testDomainAddIOThread, /* 5.7.0 */ .domainDelIOThread =3D testDomainDelIOThread, /* 5.7.0 */ .domainPinIOThread =3D testDomainPinIOThread, /* 5.7.0 */ + .domainGetIOThreadInfo =3D testDomainGetIOThreadInfo, /* 5.7.0 */ .domainSetUserPassword =3D testDomainSetUserPassword, /* 5.6.0 */ .domainPinEmulator =3D testDomainPinEmulator, /* 5.6.0 */ .domainGetEmulatorPinInfo =3D testDomainGetEmulatorPinInfo, /* 5.6.0 */ -- 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu Apr 25 19:55:47 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=1565622928; cv=none; d=zoho.com; s=zohoarc; b=j21zCdVYhGOANJModFAdUjMnm21NUXVMIZaCGUq83AwojU/T5Jxt/VeLq/A6EfCuLzYrjE76RCU7ZHBnRh3+pf+7QX9fzHv1nWmLtLUdCuytd+617uXoi9oIDrZ/WknQu8PX9rFcLqh1/syBhknFKAXyipQlMbPZghtjVz7jaU0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565622928; 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=oMfl3kfuhXS3E2kfEN/1LgWLoabOs/F3gEkOOR+4Dbk=; b=SbYVH3fiYATCogLd3sw1cocerqO8mP5bget5l0LOFNNQiPe0ByImn/5aNfOLNljilF3f6dXzqo5fCoQR38aorZfT6YvU6di2b6W7PODKS/phbDa0qIsLyMbeoATzPrwB9NmoStoH8BaazUK1Y1UMySL1j3wt5Qg22SlyVvOFODg= 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 1565622928425969.7024837397867; Mon, 12 Aug 2019 08:15:28 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 3C8466412E; Mon, 12 Aug 2019 15:15:26 +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 12B3529376; Mon, 12 Aug 2019 15:15:26 +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 B15A324F32; Mon, 12 Aug 2019 15:15:25 +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 x7CFFOWH026106 for ; Mon, 12 Aug 2019 11:15:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id EBC806F98E; Mon, 12 Aug 2019 15:15:24 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E5B776F988 for ; Mon, 12 Aug 2019 15:15:18 +0000 (UTC) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) (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 5F1723B74C for ; Mon, 12 Aug 2019 15:15:17 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id p17so104880827wrf.11 for ; Mon, 12 Aug 2019 08:15:17 -0700 (PDT) Received: from archlap.localdomain ([185.32.231.210]) by smtp.gmail.com with ESMTPSA id 24sm10369223wmf.10.2019.08.12.08.15.14 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 12 Aug 2019 08:15:15 -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=aBUlxdm8cV550WUXmyNCLFesALx8F4ZtNaC/2qvy9FY=; b=otXbfn/B2LcvBR5IfTNijf3tePK42R8ilPQMqmtE23TSfTWAWDToe1xXMRAfUCWnp3 WrAHfTKd7H2xdxQ9E/LrnSZfn9TZOvLUF7X0QXZC5PxWA7CCDjTU9KgQByPLGy8osBQT m8O51GD4Oeoh+bn3XNbv5NhxRhhcW2XJl8/IR+fIOJJwe//gS5HeOsHihR9snQjgmYRa C9eaMhWRRzH52xR8aZ71MhDxP/2I+KrWJucfeYcRGqzTIRSQCQekyqIk0Ku6FoUqo+RA 4W/GQ9C/0Ueh/wu6l5E9+PZKg/EmyuAoH21MJ/h3r+ss3184we8a1BtgZVkutMEVIK5P ZKzg== 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=aBUlxdm8cV550WUXmyNCLFesALx8F4ZtNaC/2qvy9FY=; b=A3MrfBeguP7hDR+VBgB+JQAcMwawWLzAJYpDD3uCzxNOOfHBAmgS2fP8RVtHVnkV9k LSa/ujU9Wmk0GQpNU7+1XWk7ecOuBvUgxK3anM/6veXyCdHVl62Gut0zw8T32L2/hM5/ Zx5kb/20NNbSxnv112hgSZtUWOVXMDDtwShfwIsXI0jowZzXZA8/ItGT7kjgSOx247DR iCVO6iGZfAA7HQSuPwo3GDkunDc84AfJfKmPyCfg5qrWhUuGYphn6MngguS5IHvwqlnc LiorAK9qldE+5xobawKqqhN88JzaYSCAdm6DlYA3k9pzILOQatO0kvefvm5UGYiVy8gb 4JAg== X-Gm-Message-State: APjAAAVmZeWEtqW2xdQQw4dEnmJedjutoEoR6aYxRU1cs2okhGt1gl8f RGHGHNdpaMs1awZvRtCkzF3QzgTYa+4= X-Google-Smtp-Source: APXvYqxYuMXlbuV4zLJCFaN955c4MzQJMjAhJktYdmURFa4i/BEknKQGY/4dt0Q8pSkqwBPhxQBmIg== X-Received: by 2002:adf:eac3:: with SMTP id o3mr4563272wrn.264.1565622915724; Mon, 12 Aug 2019 08:15:15 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Mon, 12 Aug 2019 18:13:14 +0300 Message-Id: <20190812151313.24329-6-stamatis.iliass@gmail.com> In-Reply-To: <20190812151313.24329-1-stamatis.iliass@gmail.com> References: <20190812151313.24329-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.30]); Mon, 12 Aug 2019 15:15:17 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 12 Aug 2019 15:15:17 +0000 (UTC) for IP:'209.85.221.68' DOMAIN:'mail-wr1-f68.google.com' HELO:'mail-wr1-f68.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.68 mail-wr1-f68.google.com 209.85.221.68 mail-wr1-f68.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 5/5] test_driver: implement virDomainSetIOThreadParams 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.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 12 Aug 2019 15:15:26 +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 | 85 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 7eef54bb05..6274d5bf0f 100755 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -3170,6 +3170,90 @@ testDomainGetIOThreadInfo(virDomainPtr dom, } +static int +testDomainSetIOThreadParams(virDomainPtr dom, + unsigned int iothread_id, + virTypedParameterPtr params, + int nparams, + unsigned int flags) +{ + virDomainObjPtr vm =3D NULL; + virDomainDefPtr def =3D NULL; + testDomainObjPrivatePtr priv; + testIOThreadInfo info_copy; + testIOThreadInfoPtr infop =3D NULL; + 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 (!(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; + } + + if (virTypedParamsValidate(params, nparams, + VIR_DOMAIN_IOTHREAD_POLL_MAX_NS, + VIR_TYPED_PARAM_ULLONG, + VIR_DOMAIN_IOTHREAD_POLL_GROW, + VIR_TYPED_PARAM_UINT, + VIR_DOMAIN_IOTHREAD_POLL_SHRINK, + VIR_TYPED_PARAM_UINT, + NULL) < 0) + goto cleanup; + + priv =3D vm->privateData; + + for (i =3D 0; i < priv->num_iothreads; i++) { + if (iothread_id =3D=3D priv->iothreads[i]->id) { + infop =3D priv->iothreads[i]; + break; + } + } + + if (!infop) + goto cleanup; + + memcpy(&info_copy, infop, sizeof(testIOThreadInfo)); + + if (virTypedParamsGetULLong(params, nparams, + VIR_DOMAIN_IOTHREAD_POLL_MAX_NS, + &info_copy.poll_max_ns) < 0) + goto cleanup; + + if (virTypedParamsGetUInt(params, nparams, + VIR_DOMAIN_IOTHREAD_POLL_GROW, + &info_copy.poll_grow) < 0) + goto cleanup; + + if (virTypedParamsGetUInt(params, nparams, + VIR_DOMAIN_IOTHREAD_POLL_SHRINK, + &info_copy.poll_shrink) < 0) + goto cleanup; + + memcpy(infop, &info_copy, sizeof(testIOThreadInfo)); + + ret =3D 0; + cleanup: + virDomainObjEndAPI(&vm); + return ret; +} + static int testDomainSetUserPassword(virDomainPtr dom, const char *user ATTRIBUTE_UNUSED, @@ -9628,6 +9712,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainDelIOThread =3D testDomainDelIOThread, /* 5.7.0 */ .domainPinIOThread =3D testDomainPinIOThread, /* 5.7.0 */ .domainGetIOThreadInfo =3D testDomainGetIOThreadInfo, /* 5.7.0 */ + .domainSetIOThreadParams =3D testDomainSetIOThreadParams, /* 5.7.0 */ .domainSetUserPassword =3D testDomainSetUserPassword, /* 5.6.0 */ .domainPinEmulator =3D testDomainPinEmulator, /* 5.6.0 */ .domainGetEmulatorPinInfo =3D testDomainGetEmulatorPinInfo, /* 5.6.0 */ -- 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list