Commit 2fc1d0c1 by Guba Sándor

added bus parameter to disk

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