Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions drivers/FileSR.py
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,8 @@ def _snapshot(self, snap_type, cbtlog=None, cbt_consistency=None, is_mirror_dest
leaf_vdi.utilisation = self.utilisation
leaf_vdi.sm_config = {}
leaf_vdi.sm_config['vhd-parent'] = dstparent
# TODO: fix the raw snapshot case
leaf_vdi.sm_config["image-format"] = getImageStringFromVdiType(self.vdi_type)
# If the parent is encrypted set the key_hash
# for the new snapshot disk
vdi_ref = self.sr.srcmd.params['vdi_ref']
Expand All @@ -925,6 +927,8 @@ def _snapshot(self, snap_type, cbtlog=None, cbt_consistency=None, is_mirror_dest
base_vdi.size = self.size
base_vdi.utilisation = self.utilisation
base_vdi.sm_config = {}
# TODO: fix the raw snapshot case
base_vdi.sm_config["image-format"] = getImageStringFromVdiType(self.vdi_type)
grandparent = self.cowutil.getParent(newsrc, FileVDI.extractUuid)
if grandparent:
base_vdi.sm_config['vhd-parent'] = grandparent
Expand All @@ -942,6 +946,8 @@ def _snapshot(self, snap_type, cbtlog=None, cbt_consistency=None, is_mirror_dest
vdi_ref = self.sr.srcmd.params['vdi_ref']
sm_config = self.session.xenapi.VDI.get_sm_config(vdi_ref)
sm_config['vhd-parent'] = srcparent
# TODO: fix the raw snapshot case
sm_config["image-format"] = getImageStringFromVdiType(self.vdi_type)
self.session.xenapi.VDI.set_sm_config(vdi_ref, sm_config)
except Exception as e:
util.SMlog("vdi_clone: caught error during VDI.db_introduce: %s" % (str(e)))
Expand Down
2 changes: 2 additions & 0 deletions drivers/LVMSR.py
Original file line number Diff line number Diff line change
Expand Up @@ -1894,6 +1894,8 @@ def _createSnap(self, snapUuid, snapVdiType, snapSizeLV, isNew, is_mirror_destin
snapVDI.sm_config[key] = val
snapVDI.sm_config["vdi_type"] = snapVdiType
snapVDI.sm_config["vhd-parent"] = snapParent
# TODO: fix the raw snapshot case
snapVDI.sm_config["image-format"] = getImageStringFromVdiType(self.vdi_type)
snapVDI.lvname = snapLV
return snapVDI

Expand Down