Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2fc1d0c1
authored
Jul 15, 2014
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added bus parameter to disk
parent
9bbb5288
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletions
+14
-1
circle/storage/models.py
+14
-1
No files found.
circle/storage/models.py
View file @
2fc1d0c1
...
@@ -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'
:
'
h
d'
,
'iso'
:
'
s
d'
,
'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'
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment