Changeset 101220 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Sep 21, 2023 10:51:17 AM (18 months ago)
- svn:sync-xref-src-repo-rev:
- 159198
- Location:
- trunk/src/VBox/Main/src-server
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/VBox/Main/src-server/MachineImpl.cpp ¶
r101214 r101220 58 58 #include "AutostartDb.h" 59 59 #include "SystemPropertiesImpl.h" 60 #include "StorageControllerImpl.h" 60 61 #include "MachineImplMoveVM.h" 61 62 #include "ExtPackManagerImpl.h" … … 15115 15116 } 15116 15117 15117 com::Utf8Str Machine::i_controllerNameFromBusType(StorageBus_T aBusType)15118 {15119 com::Utf8Str strControllerName = "Unknown";15120 switch (aBusType)15121 {15122 case StorageBus_IDE:15123 {15124 strControllerName = "IDE";15125 break;15126 }15127 case StorageBus_SATA:15128 {15129 strControllerName = "SATA";15130 break;15131 }15132 case StorageBus_SCSI:15133 {15134 strControllerName = "SCSI";15135 break;15136 }15137 case StorageBus_Floppy:15138 {15139 strControllerName = "Floppy";15140 break;15141 }15142 case StorageBus_SAS:15143 {15144 strControllerName = "SAS";15145 break;15146 }15147 case StorageBus_USB:15148 {15149 strControllerName = "USB";15150 break;15151 }15152 case StorageBus_PCIe:15153 {15154 strControllerName = "PCIe";15155 break;15156 }15157 case StorageBus_VirtioSCSI:15158 {15159 strControllerName = "VirtioSCSI";15160 break;15161 }15162 default:15163 AssertFailed(); /* Catch missing case above. */15164 break;15165 }15166 return strControllerName;15167 }15168 15169 15118 HRESULT Machine::applyDefaults(const com::Utf8Str &aFlags) 15170 15119 { … … 15272 15221 15273 15222 /* GUI auto generates controller names using bus type. Do the same*/ 15274 strFloppyName = i_controllerNameFromBusType(StorageBus_Floppy);15223 strFloppyName = StorageController::i_controllerNameFromBusType(StorageBus_Floppy); 15275 15224 15276 15225 /* Floppy recommended? add one. */ … … 15290 15239 if (FAILED(hrc)) return hrc; 15291 15240 15292 strDVDName = i_controllerNameFromBusType(dvdStorageBusType);15241 strDVDName = StorageController::i_controllerNameFromBusType(dvdStorageBusType); 15293 15242 15294 15243 hrc = addStorageController(strDVDName, dvdStorageBusType, dvdController); … … 15305 15254 if (FAILED(hrc)) return hrc; 15306 15255 15307 strHDName = i_controllerNameFromBusType(hdStorageBusType);15256 strHDName = StorageController::i_controllerNameFromBusType(hdStorageBusType); 15308 15257 15309 15258 if (hdStorageBusType != dvdStorageBusType && hdStorageControllerType != dvdStorageControllerType) -
TabularUnified trunk/src/VBox/Main/src-server/StorageControllerImpl.cpp ¶
r101035 r101220 806 806 } 807 807 808 /** 809 * Returns a controller name from a given storage bus type. 810 * 811 * @return Controller name. 812 * @param aBusType Bus type to get controller name for. 813 */ 814 /* static */ 815 com::Utf8Str StorageController::i_controllerNameFromBusType(StorageBus_T aBusType) 816 { 817 com::Utf8Str strControllerName = "Unknown"; 818 switch (aBusType) 819 { 820 case StorageBus_IDE: 821 { 822 strControllerName = "IDE"; 823 break; 824 } 825 case StorageBus_SATA: 826 { 827 strControllerName = "SATA"; 828 break; 829 } 830 case StorageBus_SCSI: 831 { 832 strControllerName = "SCSI"; 833 break; 834 } 835 case StorageBus_Floppy: 836 { 837 strControllerName = "Floppy"; 838 break; 839 } 840 case StorageBus_SAS: 841 { 842 strControllerName = "SAS"; 843 break; 844 } 845 case StorageBus_USB: 846 { 847 strControllerName = "USB"; 848 break; 849 } 850 case StorageBus_PCIe: 851 { 852 strControllerName = "PCIe"; 853 break; 854 } 855 case StorageBus_VirtioSCSI: 856 { 857 strControllerName = "VirtioSCSI"; 858 break; 859 } 860 default: 861 AssertFailed(); /* Catch missing case above. */ 862 break; 863 } 864 return strControllerName; 865 } 866 808 867 Machine* StorageController::i_getMachine() 809 868 { -
TabularUnified trunk/src/VBox/Main/src-server/UnattendedImpl.cpp ¶
r101204 r101220 3182 3182 if (strRecommendedControllerName.isEmpty()) 3183 3183 { 3184 switch (enmRecommendedStorageBus) 3185 { 3186 case StorageBus_IDE: strRecommendedControllerName = "IDE"; break; 3187 case StorageBus_SATA: strRecommendedControllerName = "SATA"; break; 3188 case StorageBus_SCSI: strRecommendedControllerName = "SCSI"; break; 3189 case StorageBus_SAS: strRecommendedControllerName = "SAS"; break; 3190 case StorageBus_USB: strRecommendedControllerName = "USB"; break; 3191 case StorageBus_PCIe: strRecommendedControllerName = "PCIe"; break; 3192 default: 3193 return setError(E_FAIL, tr("Support for recommended storage bus %d not implemented"), 3194 (int)enmRecommendedStorageBus); 3195 } 3184 strRecommendedControllerName = StorageController::i_controllerNameFromBusType(enmRecommendedStorageBus); 3185 3196 3186 ComPtr<IStorageController> ptrControllerIgnored; 3197 3187 hrc = rPtrSessionMachine->AddStorageController(Bstr(strRecommendedControllerName).raw(), enmRecommendedStorageBus,
Note:
See TracChangeset
for help on using the changeset viewer.