From nobody Mon Feb 9 16:02:32 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1578466258; cv=none; d=zohomail.com; s=zohoarc; b=VzK7iyIvx9mvUFm12796Zole0QzSVNHBvuAvGk0A82+a0aurSGteOv30PvFspBnxb3Y6ixl7irdtozQnlPGwQyJQEtpW03X+r8Hko0deZ+z2YYZw7m1yZ8gsvmg7cVDAoX0gQDMDea+hoDRLjE/pv4cggiOURB/NxzqKypVH+vs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578466258; 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=/LY6wzuNjU3i0G28x3Snt2VPP8d1tuONXksxshGBUQw=; b=PqhQPlONt6L6GaJcSZIq4U8tD6Z/sRMn70jlhvkVla0tfL5aXy6jom2ofJ3/k0NCZfq+N+EwDKLHhmaNs0DEP8LoMDviQoVJ2suZRM8L6aHLB0igwmcE72YWBkJjE/J2zLOJoubvFLEYnkY7a8TLkW3Jf9MA2+Kctfp4w/GuDB0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1578466258028503.14692972380226; Tue, 7 Jan 2020 22:50:58 -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-86-ZOmLH2rJPtm5EVwJT8tgRg-1; Wed, 08 Jan 2020 01:50:54 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9408C18A8C83; Wed, 8 Jan 2020 06:50:49 +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 7240386C4B; Wed, 8 Jan 2020 06:50:49 +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 373CD18089CF; Wed, 8 Jan 2020 06:50:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0086oFWx001433 for ; Wed, 8 Jan 2020 01:50:15 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7F3329C60D; Wed, 8 Jan 2020 06:50:15 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7B26BD0B29 for ; Wed, 8 Jan 2020 06:50:13 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (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 0474E802A72 for ; Wed, 8 Jan 2020 06:50:13 +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-388-zZ8kuv0XNV-dcCCWGkw_1A-1; Wed, 08 Jan 2020 01:50:11 -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 1ip5AN-0004p8-0t for libvir-list@redhat.com; Wed, 08 Jan 2020 09:50:07 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578466256; 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=/LY6wzuNjU3i0G28x3Snt2VPP8d1tuONXksxshGBUQw=; b=V8LuWhttrfAjj1lyQViOpkHIS/znCbt5/ME51aJgVPnrALxFHNlB5aKu8bR+pOATrGph6G no0UUt5L7T6NpxtSBKEbFBfZMyNuosr/HGrwP8qFGEBCHGpqhKeqQY2O/0+x38JYafQWBs wOJrlktW3kKei3lkdkUbohbxyP/Lu1E= From: Nikolay Shirokovskiy To: libvir-list@redhat.com Date: Wed, 8 Jan 2020 09:49:31 +0300 Message-Id: <20200108064931.2385-8-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: zZ8kuv0XNV-dcCCWGkw_1A-1 X-MC-Unique: ZOmLH2rJPtm5EVwJT8tgRg-1 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 0086oFWx001433 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 7/7] qemu: when leaving iotune group update xml properly 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.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Currently when disk is removed from iotune group (by setting all tunables to zero) group name is leaved in config. Let's fix it. Given iotune defaults are taken from the destination group setting tunables to zero may require different set of zero settings in API call. Let's prohibit removing from group while specifying different group name then current for the sanity sake. Signed-off-by: Nikolay Shirokovskiy Reviewed-by: Daniel P. Berrang=C3=A9 --- src/qemu/qemu_driver.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 5da3748dc7..7c75d502d5 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -19147,6 +19147,28 @@ qemuDomainFindGroupBlockIoTune(virDomainDefPtr def, } =20 =20 +static int +qemuDomainCheckBlockIoTuneReset(virDomainDiskDefPtr disk, + virDomainBlockIoTuneInfoPtr newiotune) +{ + if (virDomainBlockIoTuneInfoHasAny(newiotune)) + return 0; + + if (newiotune->group_name && + STRNEQ_NULLABLE(newiotune->group_name, disk->blkdeviotune.group_na= me)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("creating a new group/updating existing with all" + " tune parameters zero is not supported")); + return -1; + } + + /* all zero means remove any throttling and remove from group for qemu= */ + VIR_FREE(newiotune->group_name); + + return 0; +} + + static int qemuDomainSetBlockIoTune(virDomainPtr dom, const char *path, @@ -19406,6 +19428,9 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, set_fields) < 0) goto endjob; =20 + if (qemuDomainCheckBlockIoTuneReset(disk, &info) < 0) + goto endjob; + #define CHECK_MAX(val, _bool) \ do { \ if (info.val##_max) { \ @@ -19485,6 +19510,9 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, set_fields) < 0) goto endjob; =20 + if (qemuDomainCheckBlockIoTuneReset(conf_disk, &conf_info) < 0) + goto endjob; + if (virDomainDiskSetBlockIOTune(conf_disk, &conf_info) < 0) goto endjob; =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list