clone: keep the same image format on a cross-pool clone
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
ba527471fc
commit
bbb96bcaa8
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright 2013 Red Hat, Inc.
|
||||
# Copyright 2013, 2015 Red Hat, Inc.
|
||||
# Copyright(c) FUJITSU Limited 2007.
|
||||
#
|
||||
# Cloning a virtual machine module.
|
||||
|
@ -347,9 +347,11 @@ class Cloner(object):
|
|||
vol_install.name = clone_vol_install.name
|
||||
else:
|
||||
# Cross pool cloning
|
||||
# Deliberately don't sync input_vol params here
|
||||
# Sync only the format of the image.
|
||||
clone_vol_install.input_vol = orig_disk.get_vol_object()
|
||||
vol_install = clone_vol_install
|
||||
vol_install.input_vol = orig_disk.get_vol_object()
|
||||
vol_install.sync_input_vol(only_format=True)
|
||||
|
||||
vol_install.reflink = self.reflink
|
||||
clone_disk.set_vol_install(vol_install)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright 2008, 2013 Red Hat, Inc.
|
||||
# Copyright 2008, 2013, 2015 Red Hat, Inc.
|
||||
# Cole Robinson <crobinso@redhat.com>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
|
@ -610,15 +610,17 @@ class StorageVolume(_StorageObject):
|
|||
reflink = property(_get_reflink, _set_reflink,
|
||||
doc="flags for VIR_STORAGE_VOL_CREATE_REFLINK")
|
||||
|
||||
def sync_input_vol(self):
|
||||
def sync_input_vol(self, only_format=False):
|
||||
# Pull parameters from input vol into this class
|
||||
parsevol = StorageVolume(self.conn,
|
||||
parsexml=self._input_vol.XMLDesc(0))
|
||||
|
||||
self.format = parsevol.format
|
||||
if only_format:
|
||||
return
|
||||
self.pool = self._input_vol.storagePoolLookupByVolume()
|
||||
self.capacity = parsevol.capacity
|
||||
self.allocation = parsevol.allocation
|
||||
self.format = parsevol.format
|
||||
|
||||
|
||||
##########################
|
||||
|
|
Loading…
Reference in New Issue