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 benjamreis committed Sep 18, 2023
1 parent 1df4dbc commit 94751d4
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 @@ -1509,10 +1509,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 94751d4

Please sign in to comment.