VBoxManageGuestCtrl.cpp revision 32b47b2e79953e9f29ce700cc1ecaeb479c57ec0
/* $Id$ */
/** @file
* VBoxManage - Implementation of guestcontrol command.
*/
/*
* Copyright (C) 2010-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;
* 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.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#include "VBoxManage.h"
#include "VBoxManageGuestCtrl.h"
#ifndef VBOX_ONLY_DOCS
#include <map>
#include <vector>
#ifdef USE_XPCOM_QUEUE
# include <errno.h>
#endif
#include <signal.h>
#ifdef RT_OS_DARWIN
# include <CoreFoundation/CFRunLoop.h>
#endif
using namespace com;
/** Set by the signal handler. */
static volatile bool g_fGuestCtrlCanceled = false;
/** Our global session object which is also used in the
* signal handler to abort operations properly. */
/**
* Command context flags.
*/
/** No flags set. */
#define CTLCMDCTX_FLAGS_NONE 0
/** Don't install a signal handler (CTRL+C trap). */
#define CTLCMDCTX_FLAGS_NO_SIGNAL_HANDLER RT_BIT(0)
/** No guest session needed. */
/** Detach the guest session. That is, don't close the
* guest session automatically on exit. */
/**
* Context for handling a specific command.
*/
typedef struct GCTLCMDCTX
{
/** Command-specific argument count. */
int iArgc;
/** Command-specific argument vector. */
char **ppaArgv;
/** First argv to start parsing with. */
int iFirstArgc;
/** Command context flags. */
/** Verbose flag. */
bool fVerbose;
/** User name. */
/** Password. */
/** Domain. */
/** Pointer to the IGuest interface. */
/** Pointer to the to be used guest session. */
} GCTLCMDCTX, *PGCTLCMDCTX;
typedef struct GCTLCMD
{
/**
* Actual command handler callback.
*
* @param pCtx Pointer to command context to use.
*/
typedef struct COPYCONTEXT
{
: fDryRun(false),
fHostToGuest(false)
{
}
bool fDryRun;
bool fHostToGuest;
} COPYCONTEXT, *PCOPYCONTEXT;
/**
* An entry for a source element, including an optional DOS-like wildcard (*,?).
*/
class SOURCEFILEENTRY
{
public:
SOURCEFILEENTRY(const char *pszSource)
{
}
const char* GetSource() const
{
}
const char* GetFilter() const
{
}
private:
{
if ( !RTFileExists(pszPath)
&& !RTDirExists(pszPath))
{
/* No file and no directory -- maybe a filter? */
if ( pszFilename
{
/* Yep, get the actual filter part. */
/* Remove the filter from actual sourcec directory name. */
}
}
return VINF_SUCCESS; /* @todo */
}
private:
};
/**
*/
typedef struct DESTFILEENTRY
{
/*
* Map for holding destination entires, whereas the key is the destination
* directory and the mapped value is a vector holding all elements for this directoy.
*/
/**
* Special exit codes for returning errors/information of a
* started guest process to the command line VBoxManage was started from.
* Useful for e.g. scripting.
*
* @note These are frozen as of 4.1.0.
*/
enum EXITCODEEXEC
{
/* Process exited normally but with an exit code <> 0. */
EXITCODEEXEC_CODE = 16,
EXITCODEEXEC_FAILED = 17,
EXITCODEEXEC_TERM_SIGNAL = 18,
EXITCODEEXEC_TERM_ABEND = 19,
EXITCODEEXEC_TIMEOUT = 20,
EXITCODEEXEC_DOWN = 21,
};
/*
* Common getopt definitions, starting at 1000.
* Specific command definitions will start all at 2000.
*/
enum GETOPTDEF_COMMON
{
GETOPTDEF_COMMON_PASSWORD = 1000
};
/**
* RTGetOpt-IDs for the guest execution control command line.
*/
enum GETOPTDEF_EXEC
{
};
enum GETOPTDEF_COPY
{
GETOPTDEF_COPY_DRYRUN = 1000,
};
enum GETOPTDEF_MKDIR
{
};
enum GETOPTDEF_RM
{
};
enum GETOPTDEF_RMDIR
{
GETOPTDEF_RMDIR_RECURSIVE = 2000
};
{
GETOPTDEF_SESSIONCLOSE_ALL = 2000
};
enum GETOPTDEF_STAT
{
};
enum OUTPUTTYPE
{
OUTPUTTYPE_UNDEFINED = 0,
OUTPUTTYPE_DOS2UNIX = 10,
OUTPUTTYPE_UNIX2DOS = 20
};
static int ctrlCopyDirExists(PCOPYCONTEXT pContext, bool bGuest, const char *pszDir, bool *fExists);
#endif /* VBOX_ONLY_DOCS */
{
"%s guestcontrol %s <uuid|vmname>\n"
" exec[ute]\n"
" --image <path to program> --username <name>\n"
" [--passwordfile <file> | --password <password>]\n"
" [--domain <domain>] [--verbose] [--timeout <msec>]\n"
" [--environment \"<NAME>=<VALUE> [<NAME>=<VALUE>]\"]\n"
" [--wait-exit] [--wait-stdout] [--wait-stderr]\n"
" [--dos2unix] [--unix2dos]\n"
" [-- [<argument1>] ... [<argumentN>]]\n"
/** @todo Add a "--" parameter (has to be last parameter) to directly execute
"\n"
" copyfrom\n"
" <guest source> <host dest> --username <name>\n"
" [--passwordfile <file> | --password <password>]\n"
" [--domain <domain>] [--verbose]\n"
" [--dryrun] [--follow] [--recursive]\n"
"\n"
" copyto|cp\n"
" <host source> <guest dest> --username <name>\n"
" [--passwordfile <file> | --password <password>]\n"
" [--domain <domain>] [--verbose]\n"
" [--dryrun] [--follow] [--recursive]\n"
"\n"
" createdir[ectory]|mkdir|md\n"
" <guest directory>... --username <name>\n"
" [--passwordfile <file> | --password <password>]\n"
" [--domain <domain>] [--verbose]\n"
" [--parents] [--mode <mode>]\n"
"\n"
" removedir[ectory]|rmdir|rm\n"
" <guest directory>... --username <name>\n"
" [--passwordfile <file> | --password <password>]\n"
" [--domain <domain>] [--verbose]\n"
" [--recursive|-R|-r]\n"
"\n"
" removefile|rm\n"
" <guest file>... --username <name>\n"
" [--passwordfile <file> | --password <password>]\n"
" [--domain <domain>] [--verbose]\n"
"\n"
" createtemp[orary]|mktemp\n"
" <template> --username <name>\n"
" [--passwordfile <file> | --password <password>]\n"
" [--directory] [--secure] [--tmpdir <directory>]\n"
" [--domain <domain>] [--mode <mode>] [--verbose]\n"
"\n"
" list <all|sessions|processes|files> [--verbose]\n"
"\n"
/** @todo Add an own help group for "session" and "process" sub commands. */
" process kill --session-id <ID>\n"
" | --session-name <name or pattern>\n"
" [--verbose]\n"
" <PID> ... <PID n>\n"
"\n"
" [p[s]]kill --session-id <ID>\n"
" | --session-name <name or pattern>\n"
" [--verbose]\n"
" <PID> ... <PID n>\n"
"\n"
" session close --session-id <ID>\n"
" | --session-name <name or pattern>\n"
" | --all\n"
" [--verbose]\n"
" stat\n"
" <file>... --username <name>\n"
" [--passwordfile <file> | --password <password>]\n"
" [--domain <domain>] [--verbose]\n"
"\n"
" updateadditions\n"
" [--source <guest additions .ISO>] [--verbose]\n"
" [--wait-start]\n"
" [-- [<argument1>] ... [<argumentN>]]\n"
"\n"
" watch [--verbose]\n"
}
#ifndef VBOX_ONLY_DOCS
#ifdef RT_OS_WINDOWS
{
bool fEventHandled = FALSE;
switch (dwCtrlType)
{
/* User pressed CTRL+C or CTRL+BREAK or an external event was sent
* via GenerateConsoleCtrlEvent(). */
case CTRL_BREAK_EVENT:
case CTRL_CLOSE_EVENT:
case CTRL_C_EVENT:
ASMAtomicWriteBool(&g_fGuestCtrlCanceled, true);
if (!g_pGuestSession.isNull())
g_pGuestSession->Close();
break;
default:
break;
/** @todo Add other events here. */
}
return fEventHandled;
}
#else /* !RT_OS_WINDOWS */
/**
* Signal handler that sets g_fGuestCtrlCanceled.
*
* This can be executed on any thread in the process, on Windows it may even be
* a thread dedicated to delivering this signal. Do not doing anything
* unnecessary here.
*/
static void guestCtrlSignalHandler(int iSignal)
{
ASMAtomicWriteBool(&g_fGuestCtrlCanceled, true);
if (!g_pGuestSession.isNull())
g_pGuestSession->Close();
}
#endif
/**
* Installs a custom signal handler to get notified
* whenever the user wants to intercept the program.
*
** @todo Make this handler available for all VBoxManage modules?
*/
static int ctrlSignalHandlerInstall(void)
{
int rc = VINF_SUCCESS;
#ifdef RT_OS_WINDOWS
{
}
#else
# ifdef SIGBREAK
# endif
#endif
return rc;
}
/**
* Uninstalls a previously installed signal handler.
*/
static int ctrlSignalHandlerUninstall(void)
{
int rc = VINF_SUCCESS;
#ifdef RT_OS_WINDOWS
{
}
#else
# ifdef SIGBREAK
# endif
#endif
return rc;
}
/**
* Translates a process status to a human readable
* string.
*/
{
switch (enmStatus)
{
case ProcessStatus_Starting:
return "starting";
case ProcessStatus_Started:
return "started";
case ProcessStatus_Paused:
return "paused";
return "terminating";
return "successfully terminated";
return "terminated by signal";
return "abnormally aborted";
return "timed out";
return "timed out, hanging";
case ProcessStatus_Down:
return "killed";
case ProcessStatus_Error:
return "error";
default:
break;
}
return "unknown";
}
{
int vrc = EXITCODEEXEC_SUCCESS;
switch (enmStatus)
{
case ProcessStatus_Starting:
break;
case ProcessStatus_Started:
break;
case ProcessStatus_Paused:
break;
break;
break;
break;
break;
break;
break;
case ProcessStatus_Down:
* not exactly an error of the started process ... */
break;
case ProcessStatus_Error:
break;
default:
break;
}
return vrc;
}
/**
* Translates a guest session status to a human readable
* string.
*/
{
switch (enmStatus)
{
return "starting";
return "started";
return "terminating";
return "terminated";
return "timed out";
return "timed out, hanging";
case GuestSessionStatus_Down:
return "killed";
case GuestSessionStatus_Error:
return "error";
default:
break;
}
return "unknown";
}
/**
* Translates a guest file status to a human readable
* string.
*/
{
switch (enmStatus)
{
case FileStatus_Opening:
return "opening";
case FileStatus_Open:
return "open";
case FileStatus_Closing:
return "closing";
case FileStatus_Closed:
return "closed";
case FileStatus_Down:
return "killed";
case FileStatus_Error:
return "error";
default:
break;
}
return "unknown";
}
{
if ( errorInfo.isFullAvailable()
|| errorInfo.isBasicAvailable())
{
/* If we got a VBOX_E_IPRT error we handle the error in a more gentle way
* because it contains more accurate info about what went wrong. */
else
{
RTMsgError("Error details:");
}
return VERR_GENERAL_FAILURE; /** @todo */
}
}
{
return ctrlPrintError(ErrInfo);
}
{
int vrc = VINF_SUCCESS;
do
{
if (!fCanceled)
{
{
}
}
} while(0);
AssertMsgStmt(SUCCEEDED(rc), ("Could not lookup progress information\n"), vrc = VERR_COM_UNEXPECTED);
return vrc;
}
/**
* Un-initializes the VM after guest control usage.
* @param pCmdCtx Pointer to command context.
* @param uFlags Command context flags.
*/
{
do
{
{
{
RTPrintf("Closing guest session ...\n");
/* Keep going - don't break here. Try to unlock the
* machine down below. */
}
RTPrintf("Guest session detached\n");
}
} while (0);
}
/**
* Initializes the VM for IGuest operations.
*
* That is, checks whether it's up and running, if it can be locked (shared
* only) and returns a valid IGuest pointer on success. Also, it does some
* basic command line processing and opens a guest session, if required.
*
* @return RTEXITCODE status code.
* @param pArg Pointer to command line argument structure.
* @param pCmdCtx Pointer to command context.
* @param uFlags Command context flags.
*/
{
/* Lookup VM. */
/* Assume it's an UUID. */
machine.asOutParam()));
{
/* Machine is running? */
&& (machineState != MachineState_Running))
}
else
if (rcExit == RTEXITCODE_SUCCESS)
{
/*
* Process standard options which are served by all commands.
*/
static const RTGETOPTDEF s_aOptions[] =
{
};
/*
* Allocate per-command argv. This then only contains the specific arguments
* the command needs.
*/
{
}
else
{
int ch;
2, /* Skip VM name and guest control command */
&& (rcExit == RTEXITCODE_SUCCESS))
{
/* For options that require an argument, ValueUnion has received the value. */
switch (ch)
{
case 'u': /* User name */
if (!(uFlags & CTLCMDCTX_FLAGS_SESSION_ANONYMOUS))
break;
case GETOPTDEF_COMMON_PASSWORD: /* Password */
if (!(uFlags & CTLCMDCTX_FLAGS_SESSION_ANONYMOUS))
{
}
break;
case 'p': /* Password file */
{
if (!(uFlags & CTLCMDCTX_FLAGS_SESSION_ANONYMOUS))
break;
}
case 'd': /* domain */
if (!(uFlags & CTLCMDCTX_FLAGS_SESSION_ANONYMOUS))
break;
case 'v': /* Verbose */
break;
case VINF_GETOPT_NOT_OPTION:
/* Fall through is intentional. */
default:
{
if (!pszArg)
{
"Not enough memory for command line handling\n");
break;
}
break;
}
} /* switch */
} /* while RTGetOpt */
}
}
/*
* Check for mandatory stuff.
*/
if (rcExit == RTEXITCODE_SUCCESS)
{
#if 0
#endif
if (!(uFlags & CTLCMDCTX_FLAGS_SESSION_ANONYMOUS))
{
}
}
if (rcExit == RTEXITCODE_SUCCESS)
{
/*
* Build up a reasonable guest session name. Useful for identifying
* a specific session when listing / searching for them.
*/
char *pszSessionName;
if (0 >= RTStrAPrintf(&pszSessionName,
"[%RU32] VBoxManage Guest Control [%s] - %s",
do
{
/* Open a session for the VM. */
/* Get the associated console. */
/* ... and session machine. */
/* Get IGuest interface. */
if (!(uFlags & CTLCMDCTX_FLAGS_SESSION_ANONYMOUS))
{
/* Open a guest session. */
}
if (!(uFlags & CTLCMDCTX_FLAGS_NO_SIGNAL_HANDLER))
} while (0);
}
if (rcExit == RTEXITCODE_SUCCESS)
{
}
else /* Clean up on failure. */
return rcExit;
}
/**
* Prints the desired guest output to a stream.
*
* @return IPRT status code.
* @param pProcess Pointer to appropriate process object.
* @param pStrmOutput Where to write the data.
* @param uHandle Handle where to read the data from.
* @param uTimeoutMS Timeout (in ms) to wait for the operation to complete.
*/
{
int vrc = VINF_SUCCESS;
else
{
if (cbOutputData > 0)
{
/*
* If aOutputData is text data from the guest process' stdout or stderr,
* it has a platform dependent line ending. So standardize on
*/
char *pszBufUTF8;
if (RT_SUCCESS(vrc))
{
for (char *s = pszBufUTF8, *d = s;
s++, d++)
{
if (*s == '\r')
{
/* skip over CR, adjust destination */
d--;
}
else if (s != d)
*d = *s;
}
if (RT_FAILURE(vrc))
}
else
}
}
return vrc;
}
/**
* Returns the remaining time (in ms) based on the start time and a set
* timeout value. Returns RT_INDEFINITE_WAIT if no timeout was specified.
*
* @return RTMSINTERVAL Time left (in ms).
* @param u64StartMs Start time (in ms).
* @param cMsTimeout Timeout value (in ms).
*/
{
return RT_INDEFINITE_WAIT;
if (u64ElapsedMs >= cMsTimeout)
return 0;
}
{
/*
* Parse arguments.
*/
static const RTGETOPTDEF s_aOptions[] =
{
};
int ch;
RTGetOptInit(&GetState, pCtx->iArgc, pCtx->ppaArgv, s_aOptions, RT_ELEMENTS(s_aOptions), pCtx->iFirstArgc, 0);
RTMSINTERVAL cMsTimeout = 0;
bool fDetached = true;
int vrc = VINF_SUCCESS;
try
{
/* Wait for process start in any case. This is useful for scripting VBoxManage
* when relying on its overall exit code. */
&& RT_SUCCESS(vrc))
{
/* For options that require an argument, ValueUnion has received the value. */
switch (ch)
{
case GETOPTDEF_EXEC_DOS2UNIX:
if (eOutputType != OUTPUTTYPE_UNDEFINED)
break;
case 'e': /* Environment */
{
char **papszArg;
int cArgs;
if (RT_FAILURE(vrc))
for (int j = 0; j < cArgs; j++)
break;
}
break;
break;
case 'i':
break;
/** @todo Add a hidden flag. */
case 't': /* Timeout */
break;
case GETOPTDEF_EXEC_UNIX2DOS:
if (eOutputType != OUTPUTTYPE_UNDEFINED)
break;
fDetached = false;
break;
fDetached = false;
break;
fDetached = false;
break;
case VINF_GETOPT_NOT_OPTION:
else
break;
default:
break;
} /* switch */
} /* while RTGetOpt */
}
{
}
if (RT_FAILURE(vrc))
/** @todo Any output conversion not supported yet! */
if (eOutputType != OUTPUTTYPE_UNDEFINED)
try
{
do
{
/* Adjust process creation flags if we don't want to wait for process termination. */
if (fDetached)
/* Get current time stamp to later calculate rest of timeout left. */
/*
* Wait for guest session to start.
*/
{
if (cMsTimeout == 0)
RTPrintf("Waiting for guest session to start ...\n");
else
}
CHECK_ERROR_BREAK(g_pGuestSession, WaitForArray(ComSafeArrayAsInParam(aSessionWaitFlags), cMsTimeout, &sessionWaitResult));
/* Note: This might happen when Guest Additions < 4.3 are installed which don't
* support dedicated guest sessions. */
{
}
else
{
RTPrintf("Error starting guest session\n");
break;
}
{
if (cMsTimeout == 0)
RTPrintf("Waiting for guest process to start ...\n");
else
}
/*
* Execute the process.
*/
pProcess.asOutParam()));
/** @todo does this need signal handling? there's no progress object etc etc */
if (RT_FAILURE(vrc))
if (RT_FAILURE(vrc))
/* Wait for process to exit ... */
bool fReadStdOut, fReadStdErr;
fReadStdOut = fReadStdErr = false;
bool fCompleted = false;
while (!fCompleted && cMsTimeLeft != 0)
{
cMsTimeLeft, &waitResult));
switch (waitResult)
{
case ProcessWaitResult_Start:
{
{
RTPrintf("Process '%s' (PID %RU32) started\n",
}
else /** @todo Introduce a --quiet option for not printing this. */
{
/* Just print plain PID to make it easier for scripts
* invoking VBoxManage. */
}
/* We're done here if we don't want to wait for termination. */
if (fDetached)
fCompleted = true;
break;
}
case ProcessWaitResult_StdOut:
fReadStdOut = true;
break;
case ProcessWaitResult_StdErr:
fReadStdErr = true;
break;
/* Process terminated, we're done */
fCompleted = true;
break;
{
* yield to reduce the CPU load due to busy waiting. */
RTThreadYield(); /* Optional, don't check rc. */
/* Try both, stdout + stderr. */
fReadStdOut = fReadStdErr = true;
break;
}
default:
/* Ignore all other results, let the timeout expire */
break;
}
if (g_fGuestCtrlCanceled)
break;
if (fReadStdOut) /* Do we need to fetch stdout data? */
{
fReadStdOut = false;
}
if (fReadStdErr) /* Do we need to fetch stdout data? */
{
fReadStdErr = false;
}
if ( RT_FAILURE(vrc)
break;
/* Did we run out of time? */
if ( cMsTimeout
break;
} /* while */
/* Report status back to the user. */
if ( fCompleted
&& !g_fGuestCtrlCanceled)
{
{
RTPrintf("Exit code=%u (Status=%u [%s])\n",
}
}
else
{
RTPrintf("Process execution aborted!\n");
}
} while (0);
}
{
rc = E_OUTOFMEMORY;
}
bool fCloseSession = false;
{
/*
* Only close the guest session if we waited for the guest
* process to exit. Otherwise we wouldn't have any chance to
*/
}
else /* Close session on error. */
fCloseSession = true;
if (!fCloseSession)
if ( rcExit == RTEXITCODE_SUCCESS
{
/* Make sure an appropriate exit code is set on error. */
}
return rcExit;
}
/**
* Creates a copy context structure which then can be used with various
* guest control copy functions. Needs to be free'd with ctrlCopyContextFree().
*
* @return IPRT status code.
* @param pCtx Pointer to command context.
* @param fDryRun Flag indicating if we want to run a dry run only.
* @param fHostToGuest Flag indicating if we want to copy from host to guest
* or vice versa.
* @param strSessionName Session name (only for identification purposes).
* @param ppContext Pointer which receives the allocated copy context.
*/
const Utf8Str &strSessionName,
{
return VINF_SUCCESS;
}
/**
* Frees are previously allocated copy context structure.
*
* @param pContext Pointer to copy context to free.
*/
{
if (pContext)
{
if (pContext->pGuestSession)
delete pContext;
}
}
/**
* Translates a source path to a destination path (can be both sides,
* either host or guest). The source root is needed to determine the start
* of the relative source path which also needs to present in the destination
* path.
*
* @return IPRT status code.
* @param pszSourceRoot Source root path. No trailing directory slash!
* @param pszSource Actual source to transform. Must begin with
* the source root path!
* @param pszDest Destination path.
* @param ppszTranslated Pointer to the allocated, translated destination
* path. Must be free'd with RTStrFree().
*/
const char *pszDest, char **ppszTranslated)
{
#if 0 /** @todo r=bird: It does not make sense to apply host path parsing semantics onto guest paths. I hope this code isn't mixing host/guest paths in the same way anywhere else... @bugref{6344} */
#endif
/* Construct the relative dest destination path by "subtracting" the
* source from the source root, e.g.
*
* source root path = "e:\foo\", source = "e:\foo\bar"
* dest = "d:\baz\"
* translated = "d:\baz\bar\"
*/
char szTranslated[RTPATH_MAX];
int vrc;
if (!RTPathFilename(pszDestPath))
{
}
else
{
if (pszDestFileName)
{
}
else
}
if (RT_SUCCESS(vrc))
{
#if 0
RTPrintf("Root: %s, Source: %s, Dest: %s, Translated: %s\n",
#endif
}
return vrc;
}
#ifdef DEBUG_andy
static int tstTranslatePath()
{
RTAssertSetMayPanic(false /* Do not freak out, please. */);
static struct
{
const char *pszSourceRoot;
const char *pszSource;
const char *pszDest;
const char *pszTranslated;
int iResult;
} aTests[] =
{
/* Invalid stuff. */
#ifdef RT_OS_WINDOWS
/* Windows paths. */
#else /* RT_OS_WINDOWS */
{ "/home/test/foo", "/home/test/foo/baz/bar.txt", "/opt/test", "/opt/test/baz/bar.txt", VINF_SUCCESS },
#endif /* !RT_OS_WINDOWS */
/* Mixed paths*/
/** @todo */
{ NULL }
};
{
RTPrintf("\tSourceRoot=%s, Source=%s, Dest=%s\n",
char *pszTranslated = NULL;
{
RTPrintf("\tReturned %Rrc, expected %Rrc\n",
}
else if ( pszTranslated
{
RTPrintf("\tReturned translated path %s, expected %s\n",
}
if (pszTranslated)
{
}
}
return VINF_SUCCESS; /* @todo */
}
#endif
/**
* Creates a directory on the destination, based on the current copy
* context.
*
* @return IPRT status code.
* @param pContext Pointer to current copy control context.
* @param pszDir Directory to create.
*/
{
bool fDirExists;
if ( RT_SUCCESS(vrc)
&& fDirExists)
{
return VINF_SUCCESS;
}
/* If querying for a directory existence fails there's no point of even trying
* to create such a directory. */
if (RT_FAILURE(vrc))
return vrc;
return VINF_SUCCESS;
{
}
else /* ... or on the host. */
{
if (vrc == VERR_ALREADY_EXISTS)
vrc = VINF_SUCCESS;
}
return vrc;
}
/**
*
* @return IPRT status code.
* @param pContext Pointer to current copy control context.
* @param bGuest true if directory needs to be checked on the guest
* or false if on the host.
* @param pszDir Actual directory to check.
* @param fExists Pointer which receives the result if the
* given directory exists or not.
*/
{
AssertPtrReturn(pContext, false);
AssertPtrReturn(pszDir, false);
AssertPtrReturn(fExists, false);
int vrc = VINF_SUCCESS;
if (bGuest)
{
else
*fExists = fDirExists ? true : false;
}
else
return vrc;
}
/**
* Checks whether a specific directory exists on the destination, based
* on the current copy context.
*
* @return IPRT status code.
* @param pContext Pointer to current copy control context.
* @param pszDir Actual directory to check.
* @param fExists Pointer which receives the result if the
* given directory exists or not.
*/
bool *fExists)
{
}
/**
* Checks whether a specific directory exists on the source, based
* on the current copy context.
*
* @return IPRT status code.
* @param pContext Pointer to current copy control context.
* @param pszDir Actual directory to check.
* @param fExists Pointer which receives the result if the
* given directory exists or not.
*/
bool *fExists)
{
}
/**
*
* @return IPRT status code.
* @param pContext Pointer to current copy control context.
* @param bGuest true if file needs to be checked on the guest
* or false if on the host.
* @param pszFile Actual file to check.
* @param fExists Pointer which receives the result if the
* given file exists or not.
*/
{
AssertPtrReturn(pContext, false);
AssertPtrReturn(pszFile, false);
AssertPtrReturn(fExists, false);
int vrc = VINF_SUCCESS;
if (bOnGuest)
{
else
*fExists = fFileExists ? true : false;
}
else
return vrc;
}
/**
* Checks whether a specific file exists on the destination, based on the
* current copy context.
*
* @return IPRT status code.
* @param pContext Pointer to current copy control context.
* @param pszFile Actual file to check.
* @param fExists Pointer which receives the result if the
* given file exists or not.
*/
bool *fExists)
{
}
/**
* Checks whether a specific file exists on the source, based on the
* current copy context.
*
* @return IPRT status code.
* @param pContext Pointer to current copy control context.
* @param pszFile Actual file to check.
* @param fExists Pointer which receives the result if the
* given file exists or not.
*/
bool *fExists)
{
}
/**
* Copies a source file to the destination.
*
* @return IPRT status code.
* @param pContext Pointer to current copy control context.
* @param pszFileSource Source file to copy to the destination.
* @param pszFileDest Name of copied file on the destination.
* @param fFlags Copy flags. No supported at the moment and needs
* to be set to 0.
*/
{
RTPrintf("Copying \"%s\" to \"%s\" ...\n",
return VINF_SUCCESS;
int vrc = VINF_SUCCESS;
if (pContext->fHostToGuest)
{
pProgress.asOutParam());
}
else
{
pProgress.asOutParam());
}
{
}
else
{
else
}
return vrc;
}
/**
* Copys a directory (tree) from host to the guest.
*
* @return IPRT status code.
* @param pContext Pointer to current copy control context.
* @param pszSource Source directory on the host to copy to the guest.
* @param pszFilter DOS-style wildcard filter (?, *). Optional.
* @param pszDest Destination directory on the guest.
* @param fFlags Copy flags, such as recursive copying.
* @param pszSubDir Current sub directory to handle. Needs to NULL and only
* is needed for recursion.
*/
const char *pszSubDir /* For recursion. */)
{
/* Filter is optional. */
/* Sub directory is optional. */
/*
* Construct current path.
*/
char szCurDir[RTPATH_MAX];
/* Flag indicating whether the current directory was created on the
* target or not. */
bool fDirCreated = false;
/*
* Open directory without a filter - RTDirOpenFiltered unfortunately
* cannot handle sub directories so we have to do the filtering ourselves.
*/
if (RT_SUCCESS(vrc))
{
if (RT_FAILURE(vrc))
}
if (RT_SUCCESS(vrc))
{
/*
* Enumerate the directory tree.
*/
while (RT_SUCCESS(vrc))
{
if (RT_FAILURE(vrc))
{
if (vrc == VERR_NO_MORE_FILES)
vrc = VINF_SUCCESS;
break;
}
/** @todo r=bird: This ain't gonna work on most UNIX file systems because
* enmType is RTDIRENTRYTYPE_UNKNOWN. This is clearly documented in
* RTDIRENTRY::enmType. For trunk, RTDirQueryUnknownType can be used. */
{
case RTDIRENTRYTYPE_DIRECTORY:
{
/* Skip "." and ".." entries. */
break;
if (fFlags & CopyFileFlag_Recursive)
{
if (pszSubDir)
else
{
}
if (pszNewSub)
{
}
else
}
break;
}
case RTDIRENTRYTYPE_SYMLINK:
if ( (fFlags & CopyFileFlag_Recursive)
&& (fFlags & CopyFileFlag_FollowLinks))
{
/* Fall through to next case is intentional. */
}
else
break;
case RTDIRENTRYTYPE_FILE:
{
if ( pszFilter
{
break; /* Filter does not match. */
}
if (!fDirCreated)
{
char *pszDestDir;
pszDest, &pszDestDir);
if (RT_SUCCESS(vrc))
{
fDirCreated = true;
}
}
if (RT_SUCCESS(vrc))
{
if (pszFileSource)
{
char *pszFileDest;
pszDest, &pszFileDest);
if (RT_SUCCESS(vrc))
{
pszFileDest, 0 /* Flags */);
}
}
}
break;
}
default:
break;
}
if (RT_FAILURE(vrc))
break;
}
}
return vrc;
}
/**
* Copys a directory (tree) from guest to the host.
*
* @return IPRT status code.
* @param pContext Pointer to current copy control context.
* @param pszSource Source directory on the guest to copy to the host.
* @param pszFilter DOS-style wildcard filter (?, *). Optional.
* @param pszDest Destination directory on the host.
* @param fFlags Copy flags, such as recursive copying.
* @param pszSubDir Current sub directory to handle. Needs to NULL and only
* is needed for recursion.
*/
const char *pszSubDir /* For recursion. */)
{
/* Filter is optional. */
/* Sub directory is optional. */
/*
* Construct current path.
*/
char szCurDir[RTPATH_MAX];
if (RT_FAILURE(vrc))
return vrc;
/* Flag indicating whether the current directory was created on the
* target or not. */
bool fDirCreated = false;
pDirectory.asOutParam());
while (true)
{
break;
switch (enmType)
{
case FsObjType_Directory:
{
/* Skip "." and ".." entries. */
break;
{
}
if (fFlags & CopyFileFlag_Recursive)
{
if (pszSubDir)
else
{
}
if (pszNewSub)
{
}
else
}
break;
}
case FsObjType_Symlink:
if ( (fFlags & CopyFileFlag_Recursive)
&& (fFlags & CopyFileFlag_FollowLinks))
{
/* Fall through to next case is intentional. */
}
else
break;
case FsObjType_File:
{
if ( pszFilter
{
break; /* Filter does not match. */
}
if (!fDirCreated)
{
char *pszDestDir;
pszDest, &pszDestDir);
if (RT_SUCCESS(vrc))
{
fDirCreated = true;
}
}
if (RT_SUCCESS(vrc))
{
if (pszFileSource)
{
char *pszFileDest;
pszDest, &pszFileDest);
if (RT_SUCCESS(vrc))
{
pszFileDest, 0 /* Flags */);
}
}
else
}
break;
}
default:
RTPrintf("Warning: Directory entry of type %ld not handled, skipping ...\n",
enmType);
break;
}
if (RT_FAILURE(vrc))
break;
}
{
switch (rc)
{
case E_ABORT: /* No more directory entries left to process. */
break;
case VBOX_E_FILE_ERROR: /* Current entry cannot be accessed to
to missing rights. */
{
RTPrintf("Warning: Cannot access \"%s\", skipping ...\n",
szCurDir);
break;
}
default:
break;
}
}
{
if (RT_SUCCESS(vrc))
}
return vrc;
}
/**
* Copys a directory (tree) to the destination, based on the current copy
* context.
*
* @return IPRT status code.
* @param pContext Pointer to current copy control context.
* @param pszSource Source directory to copy to the destination.
* @param pszFilter DOS-style wildcard filter (?, *). Optional.
* @param pszDest Destination directory where to copy in the source
* source directory.
* @param fFlags Copy flags, such as recursive copying.
*/
{
if (pContext->fHostToGuest)
}
/**
* Creates a source root by stripping file names or filters of the specified source.
*
* @return IPRT status code.
* @param pszSource Source to create source root for.
* @param ppszSourceRoot Pointer that receives the allocated source root. Needs
* to be free'd with ctrlCopyFreeSourceRoot().
*/
{
if ( lenRoot
&& lenRoot > 1
{
if (lenRoot > 1)
}
else
{
/* If there's anything (like a file name or a filter),
* strip it! */
}
return VINF_SUCCESS;
}
/**
* Frees a previously allocated source root.
*
* @return IPRT status code.
* @param pszSourceRoot Source root to free.
*/
static void ctrlCopyFreeSourceRoot(char *pszSourceRoot)
{
}
{
/** @todo r=bird: This command isn't very unix friendly in general. mkdir
* is much better (partly because it is much simpler of course). The main
* arguments against this is that (1) all but two options conflicts with
* done windows CMD style (though not in a 100% compatible way), and (3)
* that only one source is allowed - efficiently sabotaging default
* wildcard expansion by a unix shell. The best solution here would be
* two different variant, one windowsy (xcopy) and one unixy (gnu cp). */
/*
* IGuest::CopyToGuest is kept as simple as possible to let the developer choose
* what and how to implement the file enumeration/recursive lookup, like VBoxManage
* does in here.
*/
static const RTGETOPTDEF s_aOptions[] =
{
};
int ch;
bool fCopyRecursive = false;
bool fDryRun = false;
int vrc = VINF_SUCCESS;
{
/* For options that require an argument, ValueUnion has received the value. */
switch (ch)
{
case GETOPTDEF_COPY_DRYRUN:
fDryRun = true;
break;
case GETOPTDEF_COPY_FOLLOW:
break;
case 'R': /* Recursive processing */
break;
case GETOPTDEF_COPY_TARGETDIR:
break;
case VINF_GETOPT_NOT_OPTION:
{
/* Last argument and no destination specified with
* --target-directory yet? Then use the current
* (= last) argument as destination. */
{
}
else
{
/* Save the source directory. */
}
break;
}
default:
break;
}
}
if (!vecSources.size())
return errorSyntax(USAGE_GUESTCONTROL,
"No source(s) specified!");
return errorSyntax(USAGE_GUESTCONTROL,
"No destination specified!");
/*
* Done parsing arguments, do some more preparations.
*/
{
if (fHostToGuest)
RTPrintf("Copying from host to guest ...\n");
else
RTPrintf("Copying from guest to host ...\n");
if (fDryRun)
RTPrintf("Dry run - no files copied!\n");
}
/* Create the copy context -- it contains all information
* the routines need to know when handling the actual copying. */
"VBoxManage Guest Control Copy", &pContext);
if (RT_FAILURE(vrc))
{
return RTEXITCODE_FAILURE;
}
/* If the destination is a path, (try to) create it. */
/** @todo r=bird: RTPathFilename and RTPathStripFilename won't work
* correctly on non-windows hosts when the guest is from the DOS world (Windows,
* OS/2, DOS). The host doesn't know about DOS slashes, only UNIX slashes and
* will get the wrong idea if some dilligent user does:
*
* copyto myfile.txt 'C:\guestfile.txt'
* or
* copyto myfile.txt 'D:guestfile.txt'
*
* @bugref{6344}
*/
if (!RTPathFilename(pszDest))
{
}
else
{
/* We assume we got a file name as destination -- so strip
* the actual file name and make sure the appropriate
* directories get created. */
}
if (RT_SUCCESS(vrc))
{
/*
* Here starts the actual fun!
* Handle all given sources one by one.
*/
for (unsigned long s = 0; s < vecSources.size(); s++)
{
char *pszSourceRoot;
if (RT_FAILURE(vrc))
{
break;
}
/** @todo Files with filter?? */
bool fSourceIsFile = false;
bool fSourceExists;
if ( cchSource > 1
{
if (pszFilter) /* Directory with filter (so use source root w/o the actual filter). */
else /* Regular directory without filter. */
if (fSourceExists)
{
/* Strip trailing slash from our source element so that other functions
* can use this stuff properly (like RTPathStartsWith). */
}
}
else
{
if ( RT_SUCCESS(vrc)
&& fSourceExists)
{
fSourceIsFile = true;
}
}
if ( RT_SUCCESS(vrc)
&& fSourceExists)
{
if (fSourceIsFile)
{
/* Single file. */
char *pszDestFile;
if (RT_SUCCESS(vrc))
{
pszDestFile, 0 /* Flags */);
}
else
RTMsgError("Unable to translate path for \"%s\", rc=%Rrc\n",
}
else
{
/* Directory (with filter?). */
}
}
if ( RT_SUCCESS(vrc)
&& !fSourceExists)
{
RTMsgError("Warning: Source \"%s\" does not exist, skipping!\n",
continue;
}
else if (RT_FAILURE(vrc))
{
RTMsgError("Error processing \"%s\", rc=%Rrc\n",
break;
}
}
}
}
{
}
{
}
{
/*
* Parse arguments.
*
* Note! No direct returns here, everyone must go thru the cleanup at the
* end of this function.
*/
static const RTGETOPTDEF s_aOptions[] =
{
};
int ch;
{
/* For options that require an argument, ValueUnion has received the value. */
switch (ch)
{
case 'm': /* Mode */
break;
case 'P': /* Create parents */
break;
case VINF_GETOPT_NOT_OPTION:
break;
default:
break;
}
}
if (!cDirs)
/*
* Create the directories.
*/
&& !g_fGuestCtrlCanceled)
{
it++;
}
}
{
/*
* Parse arguments.
*
* Note! No direct returns here, everyone must go thru the cleanup at the
* end of this function.
*/
static const RTGETOPTDEF s_aOptions[] =
{
};
int ch;
bool fRecursive = false;
{
/* For options that require an argument, ValueUnion has received the value. */
switch (ch)
{
fRecursive = true;
break;
case VINF_GETOPT_NOT_OPTION:
break;
default:
break;
}
}
if (!cDirs)
/*
* Remove the directories.
*/
&& !g_fGuestCtrlCanceled)
{
RTPrintf("%s directory \"%s\" ...\n",
try
{
if (fRecursive)
{
/** @todo Make flags configurable. */
pProgress.asOutParam()));
else
}
else
}
{
rc = E_OUTOFMEMORY;
break;
}
it++;
}
}
{
/*
* Parse arguments.
*
* Note! No direct returns here, everyone must go thru the cleanup at the
* end of this function.
*/
static const RTGETOPTDEF s_aOptions[] = { 0 };
int ch;
{
/* For options that require an argument, ValueUnion has received the value. */
switch (ch)
{
case VINF_GETOPT_NOT_OPTION:
break;
default:
break;
}
}
if (!cFiles)
/*
* Create the directories.
*/
&& !g_fGuestCtrlCanceled)
{
it++;
}
}
{
/*
* Parse arguments.
*
* Note! No direct returns here, everyone must go thru the cleanup at the
* end of this function.
*/
static const RTGETOPTDEF s_aOptions[] =
{
};
int ch;
bool fDirectory = false;
bool fSecure = false;
{
/* For options that require an argument, ValueUnion has received the value. */
switch (ch)
{
case 'm': /* Mode */
break;
case 'D': /* Create directory */
fDirectory = true;
break;
case 's': /* Secure */
fSecure = true;
break;
case 't': /* Temp directory */
break;
case VINF_GETOPT_NOT_OPTION:
{
if (strTemplate.isEmpty())
else
return errorSyntax(USAGE_GUESTCONTROL,
"More than one template specified!\n");
break;
}
default:
break;
}
}
if (strTemplate.isEmpty())
if (!fDirectory)
/*
* Create the directories.
*/
{
RTPrintf("Creating temporary directory from template '%s' in directory '%s' ...\n",
else if (fDirectory)
RTPrintf("Creating temporary directory from template '%s' in default temporary directory ...\n",
strTemplate.c_str());
RTPrintf("Creating temporary file from template '%s' in directory '%s' ...\n",
else if (!fDirectory)
RTPrintf("Creating temporary file from template '%s' in default temporary directory ...\n",
strTemplate.c_str());
}
if (fDirectory)
{
directory.asOutParam()));
}
// else - temporary file not yet implemented
}
{
static const RTGETOPTDEF s_aOptions[] =
{
};
int ch;
{
/* For options that require an argument, ValueUnion has received the value. */
switch (ch)
{
case 'L': /* Dereference */
case 'f': /* File-system */
case 'c': /* Format */
case 't': /* Terse */
break; /* Never reached. */
case VINF_GETOPT_NOT_OPTION:
break;
default:
break;
}
}
if (!cObjs)
/*
* Doing the checks.
*/
{
{
/* If there's at least one element which does not exist on the guest,
* drop out with exitcode 1. */
RTPrintf("Cannot stat for element \"%s\": No such element\n",
}
else
{
switch (objType)
{
case FsObjType_File:
break;
case FsObjType_Directory:
break;
case FsObjType_Symlink:
break;
default:
break;
}
/** @todo: Show more information about this element. */
}
it++;
}
return rcExit;
}
{
/*
* Check the syntax. We can deduce the correct syntax from the number of
* arguments.
*/
bool fWaitStartOnly = false;
static const RTGETOPTDEF s_aOptions[] =
{
};
int ch;
RTGetOptInit(&GetState, pCtx->iArgc, pCtx->ppaArgv, s_aOptions, RT_ELEMENTS(s_aOptions), pCtx->iFirstArgc, 0);
int vrc = VINF_SUCCESS;
&& RT_SUCCESS(vrc))
{
switch (ch)
{
case 's':
break;
case 'w':
fWaitStartOnly = true;
break;
case VINF_GETOPT_NOT_OPTION:
else
break;
default:
break;
}
}
RTPrintf("Updating Guest Additions ...\n");
{
CHECK_ERROR_BREAK(pCtx->handlerArg.virtualBox, COMGETTER(SystemProperties)(pProperties.asOutParam()));
break;
}
/* Determine source if not set yet. */
{
RTMsgError("No Guest Additions source found or specified, aborting\n");
}
{
}
if (RT_SUCCESS(vrc))
{
if (fWaitStartOnly)
{
RTPrintf("Preparing and waiting for Guest Additions installer to start ...\n");
}
/* Wait for whole update process to complete. */
pProgress.asOutParam()));
else
{
else
if ( RT_SUCCESS(vrc)
{
RTPrintf("Guest Additions update successful\n");
}
}
}
}
{
/** Use RTGetOpt here when handling command line args gets more complex. */
bool fListAll = false;
bool fListSessions = false;
bool fListProcesses = false;
bool fListFiles = false;
fListSessions = true;
fListAll = true;
/** @todo Handle "--verbose" using RTGetOpt. */
/** @todo Do we need a machine-readable output here as well? */
if ( fListAll
|| fListSessions)
{
do
{
size_t cTotalProcs = 0;
size_t cTotalFiles = 0;
if (cSessions)
{
RTPrintf("Active guest sessions:\n");
/** @todo Make this output a bit prettier. No time now. */
{
if (!pCurSession.isNull())
{
RTPrintf("\n\tSession #%-3zu ID=%-3RU32 User=%-16ls Status=[%s] Name=%ls",
if ( fListAll
|| fListProcesses)
{
{
if (!pCurProcess.isNull())
{
RTPrintf("\n\t\tProcess #%-03zu PID=%-6RU32 Status=[%s] Command=%ls",
}
}
}
if ( fListAll
|| fListFiles)
{
{
{
RTPrintf("\n\t\tFile #%-03zu ID=%-6RU32 Status=[%s] Name=%ls",
}
}
}
}
}
if (fListAll || fListProcesses)
if (fListAll || fListFiles)
}
else
RTPrintf("No active guest sessions found\n");
} while (0);
}
else
return rcExit;
}
{
/*
* Parse arguments.
*
* Note! No direct returns here, everyone must go thru the cleanup at the
* end of this function.
*/
static const RTGETOPTDEF s_aOptions[] =
{
};
int ch;
int vrc = VINF_SUCCESS;
&& RT_SUCCESS(vrc))
{
/* For options that require an argument, ValueUnion has received the value. */
switch (ch)
{
case 'n': /* Session name (or pattern) */
break;
case 'i': /* Session ID */
break;
case VINF_GETOPT_NOT_OPTION:
{
/* Treat every else specified as a PID to kill. */
try
{
if (uPID) /** @todo Is this what we want? If specifying PID 0
this is not going to work on most systems anyway. */
else
}
{
}
}
break;
default:
break;
}
}
else if ( strSessionName.isEmpty()
&& ulSessionID == UINT32_MAX)
{
}
else if ( !strSessionName.isEmpty()
&& ulSessionID != UINT32_MAX)
{
}
if (RT_FAILURE(vrc))
do
{
uint32_t uProcsTerminated = 0;
bool fSessionFound = false;
uint32_t uSessionsHandled = 0;
{
pSession = collSessions[i];
{
}
else /* ... or by naming pattern. */
{
fSessionFound = true;
}
if (fSessionFound)
{
{
bool fProcFound = false;
{
if (fProcFound)
break;
}
if (fProcFound)
{
RTPrintf("Terminating process (PID %RU32) (session ID %RU32) ...\n",
}
else
{
if (ulSessionID != UINT32_MAX)
RTPrintf("No matching process(es) for session ID %RU32 found\n",
}
}
}
}
if (!uSessionsHandled)
RTPrintf("No matching session(s) found\n");
if (uProcsTerminated)
RTPrintf("%RU32 %s terminated\n",
} while (0);
}
{
/** Use RTGetOpt here when handling command line args gets more complex. */
{
return handleCtrlProcessClose(pCtx);
}
}
{
/*
* Parse arguments.
*
* Note! No direct returns here, everyone must go thru the cleanup at the
* end of this function.
*/
static const RTGETOPTDEF s_aOptions[] =
{
};
int ch;
{
/* For options that require an argument, ValueUnion has received the value. */
switch (ch)
{
case 'n': /* Session name pattern */
break;
case 'i': /* Session ID */
break;
strSessionName = "*";
break;
case VINF_GETOPT_NOT_OPTION:
/** @todo Supply a CSV list of IDs or patterns to close? */
break;
default:
break;
}
}
if ( strSessionName.isEmpty()
&& ulSessionID == UINT32_MAX)
{
}
else if ( !strSessionName.isEmpty()
&& ulSessionID != UINT32_MAX)
{
}
do
{
bool fSessionFound = false;
size_t cSessionsHandled = 0;
{
pSession = collSessions[i];
{
}
else /* ... or by naming pattern. */
{
fSessionFound = true;
}
if (fSessionFound)
{
RTPrintf("Closing guest session ID=#%RU32 \"%s\" ...\n",
RTPrintf("Guest session successfully closed\n");
}
}
if (!cSessionsHandled)
{
RTPrintf("No guest session(s) found\n");
}
} while (0);
}
{
/** Use RTGetOpt here when handling command line args gets more complex. */
{
return handleCtrlSessionClose(pCtx);
}
}
{
/*
* Parse arguments.
*/
static const RTGETOPTDEF s_aOptions[] = { 0 };
int ch;
{
/* For options that require an argument, ValueUnion has received the value. */
switch (ch)
{
case VINF_GETOPT_NOT_OPTION:
break;
default:
break;
}
}
/** @todo Specify categories to watch for. */
/** @todo Specify a --timeout for waiting only for a certain amount of time? */
try
{
do
{
/* Listener creation. */
/* Register for IGuest events. */
/** @todo Also register for VBoxEventType_OnGuestUserStateChanged on demand? */
true /* Active listener */));
/* Note: All other guest control events have to be registered
* as their corresponding objects appear. */
} while (0);
RTPrintf("Waiting for events ...\n");
while (!g_fGuestCtrlCanceled)
{
/** @todo Timeout handling (see above)? */
RTThreadSleep(10);
}
RTPrintf("Signal caught, exiting ...\n");
if (!pGuestListener.isNull())
{
/* Guest callback unregistration. */
}
}
{
rc = E_OUTOFMEMORY;
}
}
/**
* Access the guest control store.
*
* @returns program exit code.
* @note see the command line API description for parameters
*/
{
#ifdef DEBUG_andy_disabled
if (RT_FAILURE(tstTranslatePath()))
return RTEXITCODE_FAILURE;
#endif
/* pArg->argv[0] contains the VM name. */
/* pArg->argv[1] contains the guest control command. */
uint32_t uCmdCtxFlags = 0;
{
/** @todo What about "taskkill" on Windows? */
}
/** @todo Implement "killall"? */
{
}
{
}
{
}
{
}
{
}
else
if (rcExit == RTEXITCODE_SUCCESS)
{
/* Kick off the actual command handler. */
return rcExit;
}
return rcExit;
}
#endif /* !VBOX_ONLY_DOCS */