[virt-tools-list] [virt-manager PATCH v3] cli: Add --iothreads

Athina Plaskasoviti athina.plaskasoviti at gmail.com
Tue Jun 4 07:50:18 UTC 2019


XML Mapping:

<domain>
...
  <iothreads>X</iothreads>
...
</domain>

Signed-off-by: Athina Plaskasoviti <athina.plaskasoviti at gmail.com>
---
Moved up ParserIOThreads, re-added remove_first and removed stub_none.

 .../virt-install-singleton-config-2.xml       |  2 ++
 tests/clitest.py                              |  1 +
 virtinst/cli.py                               | 20 +++++++++++++++++++
 virtinst/guest.py                             |  4 +++-
 4 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/tests/cli-test-xml/compare/virt-install-singleton-config-2.xml b/tests/cli-test-xml/compare/virt-install-singleton-config-2.xml
index cd22f5ae..b680093c 100644
--- a/tests/cli-test-xml/compare/virt-install-singleton-config-2.xml
+++ b/tests/cli-test-xml/compare/virt-install-singleton-config-2.xml
@@ -9,6 +9,7 @@
       <libosinfo:os id="http://fedoraproject.org/fedora/unknown"/>
     </libosinfo:libosinfo>
   </metadata>
+  <iothreads>4</iothreads>
   <memory>1048576</memory>
   <currentMemory>524288</currentMemory>
   <blkiotune>
@@ -221,6 +222,7 @@
       <libosinfo:os id="http://fedoraproject.org/fedora/unknown"/>
     </libosinfo:libosinfo>
   </metadata>
+  <iothreads>4</iothreads>
   <memory>1048576</memory>
   <currentMemory>524288</currentMemory>
   <blkiotune>
diff --git a/tests/clitest.py b/tests/clitest.py
index ceb1eebd..a5762e50 100644
--- a/tests/clitest.py
+++ b/tests/clitest.py
@@ -485,6 +485,7 @@ numa.cell1.distances.sibling0.id=0,numa.cell1.distances.sibling0.value=21,\
 cell1.distances.sibling1.id=1,cell1.distances.sibling1.value=10,\
 cache.mode=emulate,cache.level=3
 --cputune vcpupin0.vcpu=0,vcpupin0.cpuset=0-3
+--iothreads iothreads=4
 --metadata title=my-title,description=my-description,uuid=00000000-1111-2222-3333-444444444444,genid=e9392370-2917-565e-692b-d057f46512d6
 --boot cdrom,fd,hd,network,menu=off,loader=/foo/bar,emulator=/new/emu,bootloader=/new/bootld,rebootTimeout=3,initargs="foo=bar baz=woo"
 --idmap uid_start=0,uid_target=1000,uid_count=10,gid_start=0,gid_target=1000,gid_count=10
diff --git a/virtinst/cli.py b/virtinst/cli.py
index 5accba8f..64fc9e27 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -763,6 +763,10 @@ def add_device_options(devg, sound_back_compat=False):
 
 
 def add_guest_xml_options(geng):
+    ParserIOThreads.register()
+    geng.add_argument("--iothreads", action="append",
+        help=_("Set domain <iothreads> configuration."))
+
     ParserSeclabel.register()
     geng.add_argument("--seclabel", "--security", action="append",
         help=_("Set domain seclabel configuration."))
@@ -2010,6 +2014,22 @@ class ParserCputune(VirtCLIParser):
                     find_inst_cb=cls.vcpu_find_inst_cb)
 
 
+#######################
+# --iothreads parsing #
+#######################
+
+class ParserIOThreads(VirtCLIParser):
+    cli_arg_name = "iothreads"
+    guest_propname = "iothreads"
+    remove_first = "iothreads"
+
+    @classmethod
+    def _init_class(cls, **kwargs):
+        VirtCLIParser._init_class(**kwargs)
+        # Options for IOThreads config
+        cls.add_arg("iothreads", "iothreads")
+
+
 ###################
 # --vcpus parsing #
 ###################
diff --git a/virtinst/guest.py b/virtinst/guest.py
index 5479d4e9..6a60583e 100644
--- a/virtinst/guest.py
+++ b/virtinst/guest.py
@@ -145,7 +145,7 @@ class Guest(XMLBuilder):
     XML_NAME = "domain"
     _XML_PROP_ORDER = [
         "type", "name", "uuid", "genid", "genid_enable",
-        "title", "description", "_metadata",
+        "title", "description", "_metadata", "iothreads",
         "maxMemory", "maxMemorySlots", "memory", "_currentMemory",
         "blkiotune", "memtune", "memoryBacking",
         "_vcpus", "vcpu_current", "vcpu_placement",
@@ -179,6 +179,8 @@ class Guest(XMLBuilder):
 
     name = XMLProperty("./name")
 
+    iothreads = XMLProperty("./iothreads", is_int=True)
+
     def _set_currentMemory(self, val):
         if val is not None:
             val = int(val)
-- 
2.20.1




More information about the virt-tools-list mailing list