Cole Robinson 7c835321be cli: --blkiotune: Convert device.* to device[0-9]*.
Libvirt can represent multiple <device> blocks here, so mirror that
on the command line
2019-05-15 09:59:25 -04:00

29 lines
687 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")
class DomainBlkiotune(XMLBuilder):
"""
Class for generating <blkiotune> XML
"""
XML_NAME = "blkiotune"
_XML_PROP_ORDER = ["weight"]
weight = XMLProperty("./weight", is_int=True)
devices = XMLChildProperty(_BlkiotuneDevice)