       qos_algorithm_type: ''
       VM: ref
     }
-
-    return
+  ))
 
   # TODO: ? yield xapi.call 'VM.set_PV_args', ref, 'noninteractive'
 

$isArray = require 'lodash.isarray'
$request = require('bluebird').promisify(require('request'))
$result = require 'lodash.result'
endsWith = require 'lodash.endswith'
startsWith = require 'lodash.startswith'
{coroutine: $coroutine} = require 'bluebird'


  # FIXME: device n may already exists, we have to find the first
  # free device number.
  deviceId = 0
  yield Bluebird.all(map(VIFs, (VIF) =>
    network = @getObject VIF.network, 'network'

    return xapi.call 'VIF.create', {

      device: String(deviceId++)
      MAC: VIF.MAC ? ''
