mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 07:05:28 +00:00
domain_conf: Format iothread IDs more often
When formatting IOThreads (in virDomainDefIOThreadsFormat()), we may only output the number of IOThreads, or the full list of IOThreads too: <iothreads>4</iothreads> <iothreadids> <iothread id='1' thread_pool_max='10'/> <iothread id='2' thread_pool_min='2' thread_pool_max='10'/> <iothread id='3'/> <iothread id='4'/> </iothreadids> 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 <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
24fa7004e4
commit
5aa2495854
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user