VBoxAutostartStart.cpp revision b6013430932520fe58eba109db1dfce66a7cad88
/* $Id$ */
/** @file
* VBoxAutostart - VirtualBox Autostart service, start machines during system boot.
*/
/*
* Copyright (C) 2012 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#include <algorithm>
#include <list>
#include <string>
#include "VBoxAutostart.h"
using namespace com;
/**
* VM list entry.
*/
typedef struct AUTOSTARTVM
{
/** ID of the VM to start. */
/** Startup delay of the VM. */
} AUTOSTARTVM;
{
}
{
int vrc = VINF_SUCCESS;
uint32_t uStartupDelay = 0;
if (pCfgAst)
{
{
if (RT_FAILURE(vrc))
}
}
if (uStartupDelay)
{
}
if (vrc == VERR_INTERRUPTED)
return RTEXITCODE_SUCCESS;
/*
* Build a list of all VMs we need to autostart first, apply the overrides
* from the configuration and start the VMs afterwards.
*/
{
/*
* Iterate through the collection
*/
{
if (machines[i])
{
if (!fAccessible)
continue;
if (fAutostart)
{
}
}
}
{
ULONG uDelayCurr = 0;
/* Sort by startup delay and apply base override. */
{
{
autostartSvcLogVerbose("Delay starting of the next VMs for %d seconds ...\n",
}
machine.asOutParam()));
{
{
{
{
{
}
else
}
}
}
}
}
}
}
return rcExit;
}