VirtualBox

Changeset 102749 in vbox


Ignore:
Timestamp:
Jan 3, 2024 3:17:55 PM (13 months ago)
Author:
vboxsync
Message:

Guest Control/VBoxManage: Implemented a "mount" sub command for the new GetMountPoints API. bugref:10415

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/manual/en_US/man_VBoxManage-guestcontrol.xml

    r99778 r102749  
    258258    </cmdsynopsis>
    259259
     260    <cmdsynopsis id="synopsis-vboxmanage-guestcontrol-mount">
     261      <command>VBoxManage guestcontrol</command>
     262      <group choice="req">
     263        <arg choice="plain"><replaceable>uuid</replaceable></arg>
     264        <arg choice="plain"><replaceable>vmname</replaceable></arg>
     265      </group>
     266      <arg choice="plain">mount</arg>
     267      <group>
     268        <arg choice="plain">--passwordfile=<replaceable>password-file</replaceable></arg>
     269        <arg choice="plain">--password=<replaceable>password</replaceable></arg>
     270      </group>
     271      <arg>--username=<replaceable>username</replaceable></arg>
     272      <arg>--verbose</arg>
     273    </cmdsynopsis>
     274
    260275    <cmdsynopsis id="synopsis-vboxmanage-guestcontrol-fsinfo">
    261276      <command>VBoxManage guestcontrol</command>
     
    416431        <command>fsinfo</command>,
    417432        <command>mkdir</command>, <command>mktemp</command>,
     433        <command>mount</command>,
    418434        <command>mv</command>, <command>rmdir</command>,
    419435        <command>rm</command>, <command>run</command>,
     
    10661082        </varlistentry>
    10671083      </variablelist>
     1084    </refsect2>
     1085    <refsect2 id="vboxmanage-guestcontrol-mount">
     1086      <title>Shows mount points on the guest</title>
     1087      <remark role="help-copy-synopsis"/>
     1088      <para>
     1089        The <command>VBoxManage guestcontrol
     1090        <replaceable>vmname</replaceable> mount</command> command
     1091        enables you to the current mount points on
     1092        the guest VM. For Windows guests this shows the mapped drives.
     1093      </para>
    10681094    </refsect2>
    10691095    <refsect2 id="vboxmanage-guestcontrol-stat">
  • trunk/doc/manual/user_ChangeLogImpl.xml

    r102675 r102749  
    113113      </listitem>
    114114
     115      <listitem>
     116       <para>VBoxManage: Added the ability to query the guest's mount points via a new "mount"
     117         Guest Control sub command. Requires at least 7.1 Guest Additions</para>
     118      </listitem>
     119
    115120    </itemizedlist>
    116121  </sect1>
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp

    r102679 r102749  
    24172417}
    24182418
     2419static DECLCALLBACK(RTEXITCODE) gctlHandleMount(PGCTLCMDCTX pCtx, int argc, char **argv)
     2420{
     2421    AssertPtrReturn(pCtx, RTEXITCODE_FAILURE);
     2422
     2423    static const RTGETOPTDEF s_aOptions[] =
     2424    {
     2425        GCTLCMD_COMMON_OPTION_DEFS()
     2426    };
     2427
     2428    int ch;
     2429    RTGETOPTUNION ValueUnion;
     2430    RTGETOPTSTATE GetState;
     2431    RTGetOptInit(&GetState, argc, argv, s_aOptions, RT_ELEMENTS(s_aOptions), 1, RTGETOPTINIT_FLAGS_OPTS_FIRST);
     2432
     2433    while ((ch = RTGetOpt(&GetState, &ValueUnion)) != 0)
     2434    {
     2435        /* For options that require an argument, ValueUnion has received the value. */
     2436        switch (ch)
     2437        {
     2438            GCTLCMD_COMMON_OPTION_CASES(pCtx, ch, &ValueUnion);
     2439
     2440            default:
     2441                return errorGetOpt(ch, &ValueUnion);
     2442        }
     2443    }
     2444
     2445    RTEXITCODE rcExit = gctlCtxPostOptionParsingInit(pCtx);
     2446    if (rcExit != RTEXITCODE_SUCCESS)
     2447        return rcExit;
     2448
     2449    HRESULT hrc = S_OK;
     2450
     2451    com::SafeArray<BSTR> mountPoints;
     2452    CHECK_ERROR(pCtx->pGuestSession, COMGETTER(MountPoints)(ComSafeArrayAsOutParam(mountPoints)));
     2453
     2454    for (size_t i = 0; i < mountPoints.size(); ++i)
     2455        RTPrintf("%ls\n", mountPoints[i]);
     2456
     2457    if (pCtx->cVerbose)
     2458        RTPrintf("Found %zu mount points\n", mountPoints.size());
     2459
     2460    return FAILED(hrc) ? RTEXITCODE_FAILURE : RTEXITCODE_SUCCESS;
     2461}
     2462
    24192463static DECLCALLBACK(RTEXITCODE) gctlHandleFsInfo(PGCTLCMDCTX pCtx, int argc, char **argv)
    24202464{
     
    38023846        { "createtemporary",    gctlHandleMkTemp,           HELP_SCOPE_GUESTCONTROL_MKTEMP,    0 },
    38033847
     3848        { "mount",              gctlHandleMount,            HELP_SCOPE_GUESTCONTROL_MOUNT,     0 },
     3849
    38043850        { "df",                 gctlHandleFsInfo,           HELP_SCOPE_GUESTCONTROL_FSINFO,    0 },
    38053851        { "fsinfo",             gctlHandleFsInfo,           HELP_SCOPE_GUESTCONTROL_FSINFO,    0 },
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