VirtualBox

Ignore:
Timestamp:
Feb 5, 2010 1:50:13 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
57355
Message:

VBoxManage: add internalcommands testsession <vmname> for debugging

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp

    r24998 r26286  
    17571757}
    17581758
     1759int CmdTestSession(HandlerArg *a)
     1760{
     1761    HRESULT rc;
     1762
     1763    if (a->argc != 2)
     1764    {
     1765        RTPrintf("Must specify VM name!\n");
     1766        return E_FAIL;
     1767    }
     1768
     1769    do
     1770    {
     1771        ComPtr<IMachine> pMachine;
     1772        CHECK_ERROR_BREAK(a->virtualBox, FindMachine(Bstr(a->argv[1]), pMachine.asOutParam()));
     1773
     1774        Bstr bstrMachineID;
     1775        CHECK_ERROR_BREAK(pMachine, COMGETTER(Id)(bstrMachineID.asOutParam()));
     1776
     1777        CHECK_ERROR_BREAK(a->virtualBox, OpenSession(a->session, bstrMachineID));
     1778
     1779        RTPrintf("Session is open, press any key to terminate!\n");
     1780
     1781        RTStrmGetCh(g_pStdIn);
     1782
     1783        RTPrintf("Closing session...\n");
     1784
     1785        CHECK_ERROR_BREAK(a->session, Close());
     1786
     1787    } while (0);
     1788
     1789    return rc;
     1790}
     1791
    17591792/**
    17601793 * Wrapper for handling internal commands
     
    17961829        return CmdModUninstall();
    17971830
     1831    if (!strcmp(pszCmd, "testsession"))
     1832        return CmdTestSession(a);
     1833
    17981834    /* default: */
    17991835    return errorSyntax(USAGE_ALL, "Invalid command '%s'", Utf8Str(a->argv[0]).raw());
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette