mirror of
https://github.com/retspen/webvirtcloud
synced 2024-10-31 19:44:16 +00:00
Remove cache tag for if device type is cdrom from add function.
This commit is contained in:
parent
e28cc71710
commit
4b6ab68e7f
1 changed files with 7 additions and 5 deletions
|
@ -479,13 +479,15 @@ class wvmInstance(wvmConnect):
|
|||
|
||||
def attach_disk(self, source, target, sourcetype='file', device='disk', driver='qemu', subdriver='raw', cache='none', targetbus='ide'):
|
||||
tree = ElementTree.fromstring(self._XMLDesc(0))
|
||||
xml_disk = """
|
||||
<disk type='%s' device='%s'>
|
||||
<driver name='%s' type='%s' cache='%s'/>
|
||||
<source file='%s'/>
|
||||
xml_disk = "<disk type='%s' device='%s'>" % (sourcetype, device)
|
||||
if device == 'cdrom':
|
||||
xml_disk += "<driver name='%s' type='%s'/>" % (driver, subdriver)
|
||||
elif device == 'disk':
|
||||
xml_disk += "<driver name='%s' type='%s' cache='%s'/>" % (driver, subdriver, cache)
|
||||
xml_disk += """<source file='%s'/>
|
||||
<target dev='%s' bus='%s'/>
|
||||
</disk>
|
||||
""" % (sourcetype, device, driver, subdriver, cache, source, target, targetbus)
|
||||
""" % (source, target, targetbus)
|
||||
if self.get_status() == 5:
|
||||
devices = tree.find('devices')
|
||||
elm_disk = ElementTree.fromstring(xml_disk)
|
||||
|
|
Loading…
Reference in a new issue