From nobody Tue Nov 26 21:30:57 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=1564239935; cv=none; d=zoho.com; s=zohoarc; b=Dfyp0QBzCkQ6UAP7POZRmRlrG3j5qwxsoBxGu5X370KKn8N1jHkAa+ikld/phbzPJ+IkrmqA7EnsOKTuPJWMrFsCR0XGXXglwC/5PCxRJmxmWozPpQP8jZCMPuqUPN3cnCvzGVx655Q8r2dHZ0fNAkXTIlrgk8mxGs6fruSpihE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564239935; 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=GkeLlwLvuNuuz7BYglxBox3Tal412Tf/q1H1M1Xy8SE=; b=ZNUx8CQtTKo91Qwhqrc463fN7kGAZuLSJcdJ+K2IPSlLXkabSCNLUYdPZ+EuO1LXWX15x9qV/tjWHdhoaY9m8elmVdsclGd/KP9MmFk/Y8gzqjV+6PHcKYlz9YReOwWvQoWIyVIyGMUHLxmm3ojVshVEDH8pJvXo2/m+/n0/P5E= 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 1564239935842117.80338223798242; Sat, 27 Jul 2019 08:05:35 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5E6D63082DDD; Sat, 27 Jul 2019 15:05:34 +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 E7AFF6092D; Sat, 27 Jul 2019 15:05:33 +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 A20A341F63; Sat, 27 Jul 2019 15:05:33 +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 x6RF5XLh013189 for ; Sat, 27 Jul 2019 11:05:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0ABAD5DA97; Sat, 27 Jul 2019 15:05:33 +0000 (UTC) Received: from mx1.redhat.com (ext-mx14.extmail.prod.ext.phx2.redhat.com [10.5.110.43]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 045B367138 for ; Sat, 27 Jul 2019 15:05:30 +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 D331F308FC4B for ; Sat, 27 Jul 2019 15:05:29 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id h19so39929490wme.0 for ; Sat, 27 Jul 2019 08:05:29 -0700 (PDT) Received: from archpc.localdomain (x8d1ee222.agdsn.tu-dresden.de. [141.30.226.34]) by smtp.gmail.com with ESMTPSA id g131sm39428925wmf.37.2019.07.27.08.05.27 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 27 Jul 2019 08:05: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=Ft+A0KUw+DAEZRIrWlR1FGWEj6JZ9TKs3XjmxV7LxEY=; b=AE9LF0XvpF+YS6gcIo/wde6kXt4G/kdhE+hBcSNe7H32YkzUMoYCmc5Hu/N8Ey9OwY fE81LuqDyNh1UHdLJpXP2CCqzSJTGr05GRbS6FjL4sEC+dmW6VPgzPAytxZO2kGXs9T3 yv3aGmKhp4Z0Kh2SFmzWrEaXSrxJ+HqGyblQyW38xTkJK7jbw7zR46QZDkj4HTcJs7Sq unbfMQ0K+nNuyQjs/ph5HxnB9Awx94FOiDMFlXcDkJdIw02es9KdLxc5HKM2SCHfL7Ok Sr6KtvjwZvJ6sEhUVAaqtWlkpg+0ZHKSTchPoenGqCkZRDDBnZSEMdXmxmkxMVZTHxBM FdLg== 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=Ft+A0KUw+DAEZRIrWlR1FGWEj6JZ9TKs3XjmxV7LxEY=; b=g2qUiglNRta+NbZcyFv9vvU6hn7T6ekmMSTSYkGb0cHnEEGAAJjkrSvQYhSjS9nDsC rnL7pUsZgk7m8rLc8JQlPEK1RN6mJIqilA2aRSWddytTK2HrWcohfco+l09UqGodJsok sHYC4SyjGJxAWe0k0AF5TzCmSA8mgyXJwLgUrLz2syyACczkiCq6d0YGrwKFSY/b5/8L wFq3dpCRgTWmpvByWdMYh2LONyXzDTa0vhB79PJGVPGK1diNm8wfRirod5ojbaSoTHPF YlmLAgJpT1SMFGV06/N6nd64P3XeAdmelEBlXclCZ1Gs6o4Pim6ojGl/hSkkoA7Hmxsu 25Yg== X-Gm-Message-State: APjAAAWLVLLt0jXHMobzzIZZPf410grscbGiQpxDiSRJdgXvvjcF/GQ2 3tvnEXXG6i2WD6u9mcuNvjm/N8aiag0= X-Google-Smtp-Source: APXvYqxiCiplouwjfyAMjf+PNcg70k4MCL4fThooNE7/quqhJAXuj9w3rtUNFnTpev/Cdo1Gcjoe6Q== X-Received: by 2002:a1c:a686:: with SMTP id p128mr28191984wme.130.1564239928198; Sat, 27 Jul 2019 08:05:28 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Sat, 27 Jul 2019 17:04:37 +0200 Message-Id: <20190727150438.31288-2-stamatis.iliass@gmail.com> In-Reply-To: <20190727150438.31288-1-stamatis.iliass@gmail.com> References: <20190727150438.31288-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.43]); Sat, 27 Jul 2019 15:05:30 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Sat, 27 Jul 2019 15:05:30 +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.43 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/2] test_driver: implement virDomainGetBlockIoTune 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Sat, 27 Jul 2019 15:05:34 +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 | 90 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index ab0f8b06d6..9f4e255e35 100755 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -3500,6 +3500,95 @@ testDomainGetInterfaceParameters(virDomainPtr dom, virDomainObjEndAPI(&vm); return ret; } + + +static int +testDomainGetBlockIoTune(virDomainPtr dom, + const char *path, + virTypedParameterPtr params, + int *nparams, + unsigned int flags) +{ + virDomainObjPtr vm =3D NULL; + virDomainDefPtr def =3D NULL; + virDomainDiskDefPtr disk; + virDomainBlockIoTuneInfo reply =3D {0}; + int ret =3D -1; + + virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | + VIR_DOMAIN_AFFECT_CONFIG | + VIR_TYPED_PARAM_STRING_OKAY, -1); + + flags &=3D ~VIR_TYPED_PARAM_STRING_OKAY; + + if (*nparams =3D=3D 0) { + *nparams =3D 20; + return 0; + } + + if (!(vm =3D testDomObjFromDomain(dom))) + return -1; + + if (!(def =3D virDomainObjGetOneDef(vm, flags))) + goto cleanup; + + if (!(disk =3D virDomainDiskByName(def, path, true))) { + virReportError(VIR_ERR_INVALID_ARG, + _("disk '%s' was not found in the domain config"), + path); + goto cleanup; + } + + reply =3D disk->blkdeviotune; + if (VIR_STRDUP(reply.group_name, disk->blkdeviotune.group_name) < 0) + goto cleanup; + +#define ULL VIR_TYPED_PARAM_ULLONG + TEST_SET_PARAM(0, VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC, ULL, reply.= total_bytes_sec); + TEST_SET_PARAM(1, VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC, ULL, reply.r= ead_bytes_sec); + TEST_SET_PARAM(2, VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC, ULL, reply.= write_bytes_sec); + + TEST_SET_PARAM(3, VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC, ULL, reply.t= otal_iops_sec); + TEST_SET_PARAM(4, VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC, ULL, reply.re= ad_iops_sec); + TEST_SET_PARAM(5, VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC, ULL, reply.w= rite_iops_sec); + + TEST_SET_PARAM(6, VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC_MAX, ULL, re= ply.total_bytes_sec_max); + TEST_SET_PARAM(7, VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC_MAX, ULL, rep= ly.read_bytes_sec_max); + TEST_SET_PARAM(8, VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC_MAX, ULL, re= ply.write_bytes_sec_max); + + TEST_SET_PARAM(9, VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC_MAX, ULL, rep= ly.total_iops_sec_max); + TEST_SET_PARAM(10, VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC_MAX, ULL, rep= ly.read_iops_sec_max); + TEST_SET_PARAM(11, VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC_MAX, ULL, re= ply.write_iops_sec_max); + + TEST_SET_PARAM(12, VIR_DOMAIN_BLOCK_IOTUNE_SIZE_IOPS_SEC, ULL, reply.s= ize_iops_sec); + + TEST_SET_PARAM(13, VIR_DOMAIN_BLOCK_IOTUNE_GROUP_NAME, VIR_TYPED_PARAM= _STRING, reply.group_name); + reply.group_name =3D NULL; + + TEST_SET_PARAM(14, VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC_MAX_LENGTH,= ULL, + reply.total_bytes_sec_max_length); + TEST_SET_PARAM(15, VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC_MAX_LENGTH, = ULL, + reply.read_bytes_sec_max_length); + TEST_SET_PARAM(16, VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC_MAX_LENGTH,= ULL, + reply.write_bytes_sec_max_length); + + TEST_SET_PARAM(17, VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC_MAX_LENGTH, = ULL, + reply.total_iops_sec_max_length); + TEST_SET_PARAM(18, VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC_MAX_LENGTH, U= LL, + reply.read_iops_sec_max_length); + TEST_SET_PARAM(19, VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC_MAX_LENGTH, = ULL, + reply.write_iops_sec_max_length); +#undef ULL + + if (*nparams > 20) + *nparams =3D 20; + + ret =3D 0; + cleanup: + VIR_FREE(reply.group_name); + virDomainObjEndAPI(&vm); + return ret; +} #undef TEST_SET_PARAM @@ -8512,6 +8601,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainGetNumaParameters =3D testDomainGetNumaParameters, /* 5.6.0 */ .domainSetInterfaceParameters =3D testDomainSetInterfaceParameters, /*= 5.6.0 */ .domainGetInterfaceParameters =3D testDomainGetInterfaceParameters, /*= 5.6.0 */ + .domainGetBlockIoTune =3D testDomainGetBlockIoTune, /* 5.6.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