VBoxManageSnapshot.cpp revision 57b49c1557a310ee615bc0ee79dd2a2e92319a1b
/* $Id$ */
/** @file
* VBoxManage - The 'snapshot' command.
*/
/*
* Copyright (C) 2006-2009 Sun Microsystems, Inc.
*
* 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.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#include "VBoxManage.h"
using namespace com;
int handleSnapshot(HandlerArg *a)
{
/* we need at least a VM and a command */
if (a->argc < 2)
/* the first argument must be the VM */
/* assume it's a UUID */
{
/* must be a name */
}
if (!machine)
return 1;
do
{
/* we have to open a session for this task. First try an existing session */
/* switch based on the command */
{
/* there must be a name */
if (a->argc < 3)
{
break;
}
{
break;
}
if (a->argc == 5)
{
if (info.isBasicAvailable())
else
RTPrintf("Error: failed to take snapshot. No error message available!\n");
}
}
{
/* exactly one parameter: snapshot name */
if (a->argc != 3)
{
break;
}
/* assume it's a UUID */
{
}
else
{
/* then it must be a name */
}
{
if (info.isBasicAvailable())
else
RTPrintf("Error: failed to discard snapshot. No error message available!\n");
}
}
{
if ( (a->argc != 3)
{
break;
}
bool fAll = false;
fAll = true;
if (fAll)
{
}
else
{
}
{
if (info.isBasicAvailable())
else
RTPrintf("Error: failed to discard. No error message available!\n");
}
}
{
if (a->argc < 3)
{
break;
}
{
}
else
{
/* assume it's a UUID */
{
}
else
{
/* then it must be a name */
}
}
/* parse options */
for (int i = 3; i < a->argc; i++)
{
{
if (a->argc <= i + 1)
{
break;
}
i++;
}
{
if (a->argc <= i + 1)
{
break;
}
i++;
}
else
{
break;
}
}
}
{
/* exactly one parameter: snapshot name */
if (a->argc != 3)
{
break;
}
/* assume it's a UUID */
{
}
else
{
/* then it must be a name */
}
/* get the machine of the given snapshot */
}
else
{
}
} while (0);
}