def set_autostart(vm_, state='on'):
 dom = _get_domain(vm_)
 if (state == 'on'):
  return (dom.setAutostart(1) == 0)
 elif (state == 'off'):
  return (dom.setAutostart(0) == 0)
 else:
  return False

def set_autostart ( vm_ , state = 'on' ) : dom = _get_domain ( vm_ ) if ( state == 'on' ) : return ( dom . setAutostart ( 1 ) == 0 ) elif ( state == 'off' ) : return ( dom . setAutostart ( 0 ) == 0 ) else : return False
set the autostart flag on a vm so that the vm will start with the host system on reboot .