Skip to content

Commit

Permalink
Fix vdi-ref when static vdis are used
Browse files Browse the repository at this point in the history
When static vdis are used there is no snapshots and we don't want to
call method from XAPI.
Upstream PR: xapi-project#631

Signed-off-by: Guillaume <[email protected]>
  • Loading branch information
gthvn1 authored and Wescoeur committed Aug 31, 2023
1 parent 28c1a85 commit cfe00c7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/LVHDSR.py
Original file line number Diff line number Diff line change
Expand Up @@ -1510,10 +1510,11 @@ def detach(self, sr_uuid, vdi_uuid):
elif self.sr.provision == "thick":
needDeflate = False
# except for snapshots, which are always deflated
vdi_ref = self.sr.srcmd.params['vdi_ref']
snap = self.session.xenapi.VDI.get_is_a_snapshot(vdi_ref)
if snap:
needDeflate = True
if self.sr.srcmd.cmd != 'vdi_detach_from_config':
vdi_ref = self.sr.srcmd.params['vdi_ref']
snap = self.session.xenapi.VDI.get_is_a_snapshot(vdi_ref)
if snap:
needDeflate = True

if needDeflate:
try:
Expand Down

0 comments on commit cfe00c7

Please sign in to comment.