From nobody Sat Apr 27 00:09:03 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1567676701; cv=none; d=zoho.com; s=zohoarc; b=RxprNPuXSIWuQIvSq0l9kEhVN0ic1UxskfCX8v0VEJfj7RrqKEzIZIm6KHhAJJCuWWWdfu4RMAgaujCNPs0MkGEx6KPosAXkAxPsGF8djfqYODs77I58FRZrlvFi0GwlFe1CtY2Wyyf9laL5Rg6nHxEF5bF9UgwAudUweEX4RHI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567676701; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=HDSt7ycNTH2QPpmewUIRJ0qyg9Ix/XlOrr2R73NR9l8=; b=aOc0sAxMSb7biGY1DJZ6JchLQA+6Yisc2mjWaOpNElJ/ITBt0q5zZ7DUGYZUCOSR60OIVorZmox9AR032r4y9sGPp3XZ/+SyDEM14neaKLqHCfTRco/AyU6eHqoH+HENfEjIW4gaCKILzV/uDSBxg+lYv6G/t6hEYjkpmNHq8FE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass 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 1567676701329462.98301429279695; Thu, 5 Sep 2019 02:45:01 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 90A9D80F98; Thu, 5 Sep 2019 09:44:59 +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 5D9F25D9E5; Thu, 5 Sep 2019 09:44:57 +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 4C0841806B00; Thu, 5 Sep 2019 09:44:53 +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 x859iq04026519 for ; Thu, 5 Sep 2019 05:44:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0676B60606; Thu, 5 Sep 2019 09:44:52 +0000 (UTC) Received: from antique-laptop.redhat.com (ovpn-200-34.brq.redhat.com [10.40.200.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 590BB60A97 for ; Thu, 5 Sep 2019 09:44:48 +0000 (UTC) From: Pavel Hrdina To: libvir-list@redhat.com Date: Thu, 5 Sep 2019 11:44:47 +0200 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] vircgroupv2: fix setting cpu.max period 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 05 Sep 2019 09:45:00 +0000 (UTC) Content-Type: text/plain; charset="utf-8" When we set cpu.max period we need to parse the cpu.max file first as it contains both quota and period values separated by space. When only a single number is written to that file it will set quota, in order to change period we need to write both values. The code was prepared for that but mistakenly used new line to end the string with the first value. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1749227 Signed-off-by: Pavel Hrdina Reviewed-by: Erik Skultety --- src/util/vircgroupv2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index 2aca4e5d62..0663c67190 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@ -1508,7 +1508,7 @@ virCgroupV2SetCpuCfsPeriod(virCgroupPtr group, _("Invalid 'cpu.max' data.")); return -1; } - *tmp =3D '\n'; + *tmp =3D '\0'; =20 if (virAsprintf(&value, "%s %llu", str, cfs_period) < 0) return -1; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list