 # TODO: integrate in xapi.js
 export_ = $coroutine ({vm, compress, onlyMetadata}) ->
   if vm.power_state is 'Running'
-    yield checkPermissionsForSnapshot.call(this, vm)
+    yield checkPermissionOnSrs.call(this, vm)
 
   stream = yield @getXAPI(vm).exportVm(vm._xapiId, {
     compress: compress ? true,


#=====================================================================

checkPermissionsForSnapshot = (vm) -> (
  permissions = []
  forEach(vm.$VBDs, (vbdId) =>
    vbd = @getObject(vbdId, 'VBD')

#---------------------------------------------------------------------

snapshot = $coroutine ({vm, name}) ->
  yield checkPermissionOnSrs.call(this, vm)

  snapshot = yield @getXAPI(vm).snapshotVm(vm._xapiRef, name)
  return snapshot.$id
