Changeset 15488 in vbox
- Timestamp:
- Dec 15, 2008 10:00:20 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r15408 r15488 1471 1471 else if (strcmp(argv[i], "-lun") == 0) 1472 1472 { 1473 /// @todo is the below todo still relevant? Note that we do a 1474 /// strange string->int->string conversion here. 1475 1476 /** @todo move the LUN encoding algorithm into IISCSIHardDisk, add decoding */ 1477 1478 if (argc <= i + 1) 1479 return errorArgument("Missing argument to '%s'", argv[i]); 1480 i++; 1481 char *pszNext; 1482 uint64_t lunNum; 1483 int rc = RTStrToUInt64Ex(argv[i], &pszNext, 0, &lunNum); 1484 if (RT_FAILURE(rc) || *pszNext != '\0' || lunNum >= 16384) 1485 return errorArgument("Invalid LUN number '%s'", argv[i]); 1486 if (lunNum <= 255) 1487 { 1488 /* Assume bus identifier = 0. */ 1489 lunNum = (lunNum << 48); /* uses peripheral device addressing method */ 1490 } 1491 else 1492 { 1493 /* Check above already limited the LUN to 14 bits. */ 1494 lunNum = (lunNum << 48) | RT_BIT_64(62); /* uses flat space addressing method */ 1495 } 1496 1497 lun = BstrFmt ("%llu", lunNum); 1473 if (argc <= i + 1) 1474 return errorArgument("Missing argument to '%s'", argv[i]); 1475 i++; 1476 lun = argv[i]; 1498 1477 } 1499 1478 else if (strcmp(argv[i], "-encodedlun") == 0) … … 1502 1481 return errorArgument("Missing argument to '%s'", argv[i]); 1503 1482 i++; 1504 lun = argv[i]; 1483 lun = L"enc"; 1484 lun = lun + argv[i]; 1505 1485 } 1506 1486 else if (strcmp(argv[i], "-username") == 0)
Note:
See TracChangeset
for help on using the changeset viewer.