Changeset 7457 in vbox
- Timestamp:
- Mar 14, 2008 12:17:16 PM (17 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/Makefile.kmk
r6968 r7457 26 26 $(if $(VBOX_WITH_ALSA),VBOX_WITH_ALSA,) \ 27 27 $(if $(VBOX_WITH_PULSE),VBOX_WITH_PULSE,) \ 28 $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000,) 28 $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000,) \ 29 $(if $(VBOX_WITH_AHCI),VBOX_WITH_AHCI,) 29 30 VBoxManage_SOURCES = \ 30 31 VBoxManage.cpp \ -
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r7442 r7457 400 400 RTPrintf(" [-usb on|off]\n" 401 401 " [-usbehci on|off]\n" 402 " [-snapshotfolder default|<path>]\n" 403 "\n"); 402 " [-snapshotfolder default|<path>]\n"); 403 #ifdef VBOX_WITH_AHCI 404 RTPrintf(" [-sata on|off]\n" 405 " [-sataport<1-30> none|<uuid>|<filename>]\n" 406 " [-sataideemulation hda|hdb|hdc|hdd <1-30>]\n"); 407 #endif 408 RTPrintf("\n"); 404 409 } 405 410 … … 1999 2004 RTPrintf("\n"); 2000 2005 2006 /* 2007 * SATA. 2008 */ 2009 ComPtr<ISATAController> SATACtl; 2010 rc = machine->COMGETTER(SATAController)(SATACtl.asOutParam()); 2011 if (SUCCEEDED(rc)) 2012 { 2013 BOOL fEnabled; 2014 rc = SATACtl->COMGETTER(Enabled)(&fEnabled); 2015 if (FAILED(rc)) 2016 fEnabled = false; 2017 if (details == VMINFO_MACHINEREADABLE) 2018 RTPrintf("sata=\"%s\"\n", fEnabled ? "on" : "off"); 2019 else 2020 RTPrintf("SATA: %s\n", fEnabled ? "enabled" : "disabled"); 2021 } 2022 2001 2023 if (console) 2002 2024 { … … 3680 3702 DeviceType_T bootDevice[4]; 3681 3703 int bootDeviceChanged[4] = { false }; 3682 char *hdds[ 4] = {0};3704 char *hdds[34] = {0}; 3683 3705 char *dvd = NULL; 3684 3706 char *dvdpassthrough = NULL; … … 3699 3721 ULONG guestMemBalloonSize = (ULONG)-1; 3700 3722 ULONG guestStatInterval = (ULONG)-1; 3723 int fSataEnabled = -1; 3724 int sataBootDevices[4] = {-1,-1,-1,-1}; 3701 3725 3702 3726 /* VM ID + at least one parameter. Parameter arguments are checked … … 4307 4331 return errorArgument("Error parsing guest statistics interval '%s'", argv[i]); 4308 4332 guestStatInterval = uVal; 4333 } 4334 else if (strcmp(argv[i], "-sata") == 0) 4335 { 4336 if (argc <= i + 1) 4337 { 4338 return errorArgument("Missing argument to '%s'", argv[i]); 4339 } 4340 i++; 4341 if (strcmp(argv[i], "on") == 0 || strcmp(argv[i], "enable") == 0) 4342 fSataEnabled = 1; 4343 else if (strcmp(argv[i], "off") == 0 || strcmp(argv[i], "disable") == 0) 4344 fSataEnabled = 0; 4345 else 4346 return errorArgument("Invalid -usb argument '%s'", argv[i]); 4347 } 4348 else if (strncmp(argv[i], "-sataport", 9) == 0) 4349 { 4350 unsigned n = parseNum(&argv[i][9], 30, "SATA"); 4351 if (!n) 4352 return 1; 4353 if (argc <= i + 1) 4354 { 4355 return errorArgument("Missing argument to '%s'", argv[i]); 4356 } 4357 i++; 4358 hdds[n+3] = argv[i]; 4359 } 4360 else if (strcmp(argv[i], "-sataideemulation") == 0) 4361 { 4362 unsigned bootDevicePos = 0; 4363 unsigned n; 4364 4365 if (argc <= i + 2) 4366 { 4367 return errorArgument("Missing arguments to '%s'", argv[i]); 4368 } 4369 i++; 4370 4371 if (strcmp(argv[i], "hda") == 0) 4372 bootDevicePos = 0; 4373 else if (strcmp(argv[i], "hdb") == 0) 4374 bootDevicePos = 1; 4375 else if (strcmp(argv[i], "hdc") == 0) 4376 bootDevicePos = 2; 4377 else if (strcmp(argv[i], "hdd") == 0) 4378 bootDevicePos = 3; 4379 else 4380 return errorArgument("Invalid argument to '%s'", argv[i-1]); 4381 4382 i++; 4383 n = parseNum(argv[i], 30, "SATA"); 4384 if (!n) 4385 return 1; 4386 4387 sataBootDevices[bootDevicePos] = n; 4309 4388 } 4310 4389 else … … 5274 5353 if (guestStatInterval != (ULONG)-1) 5275 5354 CHECK_ERROR(machine, COMSETTER(StatisticsUpdateInterval)(guestStatInterval)); 5355 5356 /* 5357 * SATA controller enable/disable 5358 */ 5359 if (fSataEnabled != -1) 5360 { 5361 ComPtr<ISATAController> SataCtl; 5362 CHECK_ERROR(machine, COMGETTER(SATAController)(SataCtl.asOutParam())); 5363 if (SUCCEEDED(rc)) 5364 { 5365 CHECK_ERROR(SataCtl, COMSETTER(Enabled)(!!fSataEnabled)); 5366 } 5367 } 5368 5369 for (uint32_t i = 4; i < 34; i++) 5370 { 5371 if (hdds[i]) 5372 { 5373 if (strcmp(hdds[i], "none") == 0) 5374 { 5375 machine->DetachHardDisk(StorageBus_SATA, i-4, 0); 5376 } 5377 else 5378 { 5379 /* first guess is that it's a UUID */ 5380 Guid uuid(hdds[i]); 5381 ComPtr<IHardDisk> hardDisk; 5382 rc = virtualBox->GetHardDisk(uuid, hardDisk.asOutParam()); 5383 /* not successful? Then it must be a filename */ 5384 if (!hardDisk) 5385 { 5386 CHECK_ERROR(virtualBox, OpenHardDisk(Bstr(hdds[i]), hardDisk.asOutParam())); 5387 if (SUCCEEDED(rc) && hardDisk) 5388 { 5389 /* first check if it's already registered */ 5390 Guid hddUUID; 5391 hardDisk->COMGETTER(Id)(hddUUID.asOutParam()); 5392 ComPtr<IHardDisk> registeredHDD; 5393 rc = virtualBox->GetHardDisk(hddUUID, registeredHDD.asOutParam()); 5394 if (SUCCEEDED(rc) && registeredHDD) 5395 hardDisk = registeredHDD; 5396 else 5397 { 5398 /* it has to be registered */ 5399 CHECK_ERROR(virtualBox, RegisterHardDisk(hardDisk)); 5400 if (FAILED(rc)) 5401 break; 5402 } 5403 } 5404 } 5405 if (hardDisk) 5406 { 5407 hardDisk->COMGETTER(Id)(uuid.asOutParam()); 5408 CHECK_ERROR(machine, AttachHardDisk(uuid, StorageBus_SATA, i-4, 0)); 5409 } 5410 else 5411 rc = E_FAIL; 5412 if (FAILED(rc)) 5413 break; 5414 } 5415 } 5416 } 5417 5418 for (uint32_t i = 0; i < 4; i++) 5419 { 5420 if (sataBootDevices[i] != -1) 5421 { 5422 ComPtr<ISATAController> SataCtl; 5423 CHECK_ERROR(machine, COMGETTER(SATAController)(SataCtl.asOutParam())); 5424 if (SUCCEEDED(rc)) 5425 { 5426 CHECK_ERROR(SataCtl, SetIDEEmulationPort(i, sataBootDevices[i])); 5427 } 5428 } 5429 } 5276 5430 5277 5431 /* commit changes */ -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r7442 r7457 606 606 rc = CFGMR3InsertNode(pDevices, "ahci", &pDev); RC_CHECK(); 607 607 rc = CFGMR3InsertNode(pDev, "0", &pSataInst); RC_CHECK(); 608 rc = CFGMR3InsertInteger(p IdeInst, "Trusted", 1);RC_CHECK();609 rc = CFGMR3InsertInteger(p IdeInst, "PCIDeviceNo", 13);RC_CHECK();608 rc = CFGMR3InsertInteger(pSataInst, "Trusted", 1); RC_CHECK(); 609 rc = CFGMR3InsertInteger(pSataInst, "PCIDeviceNo", 13); RC_CHECK(); 610 610 Assert(!afPciDeviceNo[13]); 611 611 afPciDeviceNo[13] = true; 612 rc = CFGMR3InsertInteger(p IdeInst, "PCIFunctionNo", 1);RC_CHECK();613 rc = CFGMR3InsertNode(p IdeInst, "Config", &pCfg);RC_CHECK();612 rc = CFGMR3InsertInteger(pSataInst, "PCIFunctionNo", 0); RC_CHECK(); 613 rc = CFGMR3InsertNode(pSataInst, "Config", &pCfg); RC_CHECK(); 614 614 615 615 for (uint32_t i = 0; i < 4; i++) -
trunk/src/VBox/Main/SATAControllerImpl.cpp
r7442 r7457 223 223 CheckComRCReturnRC (autoCaller.rc()); 224 224 225 /* the machine needs to be mutable */226 Machine::AutoMutableStateDependency adep (mParent);227 CheckComRCReturnRC (adep.rc());228 AutoLock alock (this);229 230 225 switch (DevicePosition) 231 226 {
Note:
See TracChangeset
for help on using the changeset viewer.