Commit 3f72953c by Guba Sándor

merge: added iso handling

parent a7bfdfd6
...@@ -223,13 +223,12 @@ class Disk(object): ...@@ -223,13 +223,12 @@ class Disk(object):
def merge(self, new_disk): def merge(self, new_disk):
''' Merging a new_disk from the actual disk and its base. ''' Merging a new_disk from the actual disk and its base.
''' '''
# Check if snapshot type match
if self.format != 'qcow2':
raise Exception('Invalid format: %s' % self.format)
# Check if file already exists # Check if file already exists
if os.path.isfile(new_disk.get_path()): if os.path.isfile(new_disk.get_path()):
raise Exception('File already exists: %s' % self.get_path()) raise Exception('File already exists: %s' % self.get_path())
if self.base_name: if self.format == "iso":
os.symlink(self.get_path(), new_disk.get_path())
elif self.base_name:
cmdline = ['qemu-img', cmdline = ['qemu-img',
'convert', 'convert',
self.get_path(), self.get_path(),
......
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