Skip to content

Commit

Permalink
CA-106886: Don't update vhd-blocks during SR.scan
Browse files Browse the repository at this point in the history
Don't bother updating the vhd-blocks in the XAPI database as this is
owned by the GC and there's no synchronisation for this.

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>
Reviewed-by: Vineeth Thampi Raveendran <vineeth.thampi@citrix.com>

GitHub: closes #37 on xapi-project/sm
  • Loading branch information
Thanos Makatos committed Oct 16, 2013
1 parent 34452aa commit 083722c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/VDI.py
Expand Up @@ -320,9 +320,11 @@ def _override_sm_config(self, sm_config):
del sm_config[key]

def _db_update_sm_config(self, ref, sm_config):
import cleanup
current_sm_config = self.sr.session.xenapi.VDI.get_sm_config(ref)
for key, val in sm_config.iteritems():
if key.startswith("host_") or key == "paused":
if key.startswith("host_") or \
key in ["paused", cleanup.VDI.DB_VHD_BLOCKS]:
continue
if sm_config.get(key) != current_sm_config.get(key):
util.SMlog("_db_update_sm_config: %s sm-config:%s %s->%s" % \
Expand All @@ -331,7 +333,9 @@ def _db_update_sm_config(self, ref, sm_config):
self.sr.session.xenapi.VDI.add_to_sm_config(ref, key, val)

for key in current_sm_config.keys():
if key.startswith("host_") or key == "paused" or key in self.sm_config_keep:
if key.startswith("host_") or \
key in ["paused", cleanup.VDI.DB_VHD_BLOCKS] or \
key in self.sm_config_keep:
continue
if not sm_config.get(key):
util.SMlog("_db_update_sm_config: %s del sm-config:%s" % \
Expand Down

0 comments on commit 083722c

Please sign in to comment.