render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
032100
From 711cf329b9847c4d42994389d89a7e7b83c71596 Mon Sep 17 00:00:00 2001
032100
Message-Id: <711cf329b9847c4d42994389d89a7e7b83c71596@dist-git>
032100
From: Michal Privoznik <mprivozn@redhat.com>
032100
Date: Thu, 7 Jul 2022 16:29:33 +0200
032100
Subject: [PATCH] domain_conf: Format iothread IDs more often
032100
MIME-Version: 1.0
032100
Content-Type: text/plain; charset=UTF-8
032100
Content-Transfer-Encoding: 8bit
032100
032100
When formatting IOThreads (in virDomainDefIOThreadsFormat()), we
032100
may only output the number of IOThreads, or the full list of IOThreads too:
032100
032100
  <iothreads>4</iothreads>
032100
  <iothreadids>
032100
    <iothread id='1' thread_pool_max='10'/>
032100
    <iothread id='2' thread_pool_min='2' thread_pool_max='10'/>
032100
    <iothread id='3'/>
032100
    <iothread id='4'/>
032100
  </iothreadids>
032100
032100
Now, the deciding factor here is whether those individual
032100
IOThreads were so called 'autofill-ed' or user provided. Well, we
032100
need to take another factor in: if an IOThread has pool size
032100
limit set, then we ought to format the full list.
032100
032100
But how can we get into a situation when a thread is autofilled
032100
(i.e. not provided by user in the XML) and yet it has pool size
032100
limit set? virDomainSetIOThreadParams() is the answer.
032100
032100
Sure, we could also unset the autofill flag whenever a pool size
032100
limit is being set. But this approach allows us to not format
032100
anything if the limits are reset (we don't lose the autofill
032100
information).
032100
032100
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
032100
Reviewed-by: Ján Tomko <jtomko@redhat.com>
032100
(cherry picked from commit 5aa24958546c94a48fb8f8d6022213ca7c07c8a7)
032100
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2059511
032100
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
032100
---
032100
 src/conf/domain_conf.c | 4 +++-
032100
 1 file changed, 3 insertions(+), 1 deletion(-)
032100
032100
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
032100
index 207a45d9ae..fbc285d981 100644
032100
--- a/src/conf/domain_conf.c
032100
+++ b/src/conf/domain_conf.c
032100
@@ -27728,7 +27728,9 @@ virDomainDefIothreadShouldFormat(const virDomainDef *def)
032100
     size_t i;
032100
 
032100
     for (i = 0; i < def->niothreadids; i++) {
032100
-        if (!def->iothreadids[i]->autofill)
032100
+        if (!def->iothreadids[i]->autofill ||
032100
+            def->iothreadids[i]->thread_pool_min >= 0 ||
032100
+            def->iothreadids[i]->thread_pool_max >= 0)
032100
             return true;
032100
     }
032100
 
032100
-- 
032100
2.35.1
032100