From nobody Sun Feb 8 22:58:12 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=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