Changeset 17669 in vbox for trunk/src/VBox/Frontends/VBoxManage
- Timestamp:
- Mar 11, 2009 9:56:29 AM (16 years ago)
- Location:
- trunk/src/VBox/Frontends/VBoxManage
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/Makefile.kmk
r17419 r17669 40 40 $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000) \ 41 41 $(if $(VBOX_WITH_AHCI), VBOX_WITH_AHCI) \ 42 $(if $(VBOX_WITH_AHCI), VBOX_WITH_LSILOGIC) \ 42 43 $(if $(VBOX_WITH_GUEST_PROPS),VBOX_WITH_GUEST_PROPS) \ 43 44 $(if $(VBOX_WITH_HOSTNETIF_API), VBOX_WITH_HOSTNETIF_API) -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r17549 r17669 158 158 " [-sataideemulation<1-4> <1-30>]\n" 159 159 #endif 160 #ifdef VBOX_WITH_LSILOGIC 161 " [-lsilogic on|off]\n" 162 " [-lsilogicport<1-16> none|<uuid>|<filename>]\n" 163 #endif 160 164 " [-dvd none|<uuid>|<filename>|host:<drive>]\n" 161 165 " [-dvdpassthrough on|off]\n" -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
r17553 r17669 448 448 */ 449 449 #ifdef VBOX_WITH_AHCI 450 ComPtr<ISATAController> SATACtl; 451 BOOL fSataEnabled; 452 rc = machine->COMGETTER(SATAController)(SATACtl.asOutParam()); 450 ComPtr<IStorageController> SataCtl; 451 bool fSataEnabled = false; 452 453 rc = machine->GetStorageControllerByName(Bstr("SATA"), SataCtl.asOutParam()); 453 454 if (SUCCEEDED(rc)) 454 { 455 rc = SATACtl->COMGETTER(Enabled)(&fSataEnabled); 456 if (FAILED(rc)) 457 fSataEnabled = false; 458 if (details == VMINFO_MACHINEREADABLE) 459 RTPrintf("sata=\"%s\"\n", fSataEnabled ? "on" : "off"); 460 else 461 RTPrintf("SATA: %s\n", fSataEnabled ? "enabled" : "disabled"); 462 } 455 fSataEnabled = true; 456 457 if (details == VMINFO_MACHINEREADABLE) 458 RTPrintf("sata=\"%s\"\n", fSataEnabled ? "on" : "off"); 459 else 460 RTPrintf("SATA: %s\n", fSataEnabled ? "enabled" : "disabled"); 463 461 464 462 /* … … 471 469 ULONG cSataPorts; 472 470 473 S ATACtl->COMGETTER(PortCount)(&cSataPorts);471 SataCtl->COMGETTER(PortCount)(&cSataPorts); 474 472 for (ULONG i = 0; i < cSataPorts; ++ i) 475 473 { 476 rc = machine->GetHardDisk( StorageBus_SATA, i, 0, hardDisk.asOutParam());474 rc = machine->GetHardDisk(Bstr("SATA"), i, 0, hardDisk.asOutParam()); 477 475 if (SUCCEEDED(rc) && hardDisk) 478 476 { … … 499 497 * IDE Hard disks 500 498 */ 501 IDEControllerType_T ideController; 502 const char *pszIdeController = NULL; 503 biosSettings->COMGETTER(IDEControllerType)(&ideController); 504 switch (ideController) 505 { 506 case IDEControllerType_PIIX3: 507 pszIdeController = "PIIX3"; 508 break; 509 case IDEControllerType_PIIX4: 510 pszIdeController = "PIIX4"; 511 break; 512 case IDEControllerType_ICH6: 513 pszIdeController = "ICH6"; 514 break; 515 default: 516 pszIdeController = "unknown"; 517 } 518 if (details == VMINFO_MACHINEREADABLE) 519 RTPrintf("idecontroller=\"%s\"\n", pszIdeController); 520 else 521 RTPrintf("IDE Controller: %s\n", pszIdeController); 499 ComPtr<IStorageController> ideController; 500 501 rc = machine->GetStorageControllerByName(Bstr("IDE"), ideController.asOutParam()); 502 if (SUCCEEDED(rc) && ideController) 503 { 504 StorageControllerType_T enmIdeController; 505 const char *pszIdeController = NULL; 506 507 rc = ideController->COMGETTER(ControllerType)(&enmIdeController); 508 509 switch (enmIdeController) 510 { 511 case StorageControllerType_PIIX3: 512 pszIdeController = "PIIX3"; 513 break; 514 case StorageControllerType_PIIX4: 515 pszIdeController = "PIIX4"; 516 break; 517 case StorageControllerType_ICH6: 518 pszIdeController = "ICH6"; 519 break; 520 default: 521 pszIdeController = "unknown"; 522 } 523 if (details == VMINFO_MACHINEREADABLE) 524 RTPrintf("idecontroller=\"%s\"\n", pszIdeController); 525 else 526 RTPrintf("IDE Controller: %s\n", pszIdeController); 527 } 522 528 523 529 ComPtr<IHardDisk> hardDisk; 524 530 Bstr filePath; 525 rc = machine->GetHardDisk( StorageBus_IDE, 0, 0, hardDisk.asOutParam());531 rc = machine->GetHardDisk(Bstr("IDE"), 0, 0, hardDisk.asOutParam()); 526 532 if (SUCCEEDED(rc) && hardDisk) 527 533 { … … 541 547 RTPrintf("hda=\"none\"\n"); 542 548 } 543 rc = machine->GetHardDisk( StorageBus_IDE, 0, 1, hardDisk.asOutParam());549 rc = machine->GetHardDisk(Bstr("IDE"), 0, 1, hardDisk.asOutParam()); 544 550 if (SUCCEEDED(rc) && hardDisk) 545 551 { … … 559 565 RTPrintf("hdb=\"none\"\n"); 560 566 } 561 rc = machine->GetHardDisk( StorageBus_IDE, 1, 1, hardDisk.asOutParam());567 rc = machine->GetHardDisk(Bstr("IDE"), 1, 1, hardDisk.asOutParam()); 562 568 if (SUCCEEDED(rc) && hardDisk) 563 569 { -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r17387 r17669 78 78 DeviceType_T bootDevice[4]; 79 79 int bootDeviceChanged[4] = { false }; 80 char *hdds[ 34] = {0};80 char *hdds[50] = {0}; 81 81 char *dvd = NULL; 82 82 char *dvdpassthrough = NULL; … … 100 100 ULONG guestStatInterval = (ULONG)-1; 101 101 int fSataEnabled = -1; 102 int fLsiLogicEnabled = -1; 102 103 int sataPortCount = -1; 103 104 int sataBootDevices[4] = {-1,-1,-1,-1}; … … 714 715 715 716 sataBootDevices[bootDevicePos] = n-1; 717 } 718 else if (strcmp(a->argv[i], "-lsilogic") == 0) 719 { 720 if (a->argc <= i + 1) 721 return errorArgument("Missing argument to '%s'", a->argv[i]); 722 i++; 723 if (strcmp(a->argv[i], "on") == 0 || strcmp(a->argv[i], "enable") == 0) 724 fLsiLogicEnabled = 1; 725 else if (strcmp(a->argv[i], "off") == 0 || strcmp(a->argv[i], "disable") == 0) 726 fLsiLogicEnabled = 0; 727 else 728 return errorArgument("Invalid -lsilogic argument '%s'", a->argv[i]); 729 } 730 else if (strncmp(a->argv[i], "-lsilogicport", 13) == 0) 731 { 732 unsigned n = parseNum(&a->argv[i][13], 16, "LsiLogic"); 733 if (!n) 734 return 1; 735 if (a->argc <= i + 1) 736 return errorArgument("Missing argument to '%s'", a->argv[i]); 737 i++; 738 hdds[n-1+34] = a->argv[i]; 716 739 } 717 740 else … … 983 1006 if (strcmp(hdds[0], "none") == 0) 984 1007 { 985 machine->DetachHardDisk( StorageBus_IDE, 0, 0);1008 machine->DetachHardDisk(Bstr("IDE"), 0, 0); 986 1009 } 987 1010 else … … 1004 1027 { 1005 1028 hardDisk->COMGETTER(Id)(uuid.asOutParam()); 1006 CHECK_ERROR(machine, AttachHardDisk(uuid, StorageBus_IDE, 0, 0));1029 CHECK_ERROR(machine, AttachHardDisk(uuid, Bstr("IDE"), 0, 0)); 1007 1030 } 1008 1031 else … … 1016 1039 if (strcmp(hdds[1], "none") == 0) 1017 1040 { 1018 machine->DetachHardDisk( StorageBus_IDE, 0, 1);1041 machine->DetachHardDisk(Bstr("IDE"), 0, 1); 1019 1042 } 1020 1043 else … … 1037 1060 { 1038 1061 hardDisk->COMGETTER(Id)(uuid.asOutParam()); 1039 CHECK_ERROR(machine, AttachHardDisk(uuid, StorageBus_IDE, 0, 1));1062 CHECK_ERROR(machine, AttachHardDisk(uuid, Bstr("IDE"), 0, 1)); 1040 1063 } 1041 1064 else … … 1049 1072 if (strcmp(hdds[2], "none") == 0) 1050 1073 { 1051 machine->DetachHardDisk( StorageBus_IDE, 1, 1);1074 machine->DetachHardDisk(Bstr("IDE"), 1, 1); 1052 1075 } 1053 1076 else … … 1070 1093 { 1071 1094 hardDisk->COMGETTER(Id)(uuid.asOutParam()); 1072 CHECK_ERROR(machine, AttachHardDisk(uuid, StorageBus_IDE, 1, 1));1095 CHECK_ERROR(machine, AttachHardDisk(uuid, Bstr("IDE"), 1, 1)); 1073 1096 } 1074 1097 else … … 1156 1179 if (idecontroller) 1157 1180 { 1181 ComPtr<IStorageController> storageController; 1182 CHECK_ERROR(machine, GetStorageControllerByName(Bstr("IDE"), storageController.asOutParam())); 1183 1158 1184 if (RTStrICmp(idecontroller, "PIIX3") == 0) 1159 1185 { 1160 CHECK_ERROR( biosSettings, COMSETTER(IDEControllerType)(IDEControllerType_PIIX3));1186 CHECK_ERROR(storageController, COMSETTER(ControllerType)(StorageControllerType_PIIX3)); 1161 1187 } 1162 1188 else if (RTStrICmp(idecontroller, "PIIX4") == 0) 1163 1189 { 1164 CHECK_ERROR(biosSettings, COMSETTER(IDEControllerType)(IDEControllerType_PIIX4)); 1190 CHECK_ERROR(storageController, COMSETTER(ControllerType)(StorageControllerType_PIIX4)); 1191 } 1192 else if (RTStrICmp(idecontroller, "ICH6") == 0) 1193 { 1194 CHECK_ERROR(storageController, COMSETTER(ControllerType)(StorageControllerType_ICH6)); 1165 1195 } 1166 1196 else … … 1739 1769 if (fSataEnabled != -1) 1740 1770 { 1741 ComPtr<ISATAController> SataCtl; 1742 CHECK_ERROR(machine, COMGETTER(SATAController)(SataCtl.asOutParam())); 1743 if (SUCCEEDED(rc)) 1744 { 1745 CHECK_ERROR(SataCtl, COMSETTER(Enabled)(!!fSataEnabled)); 1746 } 1771 if (fSataEnabled) 1772 { 1773 CHECK_ERROR(machine, AddStorageController(Bstr("SATA"), StorageBus_SATA)); 1774 ComPtr<IStorageController> ctl; 1775 CHECK_ERROR(machine, GetStorageControllerByName(Bstr("SATA"), ctl.asOutParam())); 1776 CHECK_ERROR(ctl, COMSETTER(ControllerType)(StorageControllerType_IntelAhci)); 1777 } 1778 else 1779 CHECK_ERROR(machine, RemoveStorageController(Bstr("SATA"))); 1747 1780 } 1748 1781 … … 1753 1786 if (strcmp(hdds[i], "none") == 0) 1754 1787 { 1755 machine->DetachHardDisk( StorageBus_SATA, i-4, 0);1788 machine->DetachHardDisk(Bstr("SATA"), i-4, 0); 1756 1789 } 1757 1790 else … … 1774 1807 { 1775 1808 hardDisk->COMGETTER(Id)(uuid.asOutParam()); 1776 CHECK_ERROR(machine, AttachHardDisk(uuid, StorageBus_SATA, i-4, 0));1809 CHECK_ERROR(machine, AttachHardDisk(uuid, Bstr("SATA"), i-4, 0)); 1777 1810 } 1778 1811 else … … 1788 1821 if (sataBootDevices[i] != -1) 1789 1822 { 1790 ComPtr<IS ATAController> SataCtl;1791 CHECK_ERROR(machine, COMGETTER(SATAController)(SataCtl.asOutParam()));1823 ComPtr<IStorageController> SataCtl; 1824 CHECK_ERROR(machine, GetStorageControllerByName(Bstr("SATA"), SataCtl.asOutParam())); 1792 1825 if (SUCCEEDED(rc)) 1793 1826 { … … 1799 1832 if (sataPortCount != -1) 1800 1833 { 1801 ComPtr<IS ATAController> SataCtl;1802 CHECK_ERROR(machine, COMGETTER(SATAController)(SataCtl.asOutParam()));1834 ComPtr<IStorageController> SataCtl; 1835 CHECK_ERROR(machine, GetStorageControllerByName(Bstr("SATA"), SataCtl.asOutParam())); 1803 1836 if (SUCCEEDED(rc)) 1804 1837 { 1805 1838 CHECK_ERROR(SataCtl, COMSETTER(PortCount)(sataPortCount)); 1839 } 1840 } 1841 1842 /* 1843 * LsiLogic controller enable/disable 1844 */ 1845 if (fLsiLogicEnabled != -1) 1846 { 1847 if (fLsiLogicEnabled) 1848 { 1849 CHECK_ERROR(machine, AddStorageController(Bstr("LsiLogic"), StorageBus_SCSI)); 1850 ComPtr<IStorageController> ctl; 1851 CHECK_ERROR(machine, GetStorageControllerByName(Bstr("LsiLogic"), ctl.asOutParam())); 1852 CHECK_ERROR(ctl, COMSETTER(ControllerType)(StorageControllerType_LsiLogic)); 1853 } 1854 else 1855 CHECK_ERROR(machine, RemoveStorageController(Bstr("LsiLogic"))); 1856 } 1857 1858 for (uint32_t i = 34; i < 50; i++) 1859 { 1860 if (hdds[i]) 1861 { 1862 if (strcmp(hdds[i], "none") == 0) 1863 { 1864 machine->DetachHardDisk(Bstr("LsiLogic"), i-34, 0); 1865 } 1866 else 1867 { 1868 /* first guess is that it's a UUID */ 1869 Guid uuid(hdds[i]); 1870 ComPtr<IHardDisk> hardDisk; 1871 rc = a->virtualBox->GetHardDisk(uuid, hardDisk.asOutParam()); 1872 /* not successful? Then it must be a filename */ 1873 if (!hardDisk) 1874 { 1875 CHECK_ERROR(a->virtualBox, FindHardDisk(Bstr(hdds[i]), hardDisk.asOutParam())); 1876 if (FAILED(rc)) 1877 { 1878 /* open the new hard disk object */ 1879 CHECK_ERROR(a->virtualBox, OpenHardDisk(Bstr(hdds[i]), hardDisk.asOutParam())); 1880 } 1881 } 1882 if (hardDisk) 1883 { 1884 hardDisk->COMGETTER(Id)(uuid.asOutParam()); 1885 CHECK_ERROR(machine, AttachHardDisk(uuid, Bstr("LsiLogic"), i-34, 0)); 1886 } 1887 else 1888 rc = E_FAIL; 1889 if (FAILED(rc)) 1890 break; 1891 } 1806 1892 } 1807 1893 }
Note:
See TracChangeset
for help on using the changeset viewer.