       throw error
 
   return true
-exports.stop.params = {
+
+stop.params = {
   id: { type: 'string' }
   force: { type: 'boolean', optional: true }
 }
-exports.stop.resolve = {
+
+stop.resolve = {
   vm: ['id', 'VM']
 }
 
-exports.suspend = $coroutine ({vm}) ->
+exports.stop = stop
+
+#---------------------------------------------------------------------
+
+suspend = $coroutine ({vm}) ->
   $wait @getXAPI(vm).call 'VM.suspend', vm.ref
 
   return true
-exports.suspend.params = {
-  id: { type: 'string' }
-}
-exports.suspend.resolve = {
+
+suspend.params = {
+  id: { type: 'string' }
+}
+
+suspend.resolve = {
   vm: ['id', 'VM']
 }
 
-exports.resume = $coroutine ({vm, force}) ->
+exports.suspend = suspend
+
+#---------------------------------------------------------------------
+
+resume = $coroutine ({vm, force}) ->
   # FIXME: WTF this is?
   if not force
     force = true

  )

  return true
exports.migrate_pool.permission = 'admin'
exports.migrate_pool.params = {

  # Identifier of the VM to migrate.
  id: { type: 'string' }

    $sendTo: url
  }

import_.params = {
  host: { type: 'string' }
}

import_.resolve = {
  host: ['host', 'host']
}

exports.import = import_

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

# FIXME: position should be optional and default to last.
#
# FIXME: if position is used, all other disks after this position
# should be shifted.
attachDisk = $coroutine ({vm, vdi, position, mode, bootable}) ->
  xapi = @getXAPI VM

  VBD_ref = $wait xapi.call 'VBD.create', {
