Fix wrong disk type limitation for disk IO throttling

The disk I/O limits feature in QEMU block layer allows I/O throttling
to be used across all underlying storage types.

Change-Id: If99107955fc976b00ee101d4c6a685c29e655f82
Closes-Bug: #1362129
This commit is contained in:
Yaguang Tang 2014-08-28 16:58:02 +08:00
parent 58e6eb857a
commit 2e90d62727
1 changed files with 5 additions and 8 deletions

View File

@ -142,14 +142,11 @@ class Image(object):
tune_items = ['disk_read_bytes_sec', 'disk_read_iops_sec', tune_items = ['disk_read_bytes_sec', 'disk_read_iops_sec',
'disk_write_bytes_sec', 'disk_write_iops_sec', 'disk_write_bytes_sec', 'disk_write_iops_sec',
'disk_total_bytes_sec', 'disk_total_iops_sec'] 'disk_total_bytes_sec', 'disk_total_iops_sec']
# Note(yaguang): Currently, the only tuning available is Block I/O for key, value in extra_specs.iteritems():
# throttling for qemu. scope = key.split(':')
if self.source_type in ['file', 'block']: if len(scope) > 1 and scope[0] == 'quota':
for key, value in extra_specs.iteritems(): if scope[1] in tune_items:
scope = key.split(':') setattr(info, scope[1], value)
if len(scope) > 1 and scope[0] == 'quota':
if scope[1] in tune_items:
setattr(info, scope[1], value)
return info return info
def check_image_exists(self): def check_image_exists(self):