Commit 2fc1d0c1 by Guba Sándor

added bus parameter to disk

parent 9bbb5288
......@@ -185,12 +185,24 @@ class Disk(AclBase, TimeStampedModel):
return {
'qcow2-norm': 'vd',
'qcow2-snap': 'vd',
'iso': 'hd',
'iso': 'sd',
'raw-ro': 'vd',
'raw-rw': 'vd',
}[self.type]
@property
def device_bus(self):
"""Returns the proper device prefix for different types of images.
"""
return {
'qcow2-norm': 'virtio',
'qcow2-snap': 'virtio',
'iso': 'scsi',
'raw-ro': 'virtio',
'raw-rw': 'virtio',
}[self.type]
@property
def is_deletable(self):
"""True if the associated file can be deleted.
"""
......@@ -251,6 +263,7 @@ class Disk(AclBase, TimeStampedModel):
'driver_type': self.vm_format,
'driver_cache': 'none',
'target_device': self.device_type + self.dev_num,
'target_bus': self.device_bus,
'disk_device': 'cdrom' if self.type == 'iso' else 'disk'
}
......
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