virt-manager/virtinst/domain/blkiotune.py
Athina Plaskasoviti e70ead5098 cli: Add --blkiotune device[0-9]*.read_bytes_sec/write_bytes_sec/read_iops_sec/write_iops_sec options
XML Mapping:

<blkiotune>
  <device>
    ...
    <read_bytes_sec>X</read_bytes_sec>
    <write_bytes_sec>X</write_bytes_sec>
    <read_iops_sec>X</read_iops_sec>
    <write_iops_sec>X</write_iops_sec>
    ...
  </device>
</blkiotune>

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Athina Plaskasoviti <athina.plaskasoviti@gmail.com>
2019-07-25 19:13:13 -04:00

33 lines
951 B
Python

#
# Copyright 2014 Fujitsu Limited.
# Chen Hanxiao <chenhanxiao at cn.fujitsu.com>
#
# This work is licensed under the GNU GPLv2 or later.
# See the COPYING file in the top-level directory.
from ..xmlbuilder import XMLBuilder, XMLChildProperty, XMLProperty
class _BlkiotuneDevice(XMLBuilder):
XML_NAME = "device"
_XML_PROP_ORDER = ["path", "weight"]
path = XMLProperty("./path")
weight = XMLProperty("./weight")
read_bytes_sec = XMLProperty("./read_bytes_sec", is_int=True)
write_bytes_sec = XMLProperty("./write_bytes_sec", is_int=True)
read_iops_sec = XMLProperty("./read_iops_sec", is_int=True)
write_iops_sec = XMLProperty("./write_iops_sec", is_int=True)
class DomainBlkiotune(XMLBuilder):
"""
Class for generating <blkiotune> XML
"""
XML_NAME = "blkiotune"
_XML_PROP_ORDER = ["weight"]
weight = XMLProperty("./weight", is_int=True)
devices = XMLChildProperty(_BlkiotuneDevice)