Changeset 76043 in vbox for trunk/src/VBox/ImageMounter/vboximg-mount
- Timestamp:
- Dec 7, 2018 9:28:53 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ImageMounter/vboximg-mount/vboximg-mount.cpp
r75977 r76043 175 175 int32_t size; /** Size of accessible disk region, starting at offset, default = offset 0 */ 176 176 uint32_t cHddImageDiffMax; /** Max number of differencing images (snapshots) to apply to image */ 177 uint32_t fListMedia ;/** Flag to list virtual disks of all known VMs */178 uint32_t fList MediaBrief;/** Flag to list virtual disks of all known VMs */177 uint32_t fListMediaLong; /** Flag to list virtual disks of all known VMs */ 178 uint32_t fList; /** Flag to list virtual disks of all known VMs */ 179 179 uint32_t fListParts; /** Flag to summarily list partitions associated with pszImage */ 180 180 uint32_t fAllowRoot; /** Flag to allow root to access this FUSE FS */ … … 187 187 188 188 static struct fuse_opt vboximgOptDefs[] = { 189 OPTION("-l", fListMediaBrief, 1), 190 OPTION("-L", fListMedia, 1), 191 OPTION("-t", fListParts, 1), 189 OPTION("-l", fList, 1), 190 OPTION("--list", fList, 1), 192 191 OPTION("--root", fAllowRoot, 1), 193 192 OPTION("--vm=%s", pszVm, 0), … … 215 214 RTPrintf("usage: vboximg-mount [options] <mountpoint>\n\n" 216 215 "vboximg-mount options:\n\n" 217 " [ -l ] List virtual disk media (brief version)\n" 218 " [ -L ] List virtual disk media (long version)\n" 219 " [ -t ] List partition table (requires -i or --image option)\n" 216 " [ { -l | --list } ] If a disk image is specified [-i, --image], list partition table\n" 217 " for the specified disk image.\n" 218 "\n" 219 " If no image is specified on the command line, list registered VMs\n" 220 " and their disk media. If a verbose flag is specified,\n" 221 " VM and media list will be long format, including snapshot images\n" 222 " and component locations (e.g. paths).\n" 220 223 "\n" 221 224 " [ { -i | --image= } <UUID | name | path> ] Virtual Box disk image to use\n" … … 226 229 " (Can't use with -p or --partition options)\n" 227 230 "\n" 228 " [ -s | --size=<bytes> ]Sets size of mounted disk from disk start or from\n"231 " [ -s | --size=<bytes> ] Sets size of mounted disk from disk start or from\n" 229 232 " offset, if specified. (Can't use with\n" 230 233 " -p or --partition options)\n" … … 235 238 " (0 = Apply no diffs, default = Apply all diffs)\n" 236 239 "\n" 237 " [ --rw ]Make image writeable (default = readonly)\n"238 " [ --root ]Same as -o allow_root\n"240 " [ --rw ] Make image writeable (default = readonly)\n" 241 " [ --root ] Same as -o allow_root\n" 239 242 "\n" 240 243 " [ --vm < Path | UUID >] VM UUID (limit media list to specific VM)\n" … … 243 246 " -o opt[,opt...] FUSE mount options\n" 244 247 " -h Display short usage info showing only the above\n" 248 " -? Display short usage info showing only the above\n" 245 249 " --help Display long usage info (including FUSE opts)\n\n" 246 250 ); … … 696 700 697 701 { 698 699 702 (void) offset; 700 703 (void) pInfo; … … 794 797 if (ancestorNumber == 0) 795 798 { 796 if ( !g_vboximgOpts.fListMediaBrief)799 if (g_vboximgOpts.fVerbose) 797 800 { 798 801 RTPrintf(" -----------------------\n"); … … 812 815 else 813 816 { 814 if ( !g_vboximgOpts.fListMediaBrief)817 if (g_vboximgOpts.fVerbose) 815 818 { 816 819 RTPrintf(" Diff %d:\n", ancestorNumber); … … 861 864 || RTStrNCmp((const char *)pMachineName.raw(), g_vboximgOpts.pszVm, MAX_UUID_LEN) == 0) 862 865 { 863 if ( !g_vboximgOpts.fListMediaBrief)866 if (g_vboximgOpts.fVerbose) 864 867 { 865 868 RTPrintf("------------------------------------------------------\n"); … … 1262 1265 if (rc == -1) 1263 1266 return RTMsgErrorExitFailure("Couldn't parse fuse options, rc=%Rrc\n", rc); 1264 if (g_vboximgOpts.fBriefUsage) 1267 1268 if (argc < 2 || RTStrCmp(argv[1], "-?" ) == 0 || g_vboximgOpts.fBriefUsage) 1265 1269 { 1266 1270 briefUsage(); … … 1302 1306 RTPrintf("vboximg: VirtualBox XPCOM object created\n"); 1303 1307 1304 if (g_vboximgOpts.fList Media || g_vboximgOpts.fListMediaBrief)1308 if (g_vboximgOpts.fList && g_vboximgOpts.pszImage == NULL) 1305 1309 { 1306 1310 listVMs(pVirtualBox); … … 1308 1312 } 1309 1313 1310 1311 if (g_vboximgOpts.pszImage == NULL)1312 {1313 RTMsgErrorExitFailure("To list partitions, must also specify --i or --image option\n");1314 return 0;1315 }1316 1314 ComPtr<IMedium> pBaseImageMedium = NULL; 1317 1315 char *pszFormat; … … 1486 1484 g_cbEntireVDisk = VDGetSize(g_pVDisk, 0 /* base */); 1487 1485 1488 if (g_vboximgOpts.fList Parts)1486 if (g_vboximgOpts.fList) 1489 1487 { 1490 1488 if (g_pVDisk == NULL)
Note:
See TracChangeset
for help on using the changeset viewer.