Commit a668d255 by IK

legacy qemu

parent 1d313f3d
...@@ -103,7 +103,7 @@ class Disk(object): ...@@ -103,7 +103,7 @@ class Disk(object):
""" Create disk from path """ Create disk from path
""" """
path = os.path.realpath(dir + '/' + name) path = os.path.realpath(dir + '/' + name)
output = subprocess.check_output(['qemu-img', 'info', '--force', path]) output = subprocess.check_output(['qemu-img', 'info', path])
type = 'normal' type = 'normal'
base_name = None base_name = None
...@@ -126,7 +126,7 @@ class Disk(object): ...@@ -126,7 +126,7 @@ class Disk(object):
"""Create disk from path.""" """Create disk from path."""
path = os.path.realpath(dir + '/' + name) path = os.path.realpath(dir + '/' + name)
output = subprocess.check_output( output = subprocess.check_output(
['qemu-img', 'info', '--force', '--output=json', path]) ['qemu-img', 'info', '--output=json', path])
disk_info = json.loads(output) disk_info = json.loads(output)
name = name name = name
format = disk_info.get('format') format = disk_info.get('format')
...@@ -289,7 +289,7 @@ class Disk(object): ...@@ -289,7 +289,7 @@ class Disk(object):
else: else:
cmdline = ['ionice', '-c', 'idle', cmdline = ['ionice', '-c', 'idle',
'qemu-img', 'convert', 'qemu-img', 'convert',
'-m', '2', '-O', 'qcow2', '-O', 'qcow2',
downloaded_file, downloaded_file,
self.get_path()] self.get_path()]
subprocess.check_output(cmdline) subprocess.check_output(cmdline)
...@@ -321,7 +321,7 @@ class Disk(object): ...@@ -321,7 +321,7 @@ class Disk(object):
'qemu-img', 'convert'] 'qemu-img', 'convert']
if disk_format == 'qcow2': if disk_format == 'qcow2':
cmdline.append('-c') cmdline.append('-c')
cmdline.extend(['-m', '4', '-O', disk_format, cmdline.extend(['-O', disk_format,
self.get_path(), self.get_path(),
exported_path]) exported_path])
subprocess.check_output(cmdline) subprocess.check_output(cmdline)
...@@ -390,7 +390,7 @@ class Disk(object): ...@@ -390,7 +390,7 @@ class Disk(object):
proc = None proc = None
try: try:
cmdline = ['ionice', '-c', 'idle', cmdline = ['ionice', '-c', 'idle',
'qemu-img', 'convert', '-m', '4'] 'qemu-img', 'convert']
if new_disk.format == 'qcow2': if new_disk.format == 'qcow2':
cmdline.append('-c') cmdline.append('-c')
cmdline.extend(['-O', new_disk.format, cmdline.extend(['-O', new_disk.format,
......
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