Advertisement
celeste_ath

iothreads

May 31st, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.31 KB | None | 0 0
  1. diff --git a/virtinst/cli.py b/virtinst/cli.py
  2. index 5accba8f..5389053a 100644
  3. --- a/virtinst/cli.py
  4. +++ b/virtinst/cli.py
  5. @@ -771,6 +771,10 @@ def add_guest_xml_options(geng):
  6. geng.add_argument("--cputune", action="append",
  7. help=_("Tune CPU parameters for the domain process."))
  8.  
  9. + ParserIOThreads.register()
  10. + geng.add_argument("--iothreads", action="append",
  11. + help=_("Tune IOThreads parameters for the domain process."))
  12. +
  13. ParserNumatune.register()
  14. geng.add_argument("--numatune", action="append",
  15. help=_("Tune NUMA policy for the domain process."))
  16. @@ -2010,6 +2014,23 @@ class ParserCputune(VirtCLIParser):
  17. find_inst_cb=cls.vcpu_find_inst_cb)
  18.  
  19.  
  20. +#######################
  21. +# --iothreads parsing #
  22. +#######################
  23. +
  24. +class ParserIOThreads(VirtCLIParser):
  25. + cli_arg_name = "iothreads"
  26. + guest_propname = "iothreads"
  27. + remove_first = "iothreads"
  28. + stub_none = False
  29. +
  30. + @classmethod
  31. + def _init_class(cls, **kwargs):
  32. + VirtCLIParser._init_class(**kwargs)
  33. + # Options for IOThreads config
  34. + cls.add_arg("iothreads", "iothreads")
  35. +
  36. +
  37. ###################
  38. # --vcpus parsing #
  39. ###################
  40. diff --git a/virtinst/domain/__init__.py b/virtinst/domain/__init__.py
  41. index f942ee59..7d86ebf6 100644
  42. --- a/virtinst/domain/__init__.py
  43. +++ b/virtinst/domain/__init__.py
  44. @@ -6,6 +6,7 @@ from .blkiotune import DomainBlkiotune
  45. from .clock import DomainClock
  46. from .cpu import DomainCpu
  47. from .cputune import DomainCputune
  48. +from .iothreads import DomainIOThreads
  49. from .features import DomainFeatures
  50. from .idmap import DomainIdmap
  51. from .metadata import DomainMetadata
  52. diff --git a/virtinst/domain/iothreads.py b/virtinst/domain/iothreads.py
  53. new file mode 100644
  54. index 00000000..d5170643
  55. --- /dev/null
  56. +++ b/virtinst/domain/iothreads.py
  57. @@ -0,0 +1,15 @@
  58. +#
  59. +# Copyright 2019 Red Hat, Inc.
  60. +#
  61. +# This work is licensed under the GNU GPLv2 or later.
  62. +# See the COPYING file in the top-level directory.
  63. +
  64. +from ..xmlbuilder import XMLBuilder, XMLProperty, XMLChildProperty
  65. +
  66. +
  67. +class DomainIOThreads(XMLBuilder):
  68. +
  69. + XML_NAME = "iothreads"
  70. + _XML_PROP_ORDER = ["iothreads"]
  71. +
  72. + iothreads = XMLProperty("./iothreads", is_int=True)
  73. diff --git a/virtinst/guest.py b/virtinst/guest.py
  74. index 5479d4e9..aaa001ab 100644
  75. --- a/virtinst/guest.py
  76. +++ b/virtinst/guest.py
  77. @@ -232,6 +232,7 @@ class Guest(XMLBuilder):
  78. clock = XMLChildProperty(DomainClock, is_single=True)
  79. cpu = XMLChildProperty(DomainCpu, is_single=True)
  80. cputune = XMLChildProperty(DomainCputune, is_single=True)
  81. + iothreads = XMLChildProperty(DomainIOThreads, is_single=True)
  82. numatune = XMLChildProperty(DomainNumatune, is_single=True)
  83. pm = XMLChildProperty(DomainPm, is_single=True)
  84. blkiotune = XMLChildProperty(DomainBlkiotune, is_single=True)
  85. 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
  86. index cd22f5ae..abdf8c21 100644
  87. --- a/tests/cli-test-xml/compare/virt-install-singleton-config-2.xml
  88. +++ b/tests/cli-test-xml/compare/virt-install-singleton-config-2.xml
  89. @@ -209,6 +209,9 @@
  90. <cputune>
  91. <vcpupin vcpu="0" cpuset="0-3"/>
  92. </cputune>
  93. + <iothreads>
  94. + <iothreads>4</iothreads>
  95. + </iothreads>
  96. </domain>
  97. <domain type="kvm">
  98. <name>foobar</name>
  99. @@ -423,4 +426,7 @@
  100. <cputune>
  101. <vcpupin vcpu="0" cpuset="0-3"/>
  102. </cputune>
  103. + <iothreads>
  104. + <iothreads>4</iothreads>
  105. + </iothreads>
  106. </domain>
  107. diff --git a/tests/clitest.py b/tests/clitest.py
  108. index ceb1eebd..a5762e50 100644
  109. --- a/tests/clitest.py
  110. +++ b/tests/clitest.py
  111. @@ -485,6 +485,7 @@ numa.cell1.distances.sibling0.id=0,numa.cell1.distances.sibling0.value=21,\
  112. cell1.distances.sibling1.id=1,cell1.distances.sibling1.value=10,\
  113. cache.mode=emulate,cache.level=3
  114. --cputune vcpupin0.vcpu=0,vcpupin0.cpuset=0-3
  115. +--iothreads iothreads=4
  116. --metadata title=my-title,description=my-description,uuid=00000000-1111-2222-3333-444444444444,genid=e9392370-2917-565e-692b-d057f46512d6
  117. --boot cdrom,fd,hd,network,menu=off,loader=/foo/bar,emulator=/new/emu,bootloader=/new/bootld,rebootTimeout=3,initargs="foo=bar baz=woo"
  118. --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