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