VirtualBox

Changeset 15488 in vbox


Ignore:
Timestamp:
Dec 15, 2008 10:00:20 AM (16 years ago)
Author:
vboxsync
Message:

ISCSI: move LUN encoding from VBoxManage to ISCSIHDDCore.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp

    r15408 r15488  
    14711471        else if (strcmp(argv[i], "-lun") == 0)
    14721472        {
    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];
    14981477        }
    14991478        else if (strcmp(argv[i], "-encodedlun") == 0)
     
    15021481                return errorArgument("Missing argument to '%s'", argv[i]);
    15031482            i++;
    1504             lun = argv[i];
     1483            lun = L"enc";
     1484            lun = lun + argv[i];
    15051485        }
    15061486        else if (strcmp(argv[i], "-username") == 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