Commit f95aa746 by Karsa Zoltán István

Merge branch 'hotcpu-add' into 'master'

add cache size

See merge request !5
parents be7dc743 abd9852e
......@@ -225,6 +225,7 @@ class VMDisk:
driver_type = None
driver_cache = None
target_device = None
cache_size = None
def __init__(self,
name,
......@@ -235,7 +236,8 @@ class VMDisk:
driver_type="qcow2",
driver_cache="none",
target_device="vda",
target_bus="virtio"):
target_bus="virtio",
cache_size=1024):
self.name = name
self.source = source
self.disk_type = disk_type
......@@ -245,6 +247,7 @@ class VMDisk:
self.driver_cache = driver_cache
self.target_device = target_device
self.target_bus = target_bus
self.cache_size = cache_size
@classmethod
def deserialize(cls, desc):
......@@ -259,11 +262,14 @@ class VMDisk:
ET.SubElement(xml_top, 'target',
attrib={'dev': self.target_device,
'bus': self.target_bus})
ET.SubElement(xml_top, 'driver',
driver = ET.SubElement(xml_top, 'driver',
attrib={
'name': self.driver_name,
'type': self.driver_type,
'cache': self.driver_cache})
metadata_cache = ET.SubElement(driver, 'metadata_cache')
ET.SubElement(metadata_cache, 'max_size',
attrib={'unit': 'bytes'}).text = str(self.cache_size)
return xml_top
def dump_xml(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment