VBoxManageMisc.cpp revision bd5c7d04b57ea9dfea041aad6a07cd8823b4e7c0
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * VBoxManage - VirtualBox's command-line interface.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Copyright (C) 2006-2011 Oracle Corporation
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * available from http://www.virtualbox.org. This file is free software;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * you can redistribute it and/or modify it under the terms of the GNU
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * General Public License (GPL) as published by the Free Software
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/*******************************************************************************
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync* Header Files *
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync*******************************************************************************/
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#endif /* !VBOX_ONLY_DOCS */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncusing namespace com;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync return errorSyntax(USAGE_REGISTERVM, "Incorrect number of parameters");
bool fDelete = false;
RTGetOptInit(&GetState, a->argc, a->argv, g_aUnregisterVMOptions, RT_ELEMENTS(g_aUnregisterVMOptions),
fDelete = true;
case VINF_GETOPT_NOT_OPTION:
if (!VMName)
if (RT_C_IS_PRINT(c))
else if (c == VERR_GETOPT_UNKNOWN_OPTION)
if (!VMName)
CHECK_ERROR_RET(machine, Unregister(fDelete ? (CleanupMode_T)CleanupMode_DetachAllReturnHardDisksOnly : (CleanupMode_T)CleanupMode_DetachAllReturnNone,
if (fDelete)
return RTEXITCODE_FAILURE;
return RTEXITCODE_SUCCESS;
bool fRegister = false;
for (int i = 0; i < a->argc; i++)
fRegister = true;
if (fRegister)
return VERR_PARSE_ERROR;
return VINF_SUCCESS;
if (pszComma)
if (len > 0)
if (pszComma)
return rc;
bool fRegister = false;
fRegister = true;
case VINF_GETOPT_NOT_OPTION:
if (!pszSrcName)
if (!pszSrcName)
if (pszSnapshotName)
if (!pszTrgName)
NULL,
mode,
return RTEXITCODE_FAILURE;
if (fRegister)
return RTEXITCODE_SUCCESS;
#ifdef VBOX_WITH_VBOXSDL
#ifdef VBOX_WITH_HEADLESS
case VINF_GETOPT_NOT_OPTION:
if (!VMName)
if (RT_C_IS_PRINT(c))
else if (c == VERR_GETOPT_UNKNOWN_OPTION)
if (!VMName)
if (machine)
if (pszDisplay)
if (pszXAuth)
if (machine)
if (machine)
for (size_t i = 0;
if (machine)
for (size_t i = 0;
NULL));
if (machine)
NULL));
int vrc;
if (!machine)
bool fTransient = false;
bool fWritable = true;
bool fAutoMount = false;
fWritable = false;
fTransient = true;
fAutoMount = true;
if (fTransient)
if (console)
bool fTransient = false;
fTransient = true;
return errorSyntax(USAGE_SHAREDFOLDER_REMOVE, "Invalid parameter '%s'", Utf8Str(a->argv[i]).c_str());
if (!name)
if (fTransient)
if (console)
CHECK_ERROR2_RET(a->virtualBox, COMGETTER(ExtensionPackManager)(ptrExtPackMgr.asOutParam()), RTEXITCODE_FAILURE);
int ch;
bool fReplace = false;
RTGetOptInit(&GetState, a->argc, a->argv, s_aInstallOptions, RT_ELEMENTS(s_aInstallOptions), 1, 0 /*fFlags*/);
switch (ch)
fReplace = true;
case VINF_GETOPT_NOT_OPTION:
if (pszName)
if (!pszName)
CHECK_ERROR2_RET(ptrExtPackMgr, OpenExtPackFile(bstrTarball.raw(), ptrExtPackFile.asOutParam()), RTEXITCODE_FAILURE);
CHECK_ERROR2_RET(ptrExtPackFile, Install(fReplace, NULL, ptrProgress.asOutParam()), RTEXITCODE_FAILURE);
return RTEXITCODE_FAILURE;
bool fForced = false;
RTGetOptInit(&GetState, a->argc, a->argv, s_aUninstallOptions, RT_ELEMENTS(s_aUninstallOptions), 1, 0);
switch (ch)
fForced = true;
case VINF_GETOPT_NOT_OPTION:
if (pszName)
if (!pszName)
CHECK_ERROR2_RET(ptrExtPackMgr, Uninstall(bstrName.raw(), fForced, NULL, ptrProgress.asOutParam()), RTEXITCODE_FAILURE);
return RTEXITCODE_FAILURE;
return RTEXITCODE_SUCCESS;