- Timestamp:
- Apr 25, 2019 3:52:38 PM (6 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp
r77887 r78296 281 281 282 282 CHECK_ERROR_BREAK(machine, SaveSettings()); 283 if (fRegister)284 {285 CHECK_ERROR_BREAK(a->virtualBox, RegisterMachine(machine));286 }287 283 if (fDefault) 288 284 { … … 291 287 CHECK_ERROR_BREAK(machine, SaveSettings()); 292 288 } 289 if (fRegister) 290 { 291 CHECK_ERROR_BREAK(a->virtualBox, RegisterMachine(machine)); 292 } 293 293 294 Bstr uuid; 294 295 CHECK_ERROR_BREAK(machine, COMGETTER(Id)(uuid.asOutParam())); -
trunk/src/VBox/Main/include/MachineImpl.h
r78261 r78296 721 721 722 722 Utf8Str i_getExtraData(const Utf8Str &strKey); 723 724 com::Utf8Str i_controllerNameFromBusType(StorageBus_T aBusType); 723 725 724 726 #ifdef VBOX_WITH_GUEST_PROPS -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r78277 r78296 15085 15085 } 15086 15086 15087 com::Utf8Str Machine::i_controllerNameFromBusType(StorageBus_T aBusType) 15088 { 15089 com::Utf8Str strControllerName = "Unknown"; 15090 switch (aBusType) 15091 { 15092 case StorageBus_IDE: 15093 { 15094 strControllerName = "IDE"; 15095 break; 15096 } 15097 case StorageBus_SATA: 15098 { 15099 strControllerName = "SATA"; 15100 break; 15101 } 15102 case StorageBus_SCSI: 15103 { 15104 strControllerName = "SCSI"; 15105 break; 15106 } 15107 case StorageBus_Floppy: 15108 { 15109 strControllerName = "Floppy"; 15110 break; 15111 } 15112 case StorageBus_SAS: 15113 { 15114 strControllerName = "SAS"; 15115 break; 15116 } 15117 case StorageBus_USB: 15118 { 15119 strControllerName = "USB"; 15120 break; 15121 } 15122 default: 15123 break; 15124 } 15125 return strControllerName; 15126 } 15127 15087 15128 HRESULT Machine::applyDefaults(const com::Utf8Str &aFlags) 15088 15129 { … … 15185 15226 rc = osType->COMGETTER(RecommendedAudioController)(&audioController); 15186 15227 if (FAILED(rc)) return rc; 15228 15187 15229 rc = mAudioAdapter->COMSETTER(AudioController)(audioController); 15188 15230 if (FAILED(rc)) return rc; … … 15191 15233 rc = osType->COMGETTER(RecommendedAudioCodec)(&audioCodec); 15192 15234 if (FAILED(rc)) return rc; 15235 15193 15236 rc = mAudioAdapter->COMSETTER(AudioCodec)(audioCodec); 15194 15237 if (FAILED(rc)) return rc; … … 15211 15254 Utf8Str strFloppyName, strDVDName, strHDName; 15212 15255 15213 /* GUI auto generates these - not accesible here - so hardware, at least for now. */ 15214 strFloppyName = Bstr("Floppy 1").raw(); 15215 strDVDName = Bstr("DVD 1").raw(); 15216 strHDName = Bstr("HDD 1").raw(); 15256 /* GUI auto generates controller names using bus type. Do the same*/ 15257 strFloppyName = i_controllerNameFromBusType(StorageBus_Floppy); 15217 15258 15218 15259 /* Floppy recommended? add one. */ … … 15234 15275 if (FAILED(rc)) return rc; 15235 15276 15277 strDVDName = i_controllerNameFromBusType(dvdStorageBusType); 15278 15236 15279 rc = addStorageController(strDVDName, 15237 15280 dvdStorageBusType, … … 15249 15292 if (FAILED(rc)) return rc; 15250 15293 15294 strHDName = i_controllerNameFromBusType(hdStorageBusType); 15295 15251 15296 if (hdStorageBusType != dvdStorageBusType && hdStorageControllerType != dvdStorageControllerType) 15252 15297 { … … 15263 15308 /* The HD controller is the same as DVD: */ 15264 15309 hdController = dvdController; 15265 strHDName = Bstr("DVD 1").raw();15266 15310 } 15267 15311
Note:
See TracChangeset
for help on using the changeset viewer.