Changeset 7556 in vbox
- Timestamp:
- Mar 25, 2008 4:05:17 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 29037
- Location:
- trunk/src/VBox
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r7525 r7556 412 412 #ifdef VBOX_WITH_AHCI 413 413 RTPrintf(" [-sata on|off]\n" 414 " [-sataportcount <1-30>]\n" 414 415 " [-sataport<1-30> none|<uuid>|<filename>]\n" 415 416 " [-sataideemulation hda|hdb|hdc|hdd <1-30>]\n"); … … 3737 3738 ULONG guestStatInterval = (ULONG)-1; 3738 3739 int fSataEnabled = -1; 3740 int sataPortCount = -1; 3739 3741 int sataBootDevices[4] = {-1,-1,-1,-1}; 3740 3742 … … 4360 4362 else 4361 4363 return errorArgument("Invalid -usb argument '%s'", argv[i]); 4364 } 4365 else if (strcmp(argv[i], "-sataportcount") == 0) 4366 { 4367 unsigned n; 4368 4369 if (argc <= i + 1) 4370 { 4371 return errorArgument("Missing arguments to '%s'", argv[i]); 4372 } 4373 i++; 4374 4375 n = parseNum(argv[i], 30, "SATA"); 4376 if (!n) 4377 return 1; 4378 sataPortCount = n; 4362 4379 } 4363 4380 else if (strncmp(argv[i], "-sataport", 9) == 0) … … 5452 5469 } 5453 5470 5471 if (sataPortCount != -1) 5472 { 5473 ComPtr<ISATAController> SataCtl; 5474 CHECK_ERROR(machine, COMGETTER(SATAController)(SataCtl.asOutParam())); 5475 if (SUCCEEDED(rc)) 5476 { 5477 CHECK_ERROR(SataCtl, COMSETTER(PortCount)(sataPortCount)); 5478 } 5479 } 5480 5454 5481 /* commit changes */ 5455 5482 CHECK_ERROR(machine, SaveSettings()); -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r7525 r7556 225 225 PCFGMNODE pIdeInst = NULL; /* /Devices/piix3ide/0/ */ 226 226 PCFGMNODE pSataInst = NULL; /* /Devices/ahci/0/ */ 227 PCFGMNODE pBiosCfg = NULL; /* /Devices/pcbios/0/Config/ */ 227 228 228 229 rc = CFGMR3InsertNode(pRoot, "Devices", &pDevices); RC_CHECK(); … … 242 243 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK(); 243 244 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK(); 244 rc = CFGMR3InsertNode(pInst, "Config", &p Cfg);RC_CHECK();245 rc = CFGMR3InsertInteger(p Cfg, "RamSize", cRamMBs * _1M);RC_CHECK();246 rc = CFGMR3InsertString(p Cfg, "HardDiskDevice", "piix3ide");RC_CHECK();247 rc = CFGMR3InsertString(p Cfg, "FloppyDevice", "i82078");RC_CHECK();248 rc = CFGMR3InsertInteger(p Cfg, "IOAPIC", fIOAPIC);RC_CHECK();249 rc = CFGMR3InsertInteger(p Cfg, "PXEDebug", fPXEDebug);RC_CHECK();250 rc = CFGMR3InsertBytes(p Cfg, "UUID", pUuid, sizeof(*pUuid));RC_CHECK();245 rc = CFGMR3InsertNode(pInst, "Config", &pBiosCfg); RC_CHECK(); 246 rc = CFGMR3InsertInteger(pBiosCfg, "RamSize", cRamMBs * _1M); RC_CHECK(); 247 rc = CFGMR3InsertString(pBiosCfg, "HardDiskDevice", "piix3ide"); RC_CHECK(); 248 rc = CFGMR3InsertString(pBiosCfg, "FloppyDevice", "i82078"); RC_CHECK(); 249 rc = CFGMR3InsertInteger(pBiosCfg, "IOAPIC", fIOAPIC); RC_CHECK(); 250 rc = CFGMR3InsertInteger(pBiosCfg, "PXEDebug", fPXEDebug); RC_CHECK(); 251 rc = CFGMR3InsertBytes(pBiosCfg, "UUID", pUuid, sizeof(*pUuid)); RC_CHECK(); 251 252 252 253 DeviceType_T bootDevice; … … 287 288 return VERR_INVALID_PARAMETER; 288 289 } 289 rc = CFGMR3InsertString(p Cfg, szParamName, pszBootDevice);RC_CHECK();290 rc = CFGMR3InsertString(pBiosCfg, szParamName, pszBootDevice); RC_CHECK(); 290 291 } 291 292 … … 295 296 BOOL fFadeIn; 296 297 hrc = biosSettings->COMGETTER(LogoFadeIn)(&fFadeIn); H(); 297 rc = CFGMR3InsertInteger(p Cfg, "FadeIn", fFadeIn ? 1 : 0);RC_CHECK();298 rc = CFGMR3InsertInteger(pBiosCfg, "FadeIn", fFadeIn ? 1 : 0); RC_CHECK(); 298 299 BOOL fFadeOut; 299 300 hrc = biosSettings->COMGETTER(LogoFadeOut)(&fFadeOut); H(); 300 rc = CFGMR3InsertInteger(p Cfg, "FadeOut", fFadeOut ? 1: 0);RC_CHECK();301 rc = CFGMR3InsertInteger(pBiosCfg, "FadeOut", fFadeOut ? 1: 0); RC_CHECK(); 301 302 ULONG logoDisplayTime; 302 303 hrc = biosSettings->COMGETTER(LogoDisplayTime)(&logoDisplayTime); H(); 303 rc = CFGMR3InsertInteger(p Cfg, "LogoTime", logoDisplayTime);RC_CHECK();304 rc = CFGMR3InsertInteger(pBiosCfg, "LogoTime", logoDisplayTime); RC_CHECK(); 304 305 Bstr logoImagePath; 305 306 hrc = biosSettings->COMGETTER(LogoImagePath)(logoImagePath.asOutParam()); H(); 306 rc = CFGMR3InsertString(p Cfg, "LogoFile", logoImagePath ? Utf8Str(logoImagePath) : ""); RC_CHECK();307 rc = CFGMR3InsertString(pBiosCfg, "LogoFile", logoImagePath ? Utf8Str(logoImagePath) : ""); RC_CHECK(); 307 308 308 309 /* … … 323 324 value = 2; 324 325 } 325 rc = CFGMR3InsertInteger(p Cfg, "ShowBootMenu", value);RC_CHECK();326 rc = CFGMR3InsertInteger(pBiosCfg, "ShowBootMenu", value); RC_CHECK(); 326 327 327 328 /* … … 604 605 if (enabled) 605 606 { 607 ULONG nrPorts = 0; 608 606 609 rc = CFGMR3InsertNode(pDevices, "ahci", &pDev); RC_CHECK(); 607 610 rc = CFGMR3InsertNode(pDev, "0", &pSataInst); RC_CHECK(); … … 613 616 rc = CFGMR3InsertNode(pSataInst, "Config", &pCfg); RC_CHECK(); 614 617 618 hrc = sataController->COMGETTER(PortCount)(&nrPorts); H(); 619 rc = CFGMR3InsertInteger(pCfg, "PortCount", nrPorts); RC_CHECK(); 620 621 /* Needed configuration values for the bios. */ 622 rc = CFGMR3InsertString(pBiosCfg, "SataHardDiskDevice", "ahci"); RC_CHECK(); 623 615 624 for (uint32_t i = 0; i < 4; i++) 616 625 { 617 626 const char *g_apszConfig[] = 618 627 { "PrimaryMaster", "PrimarySlave", "SecondaryMaster", "SecondarySlave" }; 628 const char *g_apszBiosConfig[] = 629 { "SataPrimaryMasterLUN", "SataPrimarySlaveLUN", "SataSecondaryMasterLUN", "SataSecondarySlaveLUN" }; 619 630 LONG aPortNumber; 620 631 621 632 hrc = sataController->GetIDEEmulationPort(i, &aPortNumber); H(); 622 633 rc = CFGMR3InsertInteger(pCfg, g_apszConfig[i], aPortNumber); RC_CHECK(); 623 } 634 rc = CFGMR3InsertInteger(pBiosCfg, g_apszBiosConfig[i], aPortNumber); RC_CHECK(); 635 } 636 624 637 } 625 638 } -
trunk/src/VBox/Main/SATAControllerImpl.cpp
r7457 r7556 212 212 } 213 213 214 // ISATAController methods 215 ///////////////////////////////////////////////////////////////////////////// 216 217 STDMETHODIMP SATAController::GetIDEEmulationPort(LONG DevicePosition, LONG *aPortNumber) 218 { 219 if (!aPortNumber) 214 STDMETHODIMP SATAController::COMGETTER(PortCount) (ULONG *aPortCount) 215 { 216 if (!aPortCount) 220 217 return E_POINTER; 221 218 … … 223 220 CheckComRCReturnRC (autoCaller.rc()); 224 221 225 switch (DevicePosition) 226 { 227 case 0: 228 *aPortNumber = mData->mPortIde0Master; 229 break; 230 case 1: 231 *aPortNumber = mData->mPortIde0Slave; 232 break; 233 case 2: 234 *aPortNumber = mData->mPortIde1Master; 235 break; 236 case 3: 237 *aPortNumber = mData->mPortIde1Slave; 238 break; 239 default: 240 return E_INVALIDARG; 241 } 242 243 return S_OK; 244 } 245 246 STDMETHODIMP SATAController::SetIDEEmulationPort(LONG DevicePosition, LONG aPortNumber) 247 { 222 AutoReaderLock alock (this); 223 224 *aPortCount = mData->mPortCount; 225 226 return S_OK; 227 } 228 229 230 STDMETHODIMP SATAController::COMSETTER(PortCount) (ULONG aPortCount) 231 { 232 LogFlowThisFunc (("aPortCount=%u\n", aPortCount)); 233 248 234 AutoCaller autoCaller (this); 249 235 CheckComRCReturnRC (autoCaller.rc()); … … 252 238 Machine::AutoMutableStateDependency adep (mParent); 253 239 CheckComRCReturnRC (adep.rc()); 240 241 AutoLock alock (this); 242 243 if (mData->mPortCount != aPortCount) 244 { 245 mData.backup(); 246 mData->mPortCount = aPortCount; 247 248 /* leave the lock for safety */ 249 alock.leave(); 250 251 mParent->onSATAControllerChange(); 252 } 253 254 return S_OK; 255 } 256 257 // ISATAController methods 258 ///////////////////////////////////////////////////////////////////////////// 259 260 STDMETHODIMP SATAController::GetIDEEmulationPort(LONG DevicePosition, LONG *aPortNumber) 261 { 262 if (!aPortNumber) 263 return E_POINTER; 264 265 AutoCaller autoCaller (this); 266 CheckComRCReturnRC (autoCaller.rc()); 267 268 switch (DevicePosition) 269 { 270 case 0: 271 *aPortNumber = mData->mPortIde0Master; 272 break; 273 case 1: 274 *aPortNumber = mData->mPortIde0Slave; 275 break; 276 case 2: 277 *aPortNumber = mData->mPortIde1Master; 278 break; 279 case 3: 280 *aPortNumber = mData->mPortIde1Slave; 281 break; 282 default: 283 return E_INVALIDARG; 284 } 285 286 return S_OK; 287 } 288 289 STDMETHODIMP SATAController::SetIDEEmulationPort(LONG DevicePosition, LONG aPortNumber) 290 { 291 AutoCaller autoCaller (this); 292 CheckComRCReturnRC (autoCaller.rc()); 293 294 /* the machine needs to be mutable */ 295 Machine::AutoMutableStateDependency adep (mParent); 296 CheckComRCReturnRC (adep.rc()); 254 297 AutoLock alock (this); 255 298 … … 274 317 return S_OK; 275 318 } 276 277 319 278 320 // public methods only for internal purposes … … 304 346 mData->mEnabled = controller.value <bool> ("enabled"); 305 347 348 /* number of useable ports */ 349 mData->mPortCount = controller.valueOr <ULONG> ("PortCount", 30); 350 306 351 /* ide emulation settings (optional, default to 0,1,2,3 respectively) */ 307 352 mData->mPortIde0Master = controller.value <ULONG> ("IDE0MasterEmulationPort"); … … 340 385 /* enabled */ 341 386 controller.setValue <bool> ("enabled", !!mData->mEnabled); 387 388 /* number of useable ports */ 389 controller.setValue <ULONG> ("PortCount", mData->mPortCount); 342 390 343 391 /* ide emulation settings */ -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r7525 r7556 9775 9775 </attribute> 9776 9776 9777 <attribute name="portCount" type="unsigned long"> 9778 <desc> 9779 The number of usable ports on the sata controller. 9780 It ranges from 1 to 30. 9781 </desc> 9782 </attribute> 9783 9777 9784 <method name="GetIDEEmulationPort"> 9778 9785 <desc>Gets the corresponding port number which is emulated as an IDE device.</desc> -
trunk/src/VBox/Main/include/SATAControllerImpl.h
r7442 r7556 39 39 /* Constructor. */ 40 40 Data() : mEnabled (FALSE), 41 mPortCount (30), 41 42 mPortIde0Master (0), 42 43 mPortIde0Slave (1), … … 47 48 { 48 49 return this == &that || ((mEnabled == that.mEnabled) && 50 (mPortCount == mPortCount) && 49 51 (mPortIde0Master == that.mPortIde0Master) && 50 52 (mPortIde0Slave == that.mPortIde0Slave) && … … 55 57 /** Enabled indicator. */ 56 58 BOOL mEnabled; 59 /** Number of usable ports. */ 60 ULONG mPortCount; 57 61 /** Port which acts as primary master for ide emulation. */ 58 62 ULONG mPortIde0Master; … … 94 98 STDMETHOD(COMGETTER(Enabled)) (BOOL *aEnabled); 95 99 STDMETHOD(COMSETTER(Enabled)) (BOOL aEnabled); 100 STDMETHOD(COMGETTER(PortCount)) (ULONG *aPortCount); 101 STDMETHOD(COMSETTER(PortCount)) (ULONG aPortCount); 96 102 97 103 // ISATAController methods -
trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd
r7466 r7556 650 650 <xsd:complexType name="TSATAController"> 651 651 <xsd:attribute name="enabled" type="xsd:boolean" use="required"/> 652 <xsd:attribute name="IDE0MasterEmulationPort" type="xsd:unsignedInt" default="0"/> 653 <xsd:attribute name="IDE0SlaveEmulationPort" type="xsd:unsignedInt" default="1"/> 654 <xsd:attribute name="IDE1MasterEmulationPort" type="xsd:unsignedInt" default="2"/> 655 <xsd:attribute name="IDE1SlaveEmulationPort" type="xsd:unsignedInt" default="3"/> 652 <xsd:attribute name="IDE0MasterEmulationPort" type="xsd:unsignedInt" default="0"/> 653 <xsd:attribute name="IDE0SlaveEmulationPort" type="xsd:unsignedInt" default="1"/> 654 <xsd:attribute name="IDE1MasterEmulationPort" type="xsd:unsignedInt" default="2"/> 655 <xsd:attribute name="IDE1SlaveEmulationPort" type="xsd:unsignedInt" default="3"/> 656 <xsd:attribute name="PortCount" type="xsd:unsignedInt" default="30"/> 656 657 </xsd:complexType> 657 658
Note:
See TracChangeset
for help on using the changeset viewer.