Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/virtinst/cli.py b/virtinst/cli.py
- index 5accba8f..5389053a 100644
- --- a/virtinst/cli.py
- +++ b/virtinst/cli.py
- @@ -771,6 +771,10 @@ def add_guest_xml_options(geng):
- geng.add_argument("--cputune", action="append",
- help=_("Tune CPU parameters for the domain process."))
- + ParserIOThreads.register()
- + geng.add_argument("--iothreads", action="append",
- + help=_("Tune IOThreads parameters for the domain process."))
- +
- ParserNumatune.register()
- geng.add_argument("--numatune", action="append",
- help=_("Tune NUMA policy for the domain process."))
- @@ -2010,6 +2014,23 @@ 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"
- + stub_none = False
- +
- + @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/domain/__init__.py b/virtinst/domain/__init__.py
- index f942ee59..7d86ebf6 100644
- --- a/virtinst/domain/__init__.py
- +++ b/virtinst/domain/__init__.py
- @@ -6,6 +6,7 @@ from .blkiotune import DomainBlkiotune
- from .clock import DomainClock
- from .cpu import DomainCpu
- from .cputune import DomainCputune
- +from .iothreads import DomainIOThreads
- from .features import DomainFeatures
- from .idmap import DomainIdmap
- from .metadata import DomainMetadata
- diff --git a/virtinst/domain/iothreads.py b/virtinst/domain/iothreads.py
- new file mode 100644
- index 00000000..d5170643
- --- /dev/null
- +++ b/virtinst/domain/iothreads.py
- @@ -0,0 +1,15 @@
- +#
- +# Copyright 2019 Red Hat, Inc.
- +#
- +# This work is licensed under the GNU GPLv2 or later.
- +# See the COPYING file in the top-level directory.
- +
- +from ..xmlbuilder import XMLBuilder, XMLProperty, XMLChildProperty
- +
- +
- +class DomainIOThreads(XMLBuilder):
- +
- + XML_NAME = "iothreads"
- + _XML_PROP_ORDER = ["iothreads"]
- +
- + iothreads = XMLProperty("./iothreads", is_int=True)
- diff --git a/virtinst/guest.py b/virtinst/guest.py
- index 5479d4e9..aaa001ab 100644
- --- a/virtinst/guest.py
- +++ b/virtinst/guest.py
- @@ -232,6 +232,7 @@ class Guest(XMLBuilder):
- clock = XMLChildProperty(DomainClock, is_single=True)
- cpu = XMLChildProperty(DomainCpu, is_single=True)
- cputune = XMLChildProperty(DomainCputune, is_single=True)
- + iothreads = XMLChildProperty(DomainIOThreads, is_single=True)
- numatune = XMLChildProperty(DomainNumatune, is_single=True)
- pm = XMLChildProperty(DomainPm, is_single=True)
- blkiotune = XMLChildProperty(DomainBlkiotune, is_single=True)
- 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..abdf8c21 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
- @@ -209,6 +209,9 @@
- <cputune>
- <vcpupin vcpu="0" cpuset="0-3"/>
- </cputune>
- + <iothreads>
- + <iothreads>4</iothreads>
- + </iothreads>
- </domain>
- <domain type="kvm">
- <name>foobar</name>
- @@ -423,4 +426,7 @@
- <cputune>
- <vcpupin vcpu="0" cpuset="0-3"/>
- </cputune>
- + <iothreads>
- + <iothreads>4</iothreads>
- + </iothreads>
- </domain>
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement