From nobody Thu Apr 25 18:54:28 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=1555329009; cv=none; d=zoho.com; s=zohoarc; b=jkmgRRZeP3Mgam3Q3mUu66J5mImaTQOc+NEhvoXrvsWAeJAaP7nzlB6EbBIWiLOWmva04ljKYun5VY+Ks7048Ge0gWuMmlLOVvW0IHl5CpQTud+2TAcLih7mYD0WeXPm3ZJ3YdDIE8SQsAbix3HUZYmj3iDfmjjHT7pf4wM1aj4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555329009; 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=0A6LuWaZ45n7QXulgnhVq7tgeafS0IBa1sYvsz8KAY0=; b=lPteGI9j4IAdF/iZw76ic3T9gNNB+/JRrxMKYlVQ3l381H/eCZ9eJ3piQ98vqL2SeD73NECq9RodeesdNaWqZ2qMLc+VZNK2V1p9qEr0jXqa5h/oqrQSll5q/ZA2zByLGC0M65OHYdQ8jxMlGI8wu8lRpwuaECAeyLmnrwfqFAA= 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 1555329009142685.5522914449359; Mon, 15 Apr 2019 04:50:09 -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 870643078ABB; Mon, 15 Apr 2019 11:50:03 +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 CDBE95D9D5; Mon, 15 Apr 2019 11:50:01 +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 AD8BB41F3D; Mon, 15 Apr 2019 11:49:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x3FBnuIH017070 for ; Mon, 15 Apr 2019 07:49:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id 53F7E5C225; Mon, 15 Apr 2019 11:49:56 +0000 (UTC) Received: from caroline (unknown [10.43.2.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 297FD5C22E for ; Mon, 15 Apr 2019 11:49:54 +0000 (UTC) Received: from caroline.brq.redhat.com (caroline.usersys.redhat.com [127.0.0.1]) by caroline (Postfix) with ESMTP id C12071206D9 for ; Mon, 15 Apr 2019 13:49:52 +0200 (CEST) From: Martin Kletzander To: libvir-list@redhat.com Date: Mon, 15 Apr 2019 13:49:42 +0200 Message-Id: <40424524c81051a90b8816efa09d1aca5a707324.1555328908.git.mkletzan@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/5] conf: Parse common scheduler attributes in separate function 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.48]); Mon, 15 Apr 2019 11:50:04 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This will become useful later when parsing emulatorsched parameters which d= on't need the rest of the current function. Signed-off-by: Martin Kletzander --- src/conf/domain_conf.c | 70 +++++++++++++++++++++++++----------------- 1 file changed, 41 insertions(+), 29 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b969a9f6e566..15838c2a23f5 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -18441,45 +18441,24 @@ virDomainLoaderDefParseXML(xmlNodePtr node, } =20 =20 -static virBitmapPtr -virDomainSchedulerParse(xmlNodePtr node, - const char *name, - virProcessSchedPolicy *policy, - int *priority) +static int +virDomainSchedulerParseCommonAttrs(xmlNodePtr node, + virProcessSchedPolicy *policy, + int *priority) { - virBitmapPtr ret =3D NULL; int pol =3D 0; VIR_AUTOFREE(char *) tmp =3D NULL; =20 - if (!(tmp =3D virXMLPropString(node, name))) { - virReportError(VIR_ERR_XML_ERROR, - _("Missing attribute '%s' in element '%sched'"), - name, name); - goto error; - } - - if (virBitmapParse(tmp, &ret, VIR_DOMAIN_CPUMASK_LEN) < 0) - goto error; - - if (virBitmapIsAllClear(ret)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("'%s' scheduler bitmap '%s' is empty"), - name, tmp); - goto error; - } - - VIR_FREE(tmp); - if (!(tmp =3D virXMLPropString(node, "scheduler"))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Missing scheduler attribute")); - goto error; + return -1; } =20 if ((pol =3D virProcessSchedPolicyTypeFromString(tmp)) <=3D 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Invalid scheduler attribute: '%s'"), tmp); - goto error; + return -1; } *policy =3D pol; =20 @@ -18490,16 +18469,49 @@ virDomainSchedulerParse(xmlNodePtr node, if (!(tmp =3D virXMLPropString(node, "priority"))) { virReportError(VIR_ERR_XML_ERROR, "%s", _("Missing scheduler priority")); - goto error; + return -1; } =20 if (virStrToLong_i(tmp, NULL, 10, priority) < 0) { virReportError(VIR_ERR_XML_ERROR, "%s", _("Invalid value for element priority")); - goto error; + return -1; } } =20 + return 0; +} + + +static virBitmapPtr +virDomainSchedulerParse(xmlNodePtr node, + const char *name, + virProcessSchedPolicy *policy, + int *priority) +{ + virBitmapPtr ret =3D NULL; + VIR_AUTOFREE(char *) tmp =3D NULL; + + if (!(tmp =3D virXMLPropString(node, name))) { + virReportError(VIR_ERR_XML_ERROR, + _("Missing attribute '%s' in element '%sched'"), + name, name); + goto error; + } + + if (virBitmapParse(tmp, &ret, VIR_DOMAIN_CPUMASK_LEN) < 0) + goto error; + + if (virBitmapIsAllClear(ret)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("'%s' scheduler bitmap '%s' is empty"), + name, tmp); + goto error; + } + + if (virDomainSchedulerParseCommonAttrs(node, policy, priority) < 0) + goto error; + return ret; =20 error: --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu Apr 25 18:54:28 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=1555329035; cv=none; d=zoho.com; s=zohoarc; b=gxCPq2m6SfJZSAamUY2huDRLgAWTfPI0q9A0C6R5KFoQ1y1S30jMmeWGmR5Unmz4/K+DDwyDYw8KD2wJ9OTj3yHti0Fq2w/sd5EKA/9GEmVEFzaFjZJC+cwFv0WvM/uzKeSZ/U+Uh5Dg3OToxZdQDYBVL/S2u+QyJ3rbu0jhR1k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555329035; 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=EAvOsH/3stG7zIIBvMPodgK8G+G5eJ8AFBJ1BQk/SqQ=; b=UYoZDrnIuYbI1hUkgZ+BUDuZ5FkHWMA4V8sMvt/Guzv4wMOlu+YwdmS9TdVx7noodUdiIw25u5i8GL73YEa6hB4bvzhilrJ7157NMD8JjgbgaKejPD5VmWGTfqplaD7g/NlYWEBu0GxuTcd1rghUfrqPJklQgoIQzBjlcvch6E8= 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 1555329035884136.60759371483925; Mon, 15 Apr 2019 04:50:35 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 344AA308222E; Mon, 15 Apr 2019 11:50:34 +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 0E58A5C1B4; Mon, 15 Apr 2019 11:50:34 +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 AEEEE181AC47; Mon, 15 Apr 2019 11:50:33 +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 x3FBnuY7017087 for ; Mon, 15 Apr 2019 07:49:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id E0838608C2; Mon, 15 Apr 2019 11:49:56 +0000 (UTC) Received: from caroline (unknown [10.43.2.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B5A98608C6 for ; Mon, 15 Apr 2019 11:49:54 +0000 (UTC) Received: from caroline.brq.redhat.com (caroline.usersys.redhat.com [127.0.0.1]) by caroline (Postfix) with ESMTP id D38691206DB for ; Mon, 15 Apr 2019 13:49:52 +0200 (CEST) From: Martin Kletzander To: libvir-list@redhat.com Date: Mon, 15 Apr 2019 13:49:43 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/5] conf: Format thread IDs optionally 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Mon, 15 Apr 2019 11:50:34 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This will be used later when we want to format emulator scheduler parameters which don't apply for multiple threads. Signed-off-by: Martin Kletzander squash! conf: Do not format negative thread IDs Signed-off-by: Martin Kletzander --- src/conf/domain_conf.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 15838c2a23f5..e7b8b51aad0e 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -27205,22 +27205,25 @@ static void virDomainSchedulerFormat(virBufferPtr buf, const char *name, virDomainThreadSchedParamPtr sched, - size_t id) + size_t id, + bool multiple_threads) { switch (sched->policy) { case VIR_PROC_POLICY_BATCH: case VIR_PROC_POLICY_IDLE: - virBufferAsprintf(buf, "<%ssched " - "%ss=3D'%zu' scheduler=3D'%s'/>\n", - name, name, id, + virBufferAsprintf(buf, "<%ssched", name); + if (multiple_threads) + virBufferAsprintf(buf, " %ss=3D'%zu'", name, id); + virBufferAsprintf(buf, " scheduler=3D'%s'/>\n", virProcessSchedPolicyTypeToString(sched->pol= icy)); break; =20 case VIR_PROC_POLICY_RR: case VIR_PROC_POLICY_FIFO: - virBufferAsprintf(buf, "<%ssched " - "%ss=3D'%zu' scheduler=3D'%s' priority=3D'%d= '/>\n", - name, name, id, + virBufferAsprintf(buf, "<%ssched", name); + if (multiple_threads) + virBufferAsprintf(buf, " %ss=3D'%zu'", name, id); + virBufferAsprintf(buf, " scheduler=3D'%s' priority=3D'%d'/>\n", virProcessSchedPolicyTypeToString(sched->pol= icy), sched->priority); break; @@ -27489,13 +27492,14 @@ virDomainCputuneDefFormat(virBufferPtr buf, =20 for (i =3D 0; i < def->maxvcpus; i++) { virDomainSchedulerFormat(&childrenBuf, "vcpu", - &def->vcpus[i]->sched, i); + &def->vcpus[i]->sched, i, true); } =20 for (i =3D 0; i < def->niothreadids; i++) { virDomainSchedulerFormat(&childrenBuf, "iothread", &def->iothreadids[i]->sched, - def->iothreadids[i]->iothread_id); + def->iothreadids[i]->iothread_id, + true); } =20 for (i =3D 0; i < def->nresctrls; i++) --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu Apr 25 18:54:28 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=1555329043; cv=none; d=zoho.com; s=zohoarc; b=aH4/42/i0G7n02U8QRLaND3t06u5GI3b8IKo0TwVcMPdm7PPfJRLRjMq2VB91zqa1Wfi0BfJAeQVXYrayhZYPgTNQL93LKCQcy6Crl7QH09JnVH5i2koY6O07jTHRuW69csWERSPCV0KQpC9ErGU+uczHEPeO8LVntJyDe+KyIg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555329043; 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=I8uc2QD79RA3zJ7E5640ZE76bjDDlWoaAbWVRGzpM0I=; b=QNCe/0Z1evDdjiyJQgL3GoHOD2mhYCmdXZk4sQQPuu5VvejwiDIXL1X9v5WtKgfAXmjSm0i1LxF3oBWb6q8Yrirfe48p6jnz82v+OFMbmbFL2SjS7oHy8k3t8x1+30fRDuVTLp980MpjE1hbf+drSinXQ7RGLF5nxXQcugmABl4= 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 1555329043892974.9749996124029; Mon, 15 Apr 2019 04:50:43 -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 36D5019D23A; Mon, 15 Apr 2019 11:50:42 +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 12A005D9D6; Mon, 15 Apr 2019 11:50:42 +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 D0609181AC90; Mon, 15 Apr 2019 11:50:41 +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 x3FBnvHB017100 for ; Mon, 15 Apr 2019 07:49:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id ED49C5D71B; Mon, 15 Apr 2019 11:49:57 +0000 (UTC) Received: from caroline (unknown [10.43.2.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C32C25D71C for ; Mon, 15 Apr 2019 11:49:54 +0000 (UTC) Received: from caroline.brq.redhat.com (caroline.usersys.redhat.com [127.0.0.1]) by caroline (Postfix) with ESMTP id E5E6E1206F3 for ; Mon, 15 Apr 2019 13:49:52 +0200 (CEST) From: Martin Kletzander To: libvir-list@redhat.com Date: Mon, 15 Apr 2019 13:49:44 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/5] docs: Mention iothreadsched element in the docs and reword 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.29]); Mon, 15 Apr 2019 11:50:42 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Just one missing occurrence of iothreadsched fixed plus some rewording for = this to make more sense for the readers. Signed-off-by: Martin Kletzander --- docs/formatdomain.html.in | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 0e3799061d93..af4b88c60984 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -937,14 +937,16 @@ =20
vcpusched and iothreadsched
- The optional vcpusched elements specifies the schedul= er - type (values batch, idle, fifo, - rr) for particular vCPU/IOThread threads (based on - vcpus and iothreads, leaving out - vcpus/iothreads sets the default). Valid - vcpus values start at 0 through one less than the - number of vCPU's defined for the domain. Valid iothreads - values are described in the iothreadids + The optional vcpusched and iothreadsched + elements specify the scheduler type + (values batch, idle, fifo, + rr) for particular vCPU and IOThread threads respeciv= ely. + The attributes vcpus and iothreads select + which vCPUs/IOThreads this setting applies to, leaving them out se= ts the + default. Valid vcpus values start at 0 through one l= ess + than the number of vCPU's defined for the + domain. Valid iothreads values are described in + the iothreadids description<= /a>. If no iothreadids are defined, then libvirt numbers IOThreads from 1 to the number of iothreads available --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu Apr 25 18:54:28 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=1555329032; cv=none; d=zoho.com; s=zohoarc; b=Ywk/f+bTjJectSHGWybObBwHOA1NW/pPKsAH7b7XAwHAEAkp1kUC3fGZafmnRmsFbXV3senbYtvhYATcgkfMlbOeSNHAlW/fV4HmqyNfjUGY92Xjf55L6SyEWbWFJuXvFYAVeNq8EzL0HRM/u5NAOJUsk9oEmCdx6oH1z9NBZLE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555329032; 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=2Wh7GyUWIS3UX9GAQZVAj+WYB50ncv5e/wX9quHptJY=; b=eFFMODXwnXZw6V0dlbGcOTUuId2LtxJ5BotYeNzzOFpPiTPIJv6tSteoy1OnVgeERK2s7f8RODgR8M3zacFZTmDDKUNE6ktIXmfvcl93b2dHbZvkEP5GapDbOlyDJ6SFNzsi4liqKCzI4xaTacK1z+i8jtSKI8FeWLPkM6hbKj0= 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 1555329032191552.7426817126576; Mon, 15 Apr 2019 04:50:32 -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 581DD3086205; Mon, 15 Apr 2019 11:50:27 +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 326485D9CA; Mon, 15 Apr 2019 11:50:27 +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 E7FFD3D86; Mon, 15 Apr 2019 11:50:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x3FBnu10017082 for ; Mon, 15 Apr 2019 07:49:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8036219C71; Mon, 15 Apr 2019 11:49:56 +0000 (UTC) Received: from caroline (unknown [10.43.2.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2EA1319C66 for ; Mon, 15 Apr 2019 11:49:54 +0000 (UTC) Received: from caroline.brq.redhat.com (caroline.usersys.redhat.com [127.0.0.1]) by caroline (Postfix) with ESMTP id 064A11206F6 for ; Mon, 15 Apr 2019 13:49:53 +0200 (CEST) From: Martin Kletzander To: libvir-list@redhat.com Date: Mon, 15 Apr 2019 13:49:45 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/5] conf: Add support for emulatorsched 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.42]); Mon, 15 Apr 2019 11:50:27 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Martin Kletzander --- docs/formatdomain.html.in | 17 ++++++---- docs/schemas/domaincommon.rng | 5 +++ src/conf/domain_conf.c | 44 +++++++++++++++++++++++++ src/conf/domain_conf.h | 1 + tests/genericxml2xmlindata/cputune.xml | 37 +++++++++++++++++++++ tests/genericxml2xmloutdata/cputune.xml | 40 ++++++++++++++++++++++ tests/genericxml2xmltest.c | 2 ++ 7 files changed, 140 insertions(+), 6 deletions(-) create mode 100644 tests/genericxml2xmlindata/cputune.xml create mode 100644 tests/genericxml2xmloutdata/cputune.xml diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index af4b88c60984..74d32e2a9b8c 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -935,15 +935,19 @@ Only QEMU driver support since 2.1.0
=20 -
vcpusched and iothreadsched
+
vcpusched, iothreadsched + and emulatorsched
- The optional vcpusched and iothreadsched - elements specify the scheduler type + The optional + vcpusched, iothreadsched + and emulatorsched elements specify the scheduler type (values batch, idle, fifo, - rr) for particular vCPU and IOThread threads respeciv= ely. - The attributes vcpus and iothreads select + rr) for particular vCPU, IOThread and emulator threads + respecively. For vcpusched and iothreadsched + the attributes vcpus and iothreads select which vCPUs/IOThreads this setting applies to, leaving them out se= ts the - default. Valid vcpus values start at 0 through one l= ess + default. The element emulatorsched does not have that + attribute. Valid vcpus values start at 0 through one = less than the number of vCPU's defined for the domain. Valid iothreads values are described in the iothreadids @@ -955,6 +959,7 @@ well (and is ignored for non-real-time ones). The value range for the priority depends on the host kernel (usually 1-99). Since 1.2.13 + emulatorsched since 5.3.0
=20
cachetuneSince 4.1.0 diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 623ef28719df..111b85c36fd3 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -967,6 +967,11 @@ + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index e7b8b51aad0e..17e8975be399 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -3396,6 +3396,7 @@ void virDomainDefFree(virDomainDefPtr def) virDomainIOThreadIDDefArrayFree(def->iothreadids, def->niothreadids); =20 virBitmapFree(def->cputune.emulatorpin); + VIR_FREE(def->cputune.emulatorsched); =20 virDomainNumaFree(def->numa); =20 @@ -18483,6 +18484,25 @@ virDomainSchedulerParseCommonAttrs(xmlNodePtr node, } =20 =20 +static int +virDomainEmulatorSchedParse(xmlNodePtr node, + virDomainDefPtr def) +{ + VIR_AUTOFREE(virDomainThreadSchedParamPtr) sched =3D NULL; + + if (VIR_ALLOC(sched) < 0) + return -1; + + if (virDomainSchedulerParseCommonAttrs(node, + &sched->policy, + &sched->priority) < 0) + return -1; + + VIR_STEAL_PTR(def->cputune.emulatorsched, sched); + return 0; +} + + static virBitmapPtr virDomainSchedulerParse(xmlNodePtr node, const char *name, @@ -19913,6 +19933,25 @@ virDomainDefParseXML(xmlDocPtr xml, } VIR_FREE(nodes); =20 + if ((n =3D virXPathNodeSet("./cputune/emulatorsched", ctxt, &nodes)) <= 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("cannot extract emulatorsched nodes")); + goto error; + } + + if (n) { + if (n > 1) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("only one emulatorsched is supported")); + VIR_FREE(nodes); + goto error; + } + + if (virDomainEmulatorSchedParse(nodes[0], def) < 0) + goto error; + } + VIR_FREE(nodes); + if ((n =3D virXPathNodeSet("./cputune/cachetune", ctxt, &nodes)) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("cannot extract cachetune nodes")); @@ -27490,6 +27529,11 @@ virDomainCputuneDefFormat(virBufferPtr buf, VIR_FREE(cpumask); } =20 + if (def->cputune.emulatorsched) { + virDomainSchedulerFormat(&childrenBuf, "emulator", + def->cputune.emulatorsched, 0, false); + } + for (i =3D 0; i < def->maxvcpus; i++) { virDomainSchedulerFormat(&childrenBuf, "vcpu", &def->vcpus[i]->sched, i, true); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 12eb71c1977e..988ef90f1189 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2159,6 +2159,7 @@ struct _virDomainCputune { unsigned long long iothread_period; long long iothread_quota; virBitmapPtr emulatorpin; + virDomainThreadSchedParamPtr emulatorsched; }; =20 =20 diff --git a/tests/genericxml2xmlindata/cputune.xml b/tests/genericxml2xmli= ndata/cputune.xml new file mode 100644 index 000000000000..999c8cef73cd --- /dev/null +++ b/tests/genericxml2xmlindata/cputune.xml @@ -0,0 +1,37 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 4 + 4 + + 2048 + 1000000 + -1 + + + + + + + + + + + hvm + + + + + 48 + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + diff --git a/tests/genericxml2xmloutdata/cputune.xml b/tests/genericxml2xml= outdata/cputune.xml new file mode 100644 index 000000000000..f9f99a4846e6 --- /dev/null +++ b/tests/genericxml2xmloutdata/cputune.xml @@ -0,0 +1,40 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 4 + 4 + + 2048 + 1000000 + -1 + + + + + + + + + + + + + + hvm + + + + + 48 + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + diff --git a/tests/genericxml2xmltest.c b/tests/genericxml2xmltest.c index 4393d444641d..1840d6e6a8f9 100644 --- a/tests/genericxml2xmltest.c +++ b/tests/genericxml2xmltest.c @@ -149,6 +149,8 @@ mymain(void) =20 DO_TEST("launch-security-sev"); =20 + DO_TEST_DIFFERENT("cputune"); + virObjectUnref(caps); virObjectUnref(xmlopt); =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu Apr 25 18:54:28 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=1555329040; cv=none; d=zoho.com; s=zohoarc; b=U7Hy/Ro/KEg/+oQydhThebpIygeJXdZ4Hor9O+KykKRgKBkuEhbFVL8AumKdREOnC4gJl+r8wFB6zB3V+ClykPjJJrt2rRqtObQ3MZzdTSCq2dHDCNaecZ8W5E+w9GGlJWPi979euwz6SDLvVnXTOvJEbqHfOKdNuAXpT1p5U2c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555329040; 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=GDq/g7fGT5TIJJHgn7d2dL+JZpxk+Hfo3k/z6vSYSYY=; b=VxxViENuL6hh3UWEXFYGwfYEQe96iuRmq8Rt9BYfCAAGYQIr/0D5qKrpXcKURWQGnCY3bMlrV/1pXP6WyW3zNo+bDjp/TmyFEwxUwXlIAtZ+b8PJdCMIrqV3kAQlWMi+9ZF3I07dm2XS4cjL6hwNEcN1gvpyOBpxUvuX68n/ztk= 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 1555329040184434.5398523268791; Mon, 15 Apr 2019 04:50:40 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id A889A3092655; Mon, 15 Apr 2019 11:50:38 +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 80514108F857; Mon, 15 Apr 2019 11:50:38 +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 45A9E181AC8F; Mon, 15 Apr 2019 11:50:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x3FBnvWI017095 for ; Mon, 15 Apr 2019 07:49:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id C549E5C22E; Mon, 15 Apr 2019 11:49:57 +0000 (UTC) Received: from caroline (unknown [10.43.2.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9B6ED5C223 for ; Mon, 15 Apr 2019 11:49:57 +0000 (UTC) Received: from caroline.brq.redhat.com (caroline.usersys.redhat.com [127.0.0.1]) by caroline (Postfix) with ESMTP id 16983120703 for ; Mon, 15 Apr 2019 13:49:53 +0200 (CEST) From: Martin Kletzander To: libvir-list@redhat.com Date: Mon, 15 Apr 2019 13:49:46 +0200 Message-Id: <467819c697bc30940efbb0e637adc2d919c638bf.1555328908.git.mkletzan@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 5/5] qemu: Add support for emulatorsched 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Mon, 15 Apr 2019 11:50:39 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This helps in a scenarios where vCPUs run with a priority that is so high t= hey might starve the emulator thread. And it also fits with the rest of the settings. Signed-off-by: Martin Kletzander --- docs/news.xml | 12 ++++++++++++ src/qemu/qemu_process.c | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/news.xml b/docs/news.xml index 86c77346940a..84de507b0e9a 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -35,6 +35,18 @@
+ + + qemu: Add support for setting the emulator scheduler parameters + + + I/O threads and vCPU threads already support setting schedulers,= but + until now it was impossible to do so for the main QEMU thread + (emulator thread in the libvirt naming). This is, however, requ= ested + for some very specific scenarios, for example when vCPU threads = are + running at such priority that could starve the main thread. + +
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index f773aa89b78d..55f4074ea146 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2683,7 +2683,7 @@ qemuProcessSetupEmulator(virDomainObjPtr vm) 0, vm->def->cputune.emulatorpin, vm->def->cputune.emulator_period, vm->def->cputune.emulator_quota, - NULL); + vm->def->cputune.emulatorsched); } =20 =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list