summaryrefslogtreecommitdiff
path: root/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2014-03-26 19:21:20 +0000
committer <>2014-05-08 15:03:54 +0000
commitfb123f93f9f5ce42c8e5785d2f8e0edaf951740e (patch)
treec2103d76aec5f1f10892cd1d3a38e24f665ae5db /src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp
parent58ed4748338f9466599adfc8a9171280ed99e23f (diff)
downloadVirtualBox-master.tar.gz
Imported from /home/lorry/working-area/delta_VirtualBox/VirtualBox-4.3.10.tar.bz2.HEADVirtualBox-4.3.10master
Diffstat (limited to 'src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp')
-rw-r--r--src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp47
1 files changed, 39 insertions, 8 deletions
diff --git a/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp b/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp
index cc71cb04..a1158dd5 100644
--- a/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp
+++ b/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp
@@ -4,7 +4,7 @@
*/
/*
- * Copyright (C) 2006-2012 Oracle Corporation
+ * Copyright (C) 2006-2013 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
@@ -26,8 +26,6 @@
# include <VBox/com/array.h>
# include <VBox/com/ErrorInfo.h>
# include <VBox/com/errorprint.h>
-# include <VBox/com/EventQueue.h>
-
# include <VBox/com/VirtualBox.h>
#endif /* !VBOX_ONLY_DOCS */
@@ -155,18 +153,32 @@ int handleUnregisterVM(HandlerArg *a)
machine.asOutParam()),
RTEXITCODE_FAILURE);
SafeIfaceArray<IMedium> aMedia;
- CHECK_ERROR_RET(machine, Unregister(fDelete ? (CleanupMode_T)CleanupMode_DetachAllReturnHardDisksOnly : (CleanupMode_T)CleanupMode_DetachAllReturnNone,
+ CHECK_ERROR_RET(machine, Unregister(CleanupMode_DetachAllReturnHardDisksOnly,
ComSafeArrayAsOutParam(aMedia)),
RTEXITCODE_FAILURE);
if (fDelete)
{
ComPtr<IProgress> pProgress;
- CHECK_ERROR_RET(machine, Delete(ComSafeArrayAsInParam(aMedia), pProgress.asOutParam()),
+ CHECK_ERROR_RET(machine, DeleteConfig(ComSafeArrayAsInParam(aMedia), pProgress.asOutParam()),
RTEXITCODE_FAILURE);
rc = showProgress(pProgress);
CHECK_PROGRESS_ERROR_RET(pProgress, ("Machine delete failed"), RTEXITCODE_FAILURE);
}
+ else
+ {
+ /* Note that the IMachine::Unregister method will return the medium
+ * reference in a sane order, which means that closing will normally
+ * succeed, unless there is still another machine which uses the
+ * medium. No harm done if we ignore the error. */
+ for (size_t i = 0; i < aMedia.size(); i++)
+ {
+ IMedium *pMedium = aMedia[i];
+ if (pMedium)
+ rc = pMedium->Close();
+ }
+ rc = S_OK;
+ }
return RTEXITCODE_SUCCESS;
}
@@ -485,7 +497,7 @@ int handleStartVM(HandlerArg *a)
{
HRESULT rc = S_OK;
std::list<const char *> VMs;
- Bstr sessionType = "gui";
+ Bstr sessionType;
static const RTGETOPTDEF s_aStartVMOptions[] =
{
@@ -825,6 +837,18 @@ int handleSetProperty(HandlerArg *a)
else
CHECK_ERROR(systemProperties, COMSETTER(DefaultMachineFolder)(Bstr(a->argv[1]).raw()));
}
+ else if (!strcmp(a->argv[0], "hwvirtexclusive"))
+ {
+ bool fHwVirtExclusive;
+
+ if (!strcmp(a->argv[1], "on"))
+ fHwVirtExclusive = true;
+ else if (!strcmp(a->argv[1], "off"))
+ fHwVirtExclusive = false;
+ else
+ return errorArgument("Invalid hwvirtexclusive argument '%s'", a->argv[1]);
+ CHECK_ERROR(systemProperties, COMSETTER(ExclusiveHwVirt)(fHwVirtExclusive));
+ }
else if ( !strcmp(a->argv[0], "vrdeauthlibrary")
|| !strcmp(a->argv[0], "vrdpauthlibrary"))
{
@@ -870,6 +894,13 @@ int handleSetProperty(HandlerArg *a)
else
CHECK_ERROR(systemProperties, COMSETTER(AutostartDatabasePath)(Bstr(a->argv[1]).raw()));
}
+ else if (!strcmp(a->argv[0], "defaultfrontend"))
+ {
+ Bstr bstrDefaultFrontend(a->argv[1]);
+ if (!strcmp(a->argv[1], "default"))
+ bstrDefaultFrontend.setNull();
+ CHECK_ERROR(systemProperties, COMSETTER(DefaultFrontend)(bstrDefaultFrontend.raw()));
+ }
else
return errorSyntax(USAGE_SETPROPERTY, "Invalid parameter '%s'", a->argv[0]);
@@ -950,7 +981,7 @@ int handleSharedFolder(HandlerArg *a)
if (fTransient)
{
- ComPtr <IConsole> console;
+ ComPtr<IConsole> console;
/* open an existing session for the VM */
CHECK_ERROR_RET(machine, LockMachine(a->session, LockType_Shared), 1);
@@ -1016,7 +1047,7 @@ int handleSharedFolder(HandlerArg *a)
if (fTransient)
{
- ComPtr <IConsole> console;
+ ComPtr<IConsole> console;
/* open an existing session for the VM */
CHECK_ERROR_RET(machine, LockMachine(a->session, LockType_Shared), 1);