Changeset 75970 in vbox for trunk/src/VBox/ImageMounter/vboximg-mount
- Timestamp:
- Dec 5, 2018 12:30:09 PM (6 years ago)
- Location:
- trunk/src/VBox/ImageMounter/vboximg-mount
- Files:
-
- 2 added
- 1 deleted
- 1 edited
- 1 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ImageMounter/vboximg-mount/Makefile.kmk
r75815 r75970 1 1 # $Id$ 2 2 ## @file 3 # Sub-Makefile for the vbox rawProgram.3 # Sub-Makefile for the vboximg-mount Program. 4 4 5 5 # … … 20 20 21 21 # 22 # vbox raw- Disk Image Flatting FUSE Program.22 # vboximg-mount - Disk Image Flatting FUSE Program. 23 23 # 24 PROGRAMS += vbox raw24 PROGRAMS += vboximg-mount 25 25 26 vbox raw_TEMPLATE = VBOXMAINCLIENTEXE27 vbox raw_DEFS.darwin = __FreeBSD_==1028 vbox raw_DEFS = _FILE_OFFSET_BITS=6426 vboximg-mount_TEMPLATE = VBOXMAINCLIENTEXE 27 vboximg-mount_DEFS.darwin = __FreeBSD_==10 28 vboximg-mount_DEFS = _FILE_OFFSET_BITS=64 29 29 30 vbox raw_SOURCES = \31 vbox raw.cpp \32 vbox raw.h \30 vboximg-mount_SOURCES = \ 31 vboximg-mount.cpp \ 32 vboximg-mount.h \ 33 33 SelfSizingTable.h 34 34 35 vbox raw_LIBS = \35 vboximg-mount_LIBS = \ 36 36 $(LIB_DDU) \ 37 37 $(LIB_RUNTIME) 38 38 39 vbox raw_INCS.darwin = \39 vboximg-mount_INCS.darwin = \ 40 40 /usr/local/include \ 41 41 /usr/local/include/osxfuse \ 42 vbox raw_CXXFLAGS.darwin = -std=c++1142 vboximg-mount_CXXFLAGS.darwin = -std=c++11 43 43 44 vbox raw_LIBS.darwin = /usr/local/lib/libosxfuse.dylib45 vbox raw_LIBS.linux = fuse46 vbox raw_LIBS.freebsd = fuse44 vboximg-mount_LIBS.darwin = /usr/local/lib/libosxfuse.dylib 45 vboximg-mount_LIBS.linux = fuse 46 vboximg-mount_LIBS.freebsd = fuse 47 47 48 48 include $(FILE_KBUILD_SUB_FOOTER) -
trunk/src/VBox/ImageMounter/vboximg-mount/vboximg-mount.cpp
r75968 r75970 1 1 /* $Id$ */ 2 2 /** @file 3 * vbox raw- Disk Image Flattening FUSE Program.3 * vboximg-mount - Disk Image Flattening FUSE Program. 4 4 */ 5 5 … … 75 75 #include <iprt/utf16.h> 76 76 77 #include "vbox raw.h"77 #include "vboximg-mount.h" 78 78 #include "SelfSizingTable.h" 79 79 … … 91 91 } g_u; 92 92 93 #if 0 /* unused */ 93 94 const uint64_t KB = 1024; 94 95 const uint64_t MB = KB * KB; … … 96 97 const uint64_t TB = GB * KB; 97 98 const uint64_t PB = TB * KB; 99 #endif 98 100 99 101 enum { PARTITION_TABLE_MBR = 1, PARTITION_TABLE_GPT = 2 }; … … 102 104 #define MBR_PARTITIONS_MAX 4 /** Fixed number of partitions in Master Boot Record */ 103 105 #define BASENAME_MAX 256 /** Maximum name for the basename of a path (for RTStrNLen()*/ 104 #define VBOX RAW_PARTITION_MAX 256 /** How much storage to allocate to store partition info */106 #define VBOXIMG_PARTITION_MAX 256 /** How much storage to allocate to store partition info */ 105 107 #define PARTITION_NAME_MAX 72 /** Maximum partition name size (accomodates GPT partition name) */ 106 108 #define BLOCKSIZE 512 /** Commonly used disk block size */ … … 124 126 #define CSTR(arg) Utf8Str(arg).c_str() /* Converts XPCOM string type to C string type */ 125 127 126 static struct fuse_operations g_vbox rawOps; /** FUSE structure that defines allowed ops for this FS */128 static struct fuse_operations g_vboximgOps; /** FUSE structure that defines allowed ops for this FS */ 127 129 128 130 /* Global variables */ … … 164 166 } PARTITIONINFO; 165 167 166 PARTITIONINFO g_aParsedPartitionInfo[VBOX RAW_PARTITION_MAX + 1]; /* Note: Element 0 reserved for EntireDisk partitionEntry */167 168 static struct vbox rawOpts {168 PARTITIONINFO g_aParsedPartitionInfo[VBOXIMG_PARTITION_MAX + 1]; /* Note: Element 0 reserved for EntireDisk partitionEntry */ 169 170 static struct vboximgOpts { 169 171 char *pszVm; /** optional VM UUID */ 170 172 char *pszImage; /** Virtual Disk image UUID or path */ … … 180 182 uint32_t fBriefUsage; /** Flag to display only FS-specific program usage options */ 181 183 uint32_t fVerbose; /** Make some noise */ 182 } g_vbox rawOpts;183 184 #define OPTION(fmt, pos, val) { fmt, offsetof(struct vbox rawOpts, pos), val }185 186 static struct fuse_opt vbox rawOptDefs[] = {184 } g_vboximgOpts; 185 186 #define OPTION(fmt, pos, val) { fmt, offsetof(struct vboximgOpts, pos), val } 187 188 static struct fuse_opt vboximgOptDefs[] = { 187 189 OPTION("-l", fListMediaBrief, 1), 188 190 OPTION("-L", fListMedia, 1), … … 211 213 briefUsage() 212 214 { 213 RTPrintf("usage: vbox raw[options] <mountpoint>\n\n"214 "vbox rawoptions:\n\n"215 RTPrintf("usage: vboximg-mount [options] <mountpoint>\n\n" 216 "vboximg-mount options:\n\n" 215 217 " [ -l ] List virtual disk media (brief version)\n" 216 218 " [ -L ] List virtual disk media (long version)\n" … … 258 260 259 261 static int 260 vbox rawOptHandler(void *data, const char *arg, int optKey, struct fuse_args *outargs)262 vboximgOptHandler(void *data, const char *arg, int optKey, struct fuse_args *outargs) 261 263 { 262 264 (void) data; … … 267 269 briefUsage(); 268 270 fuse_opt_add_arg(outargs, "-ho"); 269 fuse_main(outargs->argc, outargs->argv, &g_vbox rawOps, NULL);271 fuse_main(outargs->argc, outargs->argv, &g_vboximgOps, NULL); 270 272 break; 271 273 } … … 274 276 275 277 /** @copydoc fuse_operations::open */ 276 static int vbox rawOp_open(const char *pszPath, struct fuse_file_info *pInfo)278 static int vboximgOp_open(const char *pszPath, struct fuse_file_info *pInfo) 277 279 { 278 280 (void) pInfo; … … 336 338 337 339 /** @todo Remove when VD I/O becomes threadsafe */ 338 static DECLCALLBACK(int) vbox rawThreadStartRead(void *pvUser)340 static DECLCALLBACK(int) vboximgThreadStartRead(void *pvUser) 339 341 { 340 342 PRTCRITSECT vdioLock = (PRTCRITSECT)pvUser; … … 342 344 } 343 345 344 static DECLCALLBACK(int) vbox rawThreadFinishRead(void *pvUser)346 static DECLCALLBACK(int) vboximgThreadFinishRead(void *pvUser) 345 347 { 346 348 PRTCRITSECT vdioLock = (PRTCRITSECT)pvUser; … … 348 350 } 349 351 350 static DECLCALLBACK(int) vbox rawThreadStartWrite(void *pvUser)352 static DECLCALLBACK(int) vboximgThreadStartWrite(void *pvUser) 351 353 { 352 354 PRTCRITSECT vdioLock = (PRTCRITSECT)pvUser; … … 354 356 } 355 357 356 static DECLCALLBACK(int) vbox rawThreadFinishWrite(void *pvUser)358 static DECLCALLBACK(int) vboximgThreadFinishWrite(void *pvUser) 357 359 { 358 360 PRTCRITSECT vdioLock = (PRTCRITSECT)pvUser; … … 362 364 363 365 /** @copydoc fuse_operations::release */ 364 static int vbox rawOp_release(const char *pszPath, struct fuse_file_info *pInfo)366 static int vboximgOp_release(const char *pszPath, struct fuse_file_info *pInfo) 365 367 { 366 368 (void) pszPath; … … 571 573 572 574 /** @copydoc fuse_operations::read */ 573 static int vbox rawOp_read(const char *pszPath, char *pbBuf, size_t cbBuf,575 static int vboximgOp_read(const char *pszPath, char *pbBuf, size_t cbBuf, 574 576 off_t offset, struct fuse_file_info *pInfo) 575 577 { … … 602 604 603 605 /** @copydoc fuse_operations::write */ 604 static int vbox rawOp_write(const char *pszPath, const char *pbBuf, size_t cbBuf,606 static int vboximgOp_write(const char *pszPath, const char *pbBuf, size_t cbBuf, 605 607 off_t offset, struct fuse_file_info *pInfo) 606 608 { … … 617 619 618 620 int rc = 0; 619 if (!g_vbox rawOpts.fRW) {620 LogFlowFunc(("WARNING: vbox raw(FUSE FS) --rw option not specified\n"621 if (!g_vboximgOpts.fRW) { 622 LogFlowFunc(("WARNING: vboximg-mount (FUSE FS) --rw option not specified\n" 621 623 " (write operation ignored w/o error!)\n")); 622 624 return cbBuf; … … 638 640 /** @copydoc fuse_operations::getattr */ 639 641 static int 640 vbox rawOp_getattr(const char *pszPath, struct stat *stbuf)642 vboximgOp_getattr(const char *pszPath, struct stat *stbuf) 641 643 { 642 644 int rc = 0; … … 670 672 * representing the offset range of the partition. 671 673 * 672 * $ vbox raw-i /stroll/along/the/path/simple_fixed_disk.vdi -p 1 /mnt/tmpdir674 * $ vboximg-mount -i /stroll/along/the/path/simple_fixed_disk.vdi -p 1 /mnt/tmpdir 673 675 * $ ls /mnt/tmpdir 674 676 * simple_fixed_disk.vdi[20480:2013244928] vhdd … … 690 692 /** @copydoc fuse_operations::readdir */ 691 693 static int 692 vbox rawOp_readdir(const char *pszPath, void *pvBuf, fuse_fill_dir_t pfnFiller,694 vboximgOp_readdir(const char *pszPath, void *pvBuf, fuse_fill_dir_t pfnFiller, 693 695 off_t offset, struct fuse_file_info *pInfo) 694 696 … … 734 736 /** @copydoc fuse_operations::readlink */ 735 737 static int 736 vbox rawOp_readlink(const char *pszPath, char *buf, size_t size)738 vboximgOp_readlink(const char *pszPath, char *buf, size_t size) 737 739 { 738 740 (void) pszPath; … … 792 794 if (ancestorNumber == 0) 793 795 { 794 if (!g_vbox rawOpts.fListMediaBrief)796 if (!g_vboximgOpts.fListMediaBrief) 795 797 { 796 798 RTPrintf(" -----------------------\n"); … … 810 812 else 811 813 { 812 if (!g_vbox rawOpts.fListMediaBrief)814 if (!g_vboximgOpts.fListMediaBrief) 813 815 { 814 816 RTPrintf(" Diff %d:\n", ancestorNumber); … … 855 857 CHECK_ERROR(pMachine, COMGETTER(SettingsFilePath)(pMachineLocation.asOutParam())); 856 858 857 if ( g_vbox rawOpts.pszVm == NULL858 || RTStrNCmp(CSTR(pMachineUuid), g_vbox rawOpts.pszVm, MAX_UUID_LEN) == 0859 || RTStrNCmp((const char *)pMachineName.raw(), g_vbox rawOpts.pszVm, MAX_UUID_LEN) == 0)859 if ( g_vboximgOpts.pszVm == NULL 860 || RTStrNCmp(CSTR(pMachineUuid), g_vboximgOpts.pszVm, MAX_UUID_LEN) == 0 861 || RTStrNCmp((const char *)pMachineName.raw(), g_vboximgOpts.pszVm, MAX_UUID_LEN) == 0) 860 862 { 861 if (!g_vbox rawOpts.fListMediaBrief)863 if (!g_vboximgOpts.fListMediaBrief) 862 864 { 863 865 RTPrintf("------------------------------------------------------\n"); … … 990 992 RTPrintf(" UUID: %s\n\n", g_pvDiskUuid); 991 993 992 if (g_vbox rawOpts.fVerbose)994 if (g_vboximgOpts.fVerbose) 993 995 { 994 996 RTPrintf(" GPT Partition Table Header:\n\n"); … … 1056 1058 1057 1059 for (int idxPartition = 5; 1058 idxPartition <= VBOX RAW_PARTITION_MAX;1060 idxPartition <= VBOXIMG_PARTITION_MAX; 1059 1061 idxPartition++) 1060 1062 { … … 1241 1243 return RTMsgErrorExitFailure("VDInit failed, rc=%Rrc\n", rc); 1242 1244 1243 memset(&g_vbox rawOps, 0, sizeof(g_vboxrawOps));1244 g_vbox rawOps.open = vboxrawOp_open;1245 g_vbox rawOps.read = vboxrawOp_read;1246 g_vbox rawOps.write = vboxrawOp_write;1247 g_vbox rawOps.getattr = vboxrawOp_getattr;1248 g_vbox rawOps.release = vboxrawOp_release;1249 g_vbox rawOps.readdir = vboxrawOp_readdir;1250 g_vbox rawOps.readlink = vboxrawOp_readlink;1245 memset(&g_vboximgOps, 0, sizeof(g_vboximgOps)); 1246 g_vboximgOps.open = vboximgOp_open; 1247 g_vboximgOps.read = vboximgOp_read; 1248 g_vboximgOps.write = vboximgOp_write; 1249 g_vboximgOps.getattr = vboximgOp_getattr; 1250 g_vboximgOps.release = vboximgOp_release; 1251 g_vboximgOps.readdir = vboximgOp_readdir; 1252 g_vboximgOps.readlink = vboximgOp_readlink; 1251 1253 1252 1254 struct fuse_args args = FUSE_ARGS_INIT(argc, argv); 1253 memset(&g_vbox rawOpts, 0, sizeof(g_vboxrawOpts));1254 1255 rc = fuse_opt_parse(&args, &g_vbox rawOpts, vboxrawOptDefs, vboxrawOptHandler);1256 1257 if (g_vbox rawOpts.fAllowRoot)1255 memset(&g_vboximgOpts, 0, sizeof(g_vboximgOpts)); 1256 1257 rc = fuse_opt_parse(&args, &g_vboximgOpts, vboximgOptDefs, vboximgOptHandler); 1258 1259 if (g_vboximgOpts.fAllowRoot) 1258 1260 fuse_opt_add_arg(&args, "-oallow_root"); 1259 1261 1260 1262 if (rc == -1) 1261 1263 return RTMsgErrorExitFailure("Couldn't parse fuse options, rc=%Rrc\n", rc); 1262 if (g_vbox rawOpts.fBriefUsage)1264 if (g_vboximgOpts.fBriefUsage) 1263 1265 { 1264 1266 briefUsage(); … … 1297 1299 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to get IVirtualBox object! (hrc=%Rhrc)", hrc); 1298 1300 1299 if (g_vbox rawOpts.fVerbose)1300 RTPrintf("vbox raw: VirtualBox XPCOM object created\n");1301 1302 if (g_vbox rawOpts.fListMedia || g_vboxrawOpts.fListMediaBrief)1301 if (g_vboximgOpts.fVerbose) 1302 RTPrintf("vboximg: VirtualBox XPCOM object created\n"); 1303 1304 if (g_vboximgOpts.fListMedia || g_vboximgOpts.fListMediaBrief) 1303 1305 { 1304 1306 listVMs(pVirtualBox); … … 1307 1309 1308 1310 1309 if (g_vbox rawOpts.pszImage == NULL)1311 if (g_vboximgOpts.pszImage == NULL) 1310 1312 { 1311 1313 RTMsgErrorExitFailure("To list partitions, must also specify --i or --image option\n"); … … 1315 1317 char *pszFormat; 1316 1318 VDTYPE enmType; 1317 searchForBaseImage(pVirtualBox, g_vbox rawOpts.pszImage, &pBaseImageMedium);1319 searchForBaseImage(pVirtualBox, g_vboximgOpts.pszImage, &pBaseImageMedium); 1318 1320 if (pBaseImageMedium == NULL) 1319 1321 { … … 1322 1324 * resolving symlinks back to hard path. 1323 1325 */ 1324 int cbNameMax = pathconf(g_vbox rawOpts.pszImage, _PC_PATH_MAX);1326 int cbNameMax = pathconf(g_vboximgOpts.pszImage, _PC_PATH_MAX); 1325 1327 if (cbNameMax < 0) 1326 1328 return cbNameMax; 1327 1329 1328 g_pszBaseImagePath = RTStrDup(g_vbox rawOpts.pszImage);1330 g_pszBaseImagePath = RTStrDup(g_vboximgOpts.pszImage); 1329 1331 if (g_pszBaseImagePath == NULL) 1330 1332 return RTMsgErrorExitFailure("out of memory\n"); … … 1337 1339 "Virtual disk image not readable: \"%s\"\n", g_pszBaseImagePath); 1338 1340 1339 if (g_vbox rawOpts.fRW && access(g_vboxrawOpts.pszImage, W_OK) < 0)1341 if (g_vboximgOpts.fRW && access(g_vboximgOpts.pszImage, W_OK) < 0) 1340 1342 return RTMsgErrorExitFailure( 1341 1343 "Virtual disk image not writeable: \"%s\"\n", g_pszBaseImagePath); … … 1421 1423 return RTMsgErrorExitFailure("VDGetFormat(,,%s,,) " 1422 1424 "failed (during HDD container creation), rc=%Rrc\n", g_pszBaseImagePath, rc); 1423 if (g_vbox rawOpts.fVerbose)1425 if (g_vboximgOpts.fVerbose) 1424 1426 RTPrintf("Creating container for base image of format %s\n", pszFormat); 1425 1427 /** @todo Remove I/O CB's and crit sect. when VDRead()/VDWrite() are made threadsafe */ … … 1427 1429 if (RT_SUCCESS(rc)) 1428 1430 { 1429 g_VDIfThreadSync.pfnStartRead = vbox rawThreadStartRead;1430 g_VDIfThreadSync.pfnFinishRead = vbox rawThreadFinishRead;1431 g_VDIfThreadSync.pfnStartWrite = vbox rawThreadStartWrite;1432 g_VDIfThreadSync.pfnFinishWrite = vbox rawThreadFinishWrite;1433 rc = VDInterfaceAdd(&g_VDIfThreadSync.Core, "vbox raw_ThreadSync", VDINTERFACETYPE_THREADSYNC,1431 g_VDIfThreadSync.pfnStartRead = vboximgThreadStartRead; 1432 g_VDIfThreadSync.pfnFinishRead = vboximgThreadFinishRead; 1433 g_VDIfThreadSync.pfnStartWrite = vboximgThreadStartWrite; 1434 g_VDIfThreadSync.pfnFinishWrite = vboximgThreadFinishWrite; 1435 rc = VDInterfaceAdd(&g_VDIfThreadSync.Core, "vboximg_ThreadSync", VDINTERFACETYPE_THREADSYNC, 1434 1436 &g_vdioLock, sizeof(VDINTERFACETHREADSYNC), &g_pVdIfs); 1435 1437 } … … 1445 1447 /** @todo (end of to do section) */ 1446 1448 1447 if ( g_vbox rawOpts.cHddImageDiffMax != 0 && diffNumber > g_vboxrawOpts.cHddImageDiffMax)1449 if ( g_vboximgOpts.cHddImageDiffMax != 0 && diffNumber > g_vboximgOpts.cHddImageDiffMax) 1448 1450 break; 1449 1451 1450 if (g_vbox rawOpts.fVerbose)1452 if (g_vboximgOpts.fVerbose) 1451 1453 { 1452 1454 if (diffNumber == 0) 1453 RTPrintf("\nvbox raw: Opening base image into container:\n %s\n",1455 RTPrintf("\nvboximg-mount: Opening base image into container:\n %s\n", 1454 1456 g_pszBaseImagePath); 1455 1457 else 1456 RTPrintf("\nvbox raw: Opening difference image #%d into container:\n %s\n",1458 RTPrintf("\nvboximg-mount: Opening difference image #%d into container:\n %s\n", 1457 1459 diffNumber, g_pszBaseImagePath); 1458 1460 } … … 1484 1486 g_cbEntireVDisk = VDGetSize(g_pVDisk, 0 /* base */); 1485 1487 1486 if (g_vbox rawOpts.fListParts)1488 if (g_vboximgOpts.fListParts) 1487 1489 { 1488 1490 if (g_pVDisk == NULL) … … 1505 1507 return 0; 1506 1508 } 1507 if (g_vbox rawOpts.idxPartition >= 0)1508 { 1509 if (g_vbox rawOpts.offset)1509 if (g_vboximgOpts.idxPartition >= 0) 1510 { 1511 if (g_vboximgOpts.offset) 1510 1512 return RTMsgErrorExitFailure("--offset and --partition are mutually exclusive options\n"); 1511 1513 1512 if (g_vbox rawOpts.size)1514 if (g_vboximgOpts.size) 1513 1515 return RTMsgErrorExitFailure("--size and --partition are mutually exclusive options\n"); 1514 1516 … … 1521 1523 if (rc < 0) 1522 1524 return RTMsgErrorExitFailure("Error parsing disk MBR/Partition table\n"); 1523 int partNbr = g_vbox rawOpts.idxPartition;1525 int partNbr = g_vboximgOpts.idxPartition; 1524 1526 1525 1527 if (partNbr < 0 || partNbr > g_lastPartNbr) … … 1530 1532 g_vDiskOffset = 0; 1531 1533 g_vDiskSize = VDGetSize(g_pVDisk, 0); 1532 if (g_vbox rawOpts.fVerbose)1534 if (g_vboximgOpts.fVerbose) 1533 1535 RTPrintf("Partition 0 specified - Whole disk will be accessible\n"); 1534 1536 } else { 1535 1537 for (int i = 0; i < g_lastPartNbr; i++) 1536 1538 { 1537 /* If GPT, display vbox raw's representation of partition table starts at partition 21539 /* If GPT, display vboximg's representation of partition table starts at partition 2 1538 1540 * but the table is displayed calling it partition 1, because the protective MBR 1539 1541 * record is relatively pointless to display or reference in this context */ … … 1543 1545 g_vDiskOffset = g_aParsedPartitionInfo[i].offPartition; 1544 1546 g_vDiskSize = g_vDiskOffset + g_aParsedPartitionInfo[i].cbPartition; 1545 if (g_vbox rawOpts.fVerbose)1547 if (g_vboximgOpts.fVerbose) 1546 1548 RTPrintf("Partition %d specified. Only sectors %llu to %llu of disk will be accessible\n", 1547 g_vbox rawOpts.idxPartition, g_vDiskOffset / BLOCKSIZE, g_vDiskSize / BLOCKSIZE);1549 g_vboximgOpts.idxPartition, g_vDiskOffset / BLOCKSIZE, g_vDiskSize / BLOCKSIZE); 1548 1550 } 1549 1551 } 1550 1552 } 1551 1553 } else { 1552 if (g_vbox rawOpts.offset) {1553 if (g_vbox rawOpts.offset < 0 || g_vboxrawOpts.offset + g_vboxrawOpts.size > g_cbEntireVDisk)1554 if (g_vboximgOpts.offset) { 1555 if (g_vboximgOpts.offset < 0 || g_vboximgOpts.offset + g_vboximgOpts.size > g_cbEntireVDisk) 1554 1556 return RTMsgErrorExitFailure("User specified offset out of range of virtual disk\n"); 1555 1557 1556 if (g_vbox rawOpts.fVerbose)1558 if (g_vboximgOpts.fVerbose) 1557 1559 RTPrintf("Setting r/w bias (offset) to user requested value for sector %llu\n", g_vDiskOffset / BLOCKSIZE); 1558 1560 1559 g_vDiskOffset = g_vbox rawOpts.offset;1560 } 1561 if (g_vbox rawOpts.size) {1562 if (g_vbox rawOpts.size < 0 || g_vboxrawOpts.offset + g_vboxrawOpts.size > g_cbEntireVDisk)1561 g_vDiskOffset = g_vboximgOpts.offset; 1562 } 1563 if (g_vboximgOpts.size) { 1564 if (g_vboximgOpts.size < 0 || g_vboximgOpts.offset + g_vboximgOpts.size > g_cbEntireVDisk) 1563 1565 return RTMsgErrorExitFailure("User specified size out of range of virtual disk\n"); 1564 1566 1565 if (g_vbox rawOpts.fVerbose)1567 if (g_vboximgOpts.fVerbose) 1566 1568 RTPrintf("Setting r/w size limit to user requested value %llu\n", g_vDiskSize / BLOCKSIZE); 1567 1569 1568 g_vDiskSize = g_vbox rawOpts.size;1570 g_vDiskSize = g_vboximgOpts.size; 1569 1571 } 1570 1572 } … … 1575 1577 * Hand control over to libfuse. 1576 1578 */ 1577 if (g_vbox rawOpts.fVerbose)1578 RTPrintf("\nvbox raw: Going into background...\n");1579 1580 rc = fuse_main(args.argc, args.argv, &g_vbox rawOps, NULL);1579 if (g_vboximgOpts.fVerbose) 1580 RTPrintf("\nvboximg-mount: Going into background...\n"); 1581 1582 rc = fuse_main(args.argc, args.argv, &g_vboximgOps, NULL); 1581 1583 1582 1584 int rc2 = VDClose(g_pVDisk, false /* fDelete */); 1583 1585 AssertRC(rc2); 1584 RTPrintf("vbox raw: fuse_main -> %d\n", rc);1586 RTPrintf("vboximg-mount: fuse_main -> %d\n", rc); 1585 1587 return rc; 1586 1588 }
Note:
See TracChangeset
for help on using the changeset viewer.