Changeset 99264 in vbox
- Timestamp:
- Apr 3, 2023 3:37:08 PM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 156647
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/manual/en_US/man_VBoxManage-guestcontrol.xml
r99154 r99264 256 256 </cmdsynopsis> 257 257 258 <cmdsynopsis id="synopsis-vboxmanage-guestcontrol-fsinfo"> 259 <command>VBoxManage guestcontrol</command> 260 <group choice="req"> 261 <arg choice="plain"><replaceable>uuid</replaceable></arg> 262 <arg choice="plain"><replaceable>vmname</replaceable></arg> 263 </group> 264 <arg choice="plain">fsinfo</arg> 265 <arg>--domain=<replaceable>domainname</replaceable></arg> 266 <group> 267 <arg choice="plain">--passwordfile=<replaceable>password-file</replaceable></arg> 268 <arg choice="plain">--password=<replaceable>password</replaceable></arg> 269 </group> 270 <arg>--human-readable</arg> 271 <arg>--quiet</arg> 272 <arg>--username=<replaceable>username</replaceable></arg> 273 <arg>--verbose</arg> 274 <arg choice="req"><replaceable>path</replaceable></arg> 275 </cmdsynopsis> 276 258 277 <cmdsynopsis id="synopsis-vboxmanage-guestcontrol-stat"> 259 278 <command>VBoxManage guestcontrol</command> … … 392 411 authentication. The subcommands are: 393 412 <command>copyfrom</command>, <command>copyto</command>, 413 <command>fsinfo</command>, 394 414 <command>mkdir</command>, <command>mktemp</command>, 395 415 <command>mv</command>, <command>rmdir</command>, … … 773 793 use wildcards to specify multiple files. For example, 774 794 <filename>C:\Windows\System*\*.dll</filename>. 795 </para></listitem> 796 </varlistentry> 797 </variablelist> 798 </refsect2> 799 <refsect2 id="vboxmanage-guestcontrol-fsinfo"> 800 <title>Show guest filesystem information.</title> 801 <remark role="help-copy-synopsis"/> 802 <para> 803 The <command>VBoxManage guestcontrol 804 <replaceable>vmname</replaceable> fsinfo</command> command 805 enables you to show filesystem information of the guest VM. 806 </para> 807 <para> 808 An alternate form of this subcommand is <command>df</command>. 809 </para> 810 <variablelist> 811 <varlistentry> 812 <term><option>--human-readable</option></term> 813 <listitem><para> 814 Shows the disk sizes in a human readable form. 815 </para> 816 </listitem> 817 </varlistentry> 818 <varlistentry> 819 <term><literal><replaceable>guest-path</replaceable> [<replaceable>guest-path</replaceable>...]</literal></term> 820 <listitem><para> 821 Specifies an absolute path to show guest filesystem 822 information for. 775 823 </para></listitem> 776 824 </varlistentry> -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp
r99150 r99264 2385 2385 } 2386 2386 2387 static DECLCALLBACK(RTEXITCODE) gctlHandleFsInfo(PGCTLCMDCTX pCtx, int argc, char **argv) 2388 { 2389 AssertPtrReturn(pCtx, RTEXITCODE_FAILURE); 2390 2391 static const RTGETOPTDEF s_aOptions[] = 2392 { 2393 GCTLCMD_COMMON_OPTION_DEFS() 2394 { "--human-readable", 'h', RTGETOPT_REQ_NOTHING } 2395 }; 2396 2397 int ch; 2398 RTGETOPTUNION ValueUnion; 2399 RTGETOPTSTATE GetState; 2400 RTGetOptInit(&GetState, argc, argv, s_aOptions, RT_ELEMENTS(s_aOptions), 1, RTGETOPTINIT_FLAGS_OPTS_FIRST); 2401 2402 bool fHumanReadable = false; 2403 2404 while ( (ch = RTGetOpt(&GetState, &ValueUnion)) != 0 2405 && ch != VINF_GETOPT_NOT_OPTION) 2406 { 2407 /* For options that require an argument, ValueUnion has received the value. */ 2408 switch (ch) 2409 { 2410 GCTLCMD_COMMON_OPTION_CASES(pCtx, ch, &ValueUnion); 2411 2412 case 'h': 2413 fHumanReadable = true; 2414 break; 2415 2416 default: 2417 return errorGetOpt(ch, &ValueUnion); 2418 } 2419 } 2420 2421 if (ch != VINF_GETOPT_NOT_OPTION) 2422 return errorSyntax(GuestCtrl::tr("No path specified to query information for!")); 2423 2424 RTEXITCODE rcExit = gctlCtxPostOptionParsingInit(pCtx); 2425 if (rcExit != RTEXITCODE_SUCCESS) 2426 return rcExit; 2427 2428 /* Stay within 80 characters width by default. */ 2429 unsigned const cwFileSys = 12; 2430 unsigned const cwSize = 16; 2431 unsigned const cwSizeTotal = cwSize; 2432 unsigned const cwSizeUsed = cwSize; 2433 unsigned const cwSizeAvail = cwSize; 2434 unsigned const cwPathSpacing = 6; /* Spacing between last value and actual path. */ 2435 2436 RTPrintf("%-*s%*s%*s%*s%*s%s\n", 2437 cwFileSys, GuestCtrl::tr("Filesystem"), 2438 cwSizeTotal, GuestCtrl::tr("Total"), cwSizeUsed, GuestCtrl::tr("Used"), cwSizeAvail, GuestCtrl::tr("Available"), 2439 cwPathSpacing, "", 2440 GuestCtrl::tr("Path")); 2441 2442 while (ch == VINF_GETOPT_NOT_OPTION) 2443 { 2444 ComPtr<IGuestFsInfo> pFsInfo; 2445 HRESULT hrc; 2446 CHECK_ERROR(pCtx->pGuestSession, FsQueryInfo(Bstr(ValueUnion.psz).raw(), pFsInfo.asOutParam())); 2447 if (FAILED(hrc)) 2448 { 2449 rcExit = RTEXITCODE_FAILURE; 2450 } 2451 else 2452 { 2453 Bstr bstr; 2454 CHECK_ERROR2I(pFsInfo, COMGETTER(Type)(bstr.asOutParam())); 2455 /** @todo Add label and mount point once we return this. */ 2456 LONG64 u64, u64_2; 2457 CHECK_ERROR2I(pFsInfo, COMGETTER(TotalSize)(&u64)); 2458 CHECK_ERROR2I(pFsInfo, COMGETTER(FreeSize)(&u64_2)); 2459 if (fHumanReadable) 2460 { 2461 RTPrintf("%-*ls%*Rhcb%*Rhcb%*Rhcb%*s%s", 2462 cwFileSys, bstr.raw(), /* Filesystem */ 2463 cwSizeTotal, u64, /* Total */ 2464 cwSizeUsed, u64 - u64_2, /* Used */ 2465 cwSizeAvail, u64_2, /* Available */ 2466 cwPathSpacing, "", 2467 ValueUnion.psz); /* Path */ 2468 } 2469 else 2470 { 2471 RTPrintf("%-*ls%*RU64%*RU64%*RU64%*s%s", 2472 cwFileSys, bstr.raw(), /* Filesystem */ 2473 cwSizeTotal, u64, /* Total */ 2474 cwSizeUsed, u64 - u64_2, /* Used */ 2475 cwSizeAvail, u64_2, /* Available */ 2476 cwPathSpacing, "", 2477 ValueUnion.psz); /* Path */ 2478 } 2479 RTPrintf("\n"); 2480 } 2481 2482 /* Next path. */ 2483 ch = RTGetOpt(&GetState, &ValueUnion); 2484 } 2485 2486 return rcExit; 2487 } 2488 2387 2489 static DECLCALLBACK(RTEXITCODE) gctlHandleStat(PGCTLCMDCTX pCtx, int argc, char **argv) 2388 2490 { … … 3610 3712 { "createtemporary", gctlHandleMkTemp, HELP_SCOPE_GUESTCONTROL_MKTEMP, 0 }, 3611 3713 3714 { "df", gctlHandleFsInfo, HELP_SCOPE_GUESTCONTROL_FSINFO, 0 }, 3715 { "fsinfo", gctlHandleFsInfo, HELP_SCOPE_GUESTCONTROL_FSINFO, 0 }, 3716 3612 3717 { "stat", gctlHandleStat, HELP_SCOPE_GUESTCONTROL_STAT, 0 }, 3613 3718
Note:
See TracChangeset
for help on using the changeset viewer.