diff --git a/virtinst/cloner.py b/virtinst/cloner.py index 68a5786fc..c533e7e49 100644 --- a/virtinst/cloner.py +++ b/virtinst/cloner.py @@ -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) diff --git a/virtinst/storage.py b/virtinst/storage.py index c07f5580e..8438896c8 100644 --- a/virtinst/storage.py +++ b/virtinst/storage.py @@ -1,5 +1,5 @@ # -# Copyright 2008, 2013 Red Hat, Inc. +# Copyright 2008, 2013, 2015 Red Hat, Inc. # Cole Robinson # # 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 ##########################