cli: Move blkiotune and memorybacking out of the device code area

This commit is contained in:
Cole Robinson 2016-06-11 13:45:05 -04:00
parent 42d4179e1e
commit 1330f8c675

View File

@ -1288,6 +1288,36 @@ class ParserMemorytune(VirtCLIParser):
self.set_param("min_guarantee", "min_guarantee")
#######################
# --blkiotune parsing #
#######################
class ParserBlkiotune(VirtCLIParser):
def _init_params(self):
self.objclass = DomainBlkiotune
self.remove_first = "weight"
self.set_param("weight", "weight")
self.set_param("device_path", "device_path")
self.set_param("device_weight", "device_weight")
###########################
# --memorybacking parsing #
###########################
class ParserMemorybacking(VirtCLIParser):
def _init_params(self):
self.objclass = DomainMemorybacking
self.set_param("hugepages", "hugepages", is_onoff=True)
self.set_param("page_size", "size")
self.set_param("page_unit", "unit")
self.set_param("page_nodeset", "nodeset", can_comma=True)
self.set_param("nosharepages", "nosharepages", is_onoff=True)
self.set_param("locked", "locked", is_onoff=True)
###################
# --vcpus parsing #
###################
@ -2152,36 +2182,6 @@ class ParserPanic(VirtCLIParser):
self.set_param(None, "iobase", setter_cb=set_iobase_cb)
#######################
# --blkiotune parsing #
#######################
class ParserBlkiotune(VirtCLIParser):
def _init_params(self):
self.objclass = DomainBlkiotune
self.remove_first = "weight"
self.set_param("weight", "weight")
self.set_param("device_path", "device_path")
self.set_param("device_weight", "device_weight")
########################
# --memorybacking parsing #
########################
class ParserMemorybacking(VirtCLIParser):
def _init_params(self):
self.objclass = DomainMemorybacking
self.set_param("hugepages", "hugepages", is_onoff=True)
self.set_param("page_size", "size")
self.set_param("page_unit", "unit")
self.set_param("page_nodeset", "nodeset", can_comma=True)
self.set_param("nosharepages", "nosharepages", is_onoff=True)
self.set_param("locked", "locked", is_onoff=True)
######################################################
# --serial, --parallel, --channel, --console parsing #
######################################################