From nobody Tue Feb 10 00:58:30 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1578466233; cv=none; d=zohomail.com; s=zohoarc; b=Z0qkKmy2AqBjMQob+Del8qtNTxeGs1t1CVI+aC9e4vS+GyfKEzdyitoASylLok2s8sFoMelu/w+h1/F3fToz7xmZ22e8VbOfbEDk2TEJyzWeWX8cnBBIhiRTIv5p4JQvVXe5hL5T2qZjZjN/EanvwdPE8jfXO8tcQ++o03ytI6c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578466233; 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; bh=NNoO26oDfCK+y6Y9H6uKZtTBPbztmwZc16jeyQpbmjk=; b=h2ytDLpTaP2GY/1SjvTQxZj5hEfPTLSkRC9rQPPOJPxyGqzAknvW2ruFpQS69mhLQfpb16kjL88tUGLT0SdLg4xNGGhYc9nHQu2MoG0aUksdp4AcisPosPvou2fVhK2BSBfncIO4UX7datCRZRdskwkCPOr4PPzTNwXP78A3Tyc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1578466233068157.27250433071856; Tue, 7 Jan 2020 22:50:33 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-138-T7rAO7d4PseBgSpXbOmUoQ-1; Wed, 08 Jan 2020 01:50:30 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id A601E100550E; Wed, 8 Jan 2020 06:50:23 +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 5C2F610013A7; Wed, 8 Jan 2020 06:50:22 +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 5737918089CD; Wed, 8 Jan 2020 06:50:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0086oEZA001424 for ; Wed, 8 Jan 2020 01:50:15 -0500 Received: by smtp.corp.redhat.com (Postfix) id DE4F22093CC6; Wed, 8 Jan 2020 06:50:14 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D88E72028DCB for ; Wed, 8 Jan 2020 06:50:12 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7A525185AB7C for ; Wed, 8 Jan 2020 06:50:12 +0000 (UTC) Received: from relay.sw.ru (relay.sw.ru [185.231.240.75]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-257-YnCf2blEMrmhP_thN_mSCg-1; Wed, 08 Jan 2020 01:50:10 -0500 Received: from dhcp-172-16-24-106.sw.ru ([172.16.24.106] helo=shiny.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1ip5AL-0004p8-Uh for libvir-list@redhat.com; Wed, 08 Jan 2020 09:50:06 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578466231; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=NNoO26oDfCK+y6Y9H6uKZtTBPbztmwZc16jeyQpbmjk=; b=XZUP81yXmHWuumAO2k53a87lz02iC2VVXnMmr80PtmFVZ8iIoYZiYi0RQNJUy4eI9fdfFL oJRSOx0rEb5XaghssXswPH4H6M36zv0J6Kebsp0O7VdKAtPmTSu4fTYY0lDmyHzbq7KglA P03wjRN4aYCnPSu9wtWUIwywDc5dr1Y= From: Nikolay Shirokovskiy To: libvir-list@redhat.com Date: Wed, 8 Jan 2020 09:49:26 +0300 Message-Id: <20200108064931.2385-3-nshirokovskiy@virtuozzo.com> In-Reply-To: <20200108064931.2385-1-nshirokovskiy@virtuozzo.com> References: <20200108064931.2385-1-nshirokovskiy@virtuozzo.com> MIME-Version: 1.0 X-MC-Unique: YnCf2blEMrmhP_thN_mSCg-1 X-MC-Unique: T7rAO7d4PseBgSpXbOmUoQ-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 0086oEZA001424 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/7] conf: expand iotune params if only group name is given 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: , 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-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Currenly if only iotune group name is given for some disk and no any params then later start of domain will fail. I guess it will be convinient to allow such configuration if there is another disk in the same iotune group with iotune params set. The meaning is that the first disk have same iotunes and the latter. Thus one can easyly add disk to iotune group - just add group name parameter and no need to copy all the params. Also let's expand iotunes params in the described case so we don't need to refer to another disk to know iotunes and this will make logic in many places simple. Signed-off-by: Nikolay Shirokovskiy Reviewed-by: Daniel P. Berrang=C3=A9 --- src/conf/domain_conf.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index abe21a93fd..f75841c60f 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -5106,6 +5106,33 @@ virDomainRNGDefPostParse(virDomainRNGDefPtr rng) } =20 =20 +static void +virDomainDiskExpandGroupIoTune(virDomainDiskDefPtr disk, + const virDomainDef *def) +{ + size_t i; + + if (!disk->blkdeviotune.group_name || + virDomainBlockIoTuneInfoHasAny(&disk->blkdeviotune)) + return; + + for (i =3D 0; i < def->ndisks; i++) { + virDomainDiskDefPtr d =3D def->disks[i]; + + if (d->blkdeviotune.group_name && + STREQ(disk->blkdeviotune.group_name, d->blkdeviotune.group_nam= e) && + virDomainBlockIoTuneInfoHasAny(&d->blkdeviotune)) { + char *tmp =3D disk->blkdeviotune.group_name; + + disk->blkdeviotune =3D d->blkdeviotune; + disk->blkdeviotune.group_name =3D tmp; + + return; + } + } +} + + static int virDomainDiskDefPostParse(virDomainDiskDefPtr disk, const virDomainDef *def, @@ -5151,6 +5178,8 @@ virDomainDiskDefPostParse(virDomainDiskDefPtr disk, return -1; } =20 + virDomainDiskExpandGroupIoTune(disk, def); + return 0; } =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list