summaryrefslogtreecommitdiff
path: root/virtinst
diff options
context:
space:
mode:
authorLin Ma <lma@suse.com>2022-08-02 13:02:30 +0800
committerCole Robinson <crobinso@redhat.com>2022-08-02 14:56:09 -0400
commit2984c13cffd39cd2fd607d66ce6acfe9709b494c (patch)
tree639a11a19ffc89be6d5811b34be3e316ebee6b44 /virtinst
parent90e13549b4f2dd74b3343a3a28c30f31c20032d5 (diff)
downloadvirt-manager-2984c13cffd39cd2fd607d66ce6acfe9709b494c.tar.gz
cli: Add --iothreads defaultiothread.thread_pool_{min,max}
It allows to set the thread pool size to optimize spawning worker threads for the default event loop in real time environment. For example: --iothreads defaultiothread.thread_pool_min=8,\ defaultiothread.thread_pool_max=16 Signed-off-by: Lin Ma <lma@suse.com>
Diffstat (limited to 'virtinst')
-rw-r--r--virtinst/cli.py10
-rw-r--r--virtinst/guest.py11
2 files changed, 20 insertions, 1 deletions
diff --git a/virtinst/cli.py b/virtinst/cli.py
index b513c3c3..6179c436 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -2608,6 +2608,12 @@ class ParserIOThreads(VirtCLIParser):
cb = self._make_find_inst_cb(cliarg, list_propname)
return cb(*args, **kwargs)
+ def defaultiothread_find_inst_cb(self, *args, **kwargs):
+ cliarg = "defaultiothread"
+ list_propname = "defaultiothread"
+ cb = self._make_find_inst_cb(cliarg, list_propname)
+ return cb(*args, **kwargs)
+
@classmethod
def _virtcli_class_init(cls):
VirtCLIParser._virtcli_class_init_common(cls)
@@ -2619,6 +2625,10 @@ class ParserIOThreads(VirtCLIParser):
"thread_pool_min", find_inst_cb=cls.iothreads_find_inst_cb)
cls.add_arg("iothreadids.iothread[0-9]*.thread_pool_max",
"thread_pool_max", find_inst_cb=cls.iothreads_find_inst_cb)
+ cls.add_arg("defaultiothread.thread_pool_min", "thread_pool_min",
+ find_inst_cb=cls.defaultiothread_find_inst_cb)
+ cls.add_arg("defaultiothread.thread_pool_max", "thread_pool_max",
+ find_inst_cb=cls.defaultiothread_find_inst_cb)
###################
diff --git a/virtinst/guest.py b/virtinst/guest.py
index 4323394b..e6636022 100644
--- a/virtinst/guest.py
+++ b/virtinst/guest.py
@@ -74,6 +74,13 @@ class _IOThreadID(XMLBuilder):
thread_pool_max = XMLProperty("./@thread_pool_max", is_int=True)
+class _DefaultIOThread(XMLBuilder):
+ XML_NAME = "defaultiothread"
+
+ thread_pool_min = XMLProperty("./@thread_pool_min", is_int=True)
+ thread_pool_max = XMLProperty("./@thread_pool_max", is_int=True)
+
+
class Guest(XMLBuilder):
@staticmethod
def validate_name(conn, name, check_collision=True, validate=True):
@@ -180,7 +187,8 @@ class Guest(XMLBuilder):
XML_NAME = "domain"
_XML_PROP_ORDER = [
"type", "name", "uuid", "genid", "genid_enable",
- "title", "description", "_metadata", "iothreads", "iothreadids",
+ "title", "description", "_metadata",
+ "iothreads", "iothreadids", "defaultiothread",
"maxMemory", "maxMemorySlots", "memory", "_currentMemory",
"blkiotune", "memtune", "memoryBacking",
"_vcpus", "vcpu_current", "vcpu_placement",
@@ -226,6 +234,7 @@ class Guest(XMLBuilder):
iothreads = XMLProperty("./iothreads", is_int=True)
iothreadids = XMLChildProperty(_IOThreadID, relative_xpath="./iothreadids")
+ defaultiothread = XMLChildProperty(_DefaultIOThread)
def _set_currentMemory(self, val):
if val is not None: