From nobody Thu Mar 28 20:16:24 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=1565687926; cv=none; d=zoho.com; s=zohoarc; b=NRFa2vKS5ob1Ks8id70KDw3pc5WGrQAEJbWMi7h1bTTCjO4riEo5OKmgM33o+f8F0ODgVneFVbGXp3Pn3gRCjkzs0imKrCIGxwFqGfFufpqpv3qlkp0XsSA+6nGpaZRPI9eLxlxAlSUGOekF4gQQNrAxBTlBM9uEzMN3Oee4Llg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565687926; 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=h2sGReutbblUSmCkN/s+b50f3iZXOsRWtbL2qW98JJE=; b=YkE7OQ6+LCacGENFZEiW1O67RL/v/sHgbueNURi8pC3sk0Yfb+Nu5yLmPeZC7x471BleOfctHyygtTSWWl1/20BwDFzA+OqxHrQlD2EP4H6FOruRJbhMOiCE4JO+avBOhLNVqECKSs87E29HuwF7EtoqOXbFPDC4Uhr74GrdusQ= 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 1565687926392573.5450743928222; Tue, 13 Aug 2019 02:18:46 -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 E7BDF307D934; Tue, 13 Aug 2019 09:18:44 +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 92ACF82477; Tue, 13 Aug 2019 09:18:44 +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 0FABF2551C; Tue, 13 Aug 2019 09:18:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7D9IgGm027472 for ; Tue, 13 Aug 2019 05:18:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8567682477; Tue, 13 Aug 2019 09:18:42 +0000 (UTC) Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8086982481 for ; Tue, 13 Aug 2019 09:18:40 +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 611EF8535C for ; Tue, 13 Aug 2019 09:18:39 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id y8so1124151wrn.10 for ; Tue, 13 Aug 2019 02:18:39 -0700 (PDT) Received: from archlap.localdomain ([185.32.231.210]) by smtp.gmail.com with ESMTPSA id z18sm649529wml.10.2019.08.13.02.18.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Aug 2019 02:18:37 -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=Evxel2o3VPZNd7gW73Cewc32uxwdPBwfQQFsGKFbbGw=; b=POUwBdTI/GsqMUdmrNNiszSPNKYhXsePQk46lKMZqUsaAwFieDMfvYzHyz3ShdNpQX gcBrAM+h+jn/sJU4EZKSbm1P7ypop6mOZqlC7pr4QZnRxen6Syp/F4StgatqzHlri/FQ eHVxYK6A+lo0ez29l4kprHFdKQiETyxgvJupWKAYzWG/nWdyP4F6gB7/3IhT/4B1/HuG hJzgIGwpcVQFcOQcXMh0ECSoyq1kM9DAUlYRIdQR21Sk1g1x82hWaomHErmZJuT0ydXq MVDGlHJ0cigvbPQf+xb8VvyJ+4wSRJlxF/7GF99fL+8ZnlPReMRfhVF1tOGQ8DGyGpVU SyjA== 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=Evxel2o3VPZNd7gW73Cewc32uxwdPBwfQQFsGKFbbGw=; b=qBvDVnZRr/6ijfT1HpnDZ+NxRk3r+tAnFRO/sjt3Sfa3RKU8qtku1PLXtx4QsQI5nH G0mcj8DZsOktxzr8HvGt1Bo0H1OzS0i/VjG82HvyXDYkNW+NcD/lF1+fn4a4teBE/6Nr OqfO9YXlUrLrbPfQ3o5UhQVVnVx6dYwqk7GMHETKAxItpWw/bjmN/9f/wWX+t3aG7spJ b9VWK3lm0oL0XcA4n89Mbdu8Xh7DLYI22qPZKVfsBmTSJ+/MNGjDdFpvD/ymSp43Z+ln 7qFh7sIBeyfSabsJQCk9dGdc4tSgq29CPCQhYH+yx++54D9CxZxHylASWcy77h4rCuep qIJA== X-Gm-Message-State: APjAAAVf48heXj64dKOjxsxMxWTdciAzPBPQfa7CJKCcVU7JgBv/rTtg U0qfKHkRdksGfhBXfNaTJWGLfiZZZ9s= X-Google-Smtp-Source: APXvYqzqB33kVLp48G3jx7bDYklq5RvLUO45x9xTrzfU/X+IAN9+yrQdjDtnqJRrD2YdWWpCP4boxA== X-Received: by 2002:a5d:4108:: with SMTP id l8mr21161209wrp.113.1565687917747; Tue, 13 Aug 2019 02:18:37 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Tue, 13 Aug 2019 12:17:59 +0300 Message-Id: <20190813091800.1565-2-stamatis.iliass@gmail.com> In-Reply-To: <20190813091800.1565-1-stamatis.iliass@gmail.com> References: <20190813091800.1565-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.25]); Tue, 13 Aug 2019 09:18:39 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 13 Aug 2019 09:18:39 +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.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.221.68 mail-wr1-f68.google.com 209.85.221.68 mail-wr1-f68.google.com X-Scanned-By: MIMEDefang 2.83 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/2] test_driver: implement virDomainGetBlkioParameters 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.48]); Tue, 13 Aug 2019 09:18:45 +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 | 47 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 5f5c512571..a2a8599dac 100755 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -3964,6 +3964,52 @@ testDomainGetBlockIoTune(virDomainPtr dom, #undef TEST_SET_PARAM +static int +testDomainGetBlkioParameters(virDomainPtr dom, + virTypedParameterPtr params, + int *nparams, + unsigned int flags) +{ + virDomainObjPtr vm =3D NULL; + virDomainDefPtr def =3D NULL; + int maxparams =3D 6; + int ret =3D -1; + + virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | + VIR_DOMAIN_AFFECT_CONFIG | + VIR_TYPED_PARAM_STRING_OKAY, -1); + + if ((*nparams) =3D=3D 0) { + *nparams =3D 6; + return 0; + } else if (*nparams < maxparams) { + maxparams =3D *nparams; + } + + if (!(vm =3D testDomObjFromDomain(dom))) + return -1; + + if (!(def =3D virDomainObjGetOneDef(vm, flags))) + goto cleanup; + + *nparams =3D 0; + + if (virTypedParameterAssign(&(params[(*nparams)++]), + VIR_DOMAIN_BLKIO_WEIGHT, + VIR_TYPED_PARAM_UINT, + def->blkio.weight) < 0) + goto cleanup; + + if (virDomainGetBlkioParametersAssignFromDef(def, params, nparams, max= params) < 0) + goto cleanup; + + ret =3D 0; + cleanup: + virDomainObjEndAPI(&vm); + return ret; +} + + static int testConnectNumOfDefinedDomains(virConnectPtr conn) { testDriverPtr privconn =3D conn->privateData; @@ -9371,6 +9417,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainGetInterfaceParameters =3D testDomainGetInterfaceParameters, /*= 5.6.0 */ .domainSetBlockIoTune =3D testDomainSetBlockIoTune, /* 5.7.0 */ .domainGetBlockIoTune =3D testDomainGetBlockIoTune, /* 5.7.0 */ + .domainGetBlkioParameters =3D testDomainGetBlkioParameters, /* 5.7.0 */ .connectListDefinedDomains =3D testConnectListDefinedDomains, /* 0.1.1= 1 */ .connectNumOfDefinedDomains =3D testConnectNumOfDefinedDomains, /* 0.1= .11 */ .domainCreate =3D testDomainCreate, /* 0.1.11 */ -- 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu Mar 28 20:16:24 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=1565687934; cv=none; d=zoho.com; s=zohoarc; b=G70v/qHcePP2uDqh2Xdkb2pb5UZ/+CR7R6OS8IGxCXYrZMyaz9cpGTMDqnArwSlQ4+J9VJN/vqlEsV36JHQNds9l0pTTmfn8xD1Onjt3kEOKxvbdXPmcLkqBtwEwlwHTMkdJmZCFBKCJaZGeyhr7+testaEIuJjHB0moI9J9vOA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565687934; 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=rTkzaGJo0dSQwv49E4ER09A+t7esjWdiqZYM9mDI1Og=; b=Mcwc3pQr9ElmQCQxH+PBFPdez6p6Ei3Cpd3Qs/REOzNKuTejR3dWS4r/cftx2okFgNTYTbJOLpRb+f9E+oF/JD+SD3w8dNdzsq+JT+Pcyq6kW07144CeiNNI37xr3ui07e/14cLouQqchiOQNBTV+6reie619pmQZQvXj7ysf48= 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 1565687934502724.9712083715999; Tue, 13 Aug 2019 02:18:54 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EA14B3082B5A; Tue, 13 Aug 2019 09:18:52 +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 C3D077D49A; Tue, 13 Aug 2019 09:18:52 +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 8E20F2551F; Tue, 13 Aug 2019 09:18:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7D9Iq7Y027488 for ; Tue, 13 Aug 2019 05:18:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1CF918247B; Tue, 13 Aug 2019 09:18:52 +0000 (UTC) Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1851F82478 for ; Tue, 13 Aug 2019 09:18:51 +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 E0C918535C for ; Tue, 13 Aug 2019 09:18:50 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id r1so7975879wrl.7 for ; Tue, 13 Aug 2019 02:18:50 -0700 (PDT) Received: from archlap.localdomain ([185.32.231.210]) by smtp.gmail.com with ESMTPSA id z18sm649529wml.10.2019.08.13.02.18.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Aug 2019 02:18:48 -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=mU1trDgksQh2zJ/jtFXZoU3i6BveuOufoybuOamDS3M=; b=PU4nkg77pUGsfrIaUa5avxWJIZfqn/ffknjdJnpRL8du4G2h//gaTb1c6JjDYVVNkK wKZRouU1vWJ2x4lDUoRcQp0H0UtxYYQhKIfHUuT8P/4ErNy42cyvoqiASuwA10qBykIA HcDowIljIIncgtsHOx4rMGteFrIwBo1qug2uEgEWOiAghKe7O79ChNQlWRg2ZZfX48NB RjxuX+mrKWYU7PN1Rjqt0eGAHlXL7oTyxdC1mw6VooA50LIFnIhRwA9TdVxDjlPZ1zwc bXAVshqArXkO/iRhsmKpJ7har8aRswE0Yghj27+ACxJGzS1TLSP6BV4G1dJqnX3Bf8/n S2IA== 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=mU1trDgksQh2zJ/jtFXZoU3i6BveuOufoybuOamDS3M=; b=n/fBa1iaMIKvqaCN4nJj3IpUUWJ9Uu3UTZpLyrU7ObM2T4elIEZjEJKrwHpY9x0SMt VqMeX+w8BuQ0DcL6J9xk4j43NKVU6+fe4HLP+FMV3Tny5Sq6oL8FepAR0g6XfVMDHGDf qzOVFTTNPVr9uF5CHiIhaJpnlR0nxx5loZMk0+/XE1ErKmckXIJgiAVcl7ZBlO09d4L2 zNxitgLOV3P5SztzXpwwmf8cxRGHyl6kK45rLkjhwK9KS+U4dp1XBaFHSn3Jq+LTCNO0 /6rLjeGhsFAkDNdt2QuJeJRHw3ohMvuXKeILBFByrzO+ZZhPzltf13ROmIXoR4OlPw1h a3lA== X-Gm-Message-State: APjAAAVtCvtM/jduLVsLPdcwUxv15LldGNZAFaRWQDKehjhWeJGTkhSK AT7hyeTPUTMpOUxksXLt8knx4pT3gXI= X-Google-Smtp-Source: APXvYqyPxvIjSk8noBum0doANGBKSzUu/mq6rwlqHA/NsoMWZzaWlZwvgJTFETtHW/qVlOZgxUGiTg== X-Received: by 2002:adf:a2cd:: with SMTP id t13mr25744876wra.251.1565687929226; Tue, 13 Aug 2019 02:18:49 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Tue, 13 Aug 2019 12:18:00 +0300 Message-Id: <20190813091800.1565-3-stamatis.iliass@gmail.com> In-Reply-To: <20190813091800.1565-1-stamatis.iliass@gmail.com> References: <20190813091800.1565-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.25]); Tue, 13 Aug 2019 09:18:51 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 13 Aug 2019 09:18:51 +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.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.221.68 mail-wr1-f68.google.com 209.85.221.68 mail-wr1-f68.google.com X-Scanned-By: MIMEDefang 2.83 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/2] test_driver: implement virDomainSetBlkioParameters 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Tue, 13 Aug 2019 09:18:53 +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 | 76 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index a2a8599dac..e961e696eb 100755 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -3964,6 +3964,81 @@ testDomainGetBlockIoTune(virDomainPtr dom, #undef TEST_SET_PARAM +static int +testDomainSetBlkioParameters(virDomainPtr dom, + virTypedParameterPtr params, + int nparams, + unsigned int flags) +{ + virDomainObjPtr vm =3D NULL; + virDomainDefPtr def =3D NULL; + size_t i; + int ret =3D -1; + + virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | + VIR_DOMAIN_AFFECT_CONFIG, -1); + + if (virTypedParamsValidate(params, nparams, + VIR_DOMAIN_BLKIO_WEIGHT, + VIR_TYPED_PARAM_UINT, + VIR_DOMAIN_BLKIO_DEVICE_WEIGHT, + VIR_TYPED_PARAM_STRING, + VIR_DOMAIN_BLKIO_DEVICE_READ_IOPS, + VIR_TYPED_PARAM_STRING, + VIR_DOMAIN_BLKIO_DEVICE_WRITE_IOPS, + VIR_TYPED_PARAM_STRING, + VIR_DOMAIN_BLKIO_DEVICE_READ_BPS, + VIR_TYPED_PARAM_STRING, + VIR_DOMAIN_BLKIO_DEVICE_WRITE_BPS, + VIR_TYPED_PARAM_STRING, + NULL) < 0) + return -1; + + if (!(vm =3D testDomObjFromDomain(dom))) + return -1; + + if (!(def =3D virDomainObjGetOneDef(vm, flags))) + goto cleanup; + + ret =3D 0; + + for (i =3D 0; i < nparams; i++) { + virTypedParameterPtr param =3D ¶ms[i]; + + if (STREQ(param->field, VIR_DOMAIN_BLKIO_WEIGHT)) { + def->blkio.weight =3D param->value.ui; + } else if (STREQ(param->field, VIR_DOMAIN_BLKIO_DEVICE_WEIGHT) || + STREQ(param->field, VIR_DOMAIN_BLKIO_DEVICE_READ_IOPS) = || + STREQ(param->field, VIR_DOMAIN_BLKIO_DEVICE_WRITE_IOPS)= || + STREQ(param->field, VIR_DOMAIN_BLKIO_DEVICE_READ_BPS) || + STREQ(param->field, VIR_DOMAIN_BLKIO_DEVICE_WRITE_BPS))= { + virBlkioDevicePtr devices =3D NULL; + size_t ndevices; + + if (virDomainParseBlkioDeviceStr(param->value.s, + param->field, + &devices, + &ndevices) < 0) { + ret =3D -1; + continue; + } + + if (virDomainMergeBlkioDevice(&def->blkio.devices, + &def->blkio.ndevices, + devices, ndevices, param->field)= < 0) + ret =3D -1; + + virBlkioDeviceArrayClear(devices, ndevices); + VIR_FREE(devices); + } + } + + cleanup: + virDomainObjEndAPI(&vm); + return ret; +} + + static int testDomainGetBlkioParameters(virDomainPtr dom, virTypedParameterPtr params, @@ -9417,6 +9492,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainGetInterfaceParameters =3D testDomainGetInterfaceParameters, /*= 5.6.0 */ .domainSetBlockIoTune =3D testDomainSetBlockIoTune, /* 5.7.0 */ .domainGetBlockIoTune =3D testDomainGetBlockIoTune, /* 5.7.0 */ + .domainSetBlkioParameters =3D testDomainSetBlkioParameters, /* 5.7.0 */ .domainGetBlkioParameters =3D testDomainGetBlkioParameters, /* 5.7.0 */ .connectListDefinedDomains =3D testConnectListDefinedDomains, /* 0.1.1= 1 */ .connectNumOfDefinedDomains =3D testConnectNumOfDefinedDomains, /* 0.1= .11 */ -- 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list