- Timestamp:
- Jan 31, 2007 11:04:09 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r425 r459 432 432 " [-port <port>]\n" 433 433 " [-lun <lun>]\n" 434 " [-encodedlun <lun>]\n" 434 435 " [-username <username>]\n" 435 436 " [-password <password>]\n" … … 658 659 CHECK_ERROR (machine, COMGETTER(Accessible) (&accessible)); 659 660 CheckComRCReturnRC (rc); 660 661 661 662 if (!accessible) 662 663 { … … 676 677 return S_OK; 677 678 } 678 679 679 680 Bstr machineName; 680 681 rc = machine->COMGETTER(Name)(machineName.asOutParam()); … … 2329 2330 } 2330 2331 i++; 2331 lun = atoi(argv[i]); 2332 char *pszNext; 2333 int rc = RTStrToUInt64Ex(argv[i], &pszNext, 0, &lun); 2334 if (VBOX_FAILURE(rc) || *pszNext != '\0' || lun >= 16384) 2335 return errorArgument("Invalid LUN number '%s'", argv[i]); 2336 if (lun <= 255) 2337 { 2338 /* Assume bus identifier = 0. */ 2339 lun = (lun << 48); /* uses peripheral device addressing method */ 2340 } 2341 else 2342 { 2343 /* Check above already limited the LUN to 14 bits. */ 2344 lun = (lun << 48) | (1 << 62); /* uses flat space addressing method */ 2345 } 2346 } 2347 else if (strcmp(argv[i], "-encodedlun") == 0) 2348 { 2349 if (argc <= i + 1) 2350 { 2351 return errorArgument("Missing argument to '%s'", argv[i]); 2352 } 2353 i++; 2354 char *pszNext; 2355 int rc = RTStrToUInt64Ex(argv[i], &pszNext, 0, &lun); 2356 if (VBOX_FAILURE(rc) || *pszNext != '\0') 2357 return errorArgument("Invalid encoded LUN number '%s'", argv[i]); 2332 2358 } 2333 2359 else if (strcmp(argv[i], "-username") == 0) … … 4708 4734 ComPtr<IHost> host; 4709 4735 CHECK_ERROR_BREAK(virtualBox, COMGETTER(Host)(host.asOutParam())); 4710 4736 4711 4737 ComPtr<IHostNetworkInterface> hostif; 4712 4738 ComPtr<IProgress> progress; … … 4715 4741 hostif.asOutParam(), 4716 4742 progress.asOutParam())); 4717 4743 4718 4744 showProgress(progress); 4719 4745 HRESULT result; … … 4747 4773 4748 4774 ComPtr<IHostNetworkInterface> hostif; 4749 4775 4750 4776 /* first guess is that it's a UUID */ 4751 4777 Guid uuid(argv[0]); … … 4758 4784 CHECK_ERROR_BREAK(hostif, COMGETTER(Id)(uuid.asOutParam())); 4759 4785 } 4760 4786 4761 4787 ComPtr<IProgress> progress; 4762 4788 CHECK_ERROR_BREAK(host,
Note:
See TracChangeset
for help on using the changeset viewer.