Changeset 29324 in vbox
- Timestamp:
- May 11, 2010 10:06:23 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl2.cpp
r29292 r29324 303 303 Bstr bstr; 304 304 305 #define RC_CHECK() do { if (RT_FAILURE(rc)) { AssertMsgFailed(("rc=%Rrc\n", rc)); return rc; } } while (0)306 #define H() do { if (FAILED(hrc)) { AssertMsgFailed(("hrc=%Rhrc\n", hrc)); return VERR_GENERAL_FAILURE; } } while (0)305 #define RC_CHECK() AssertMsgReturn(RT_SUCCESS(rc), ("rc=%Rrc\n", rc), rc) 306 #define H() AssertMsgReturn(!FAILED(hrc), ("hrc=%Rhrc\n", hrc), VERR_GENERAL_FAILURE) 307 307 308 308 /* … … 310 310 */ 311 311 ComPtr<IVirtualBox> virtualBox; 312 hrc = pMachine->COMGETTER(Parent)(virtualBox.asOutParam()); H();312 hrc = pMachine->COMGETTER(Parent)(virtualBox.asOutParam()); H(); 313 313 314 314 ComPtr<IHost> host; 315 hrc = virtualBox->COMGETTER(Host)(host.asOutParam()); H();315 hrc = virtualBox->COMGETTER(Host)(host.asOutParam()); H(); 316 316 317 317 ComPtr<ISystemProperties> systemProperties; 318 hrc = virtualBox->COMGETTER(SystemProperties)(systemProperties.asOutParam()); H();318 hrc = virtualBox->COMGETTER(SystemProperties)(systemProperties.asOutParam()); H(); 319 319 320 320 ComPtr<IBIOSSettings> biosSettings; 321 hrc = pMachine->COMGETTER(BIOSSettings)(biosSettings.asOutParam()); H();322 323 hrc = pMachine->COMGETTER(HardwareUUID)(bstr.asOutParam()); 321 hrc = pMachine->COMGETTER(BIOSSettings)(biosSettings.asOutParam()); H(); 322 323 hrc = pMachine->COMGETTER(HardwareUUID)(bstr.asOutParam()); H(); 324 324 RTUUID HardwareUuid; 325 rc = RTUuidFromUtf16(&HardwareUuid, bstr.raw()); 325 rc = RTUuidFromUtf16(&HardwareUuid, bstr.raw()); RC_CHECK(); 326 326 327 327 ULONG cRamMBs; 328 hrc = pMachine->COMGETTER(MemorySize)(&cRamMBs); H();328 hrc = pMachine->COMGETTER(MemorySize)(&cRamMBs); H(); 329 329 #if 0 /* enable to play with lots of memory. */ 330 330 if (RTEnvExist("VBOX_RAM_SIZE")) … … 335 335 336 336 ULONG cCpus = 1; 337 hrc = pMachine->COMGETTER(CPUCount)(&cCpus); H();337 hrc = pMachine->COMGETTER(CPUCount)(&cCpus); H(); 338 338 339 339 Bstr osTypeId; 340 hrc = pMachine->COMGETTER(OSTypeId)(osTypeId.asOutParam()); H();340 hrc = pMachine->COMGETTER(OSTypeId)(osTypeId.asOutParam()); H(); 341 341 342 342 BOOL fIOAPIC; 343 hrc = biosSettings->COMGETTER(IOAPICEnabled)(&fIOAPIC); H();343 hrc = biosSettings->COMGETTER(IOAPICEnabled)(&fIOAPIC); H(); 344 344 345 345 ComPtr<IGuestOSType> guestOSType; 346 hrc = virtualBox->GetGuestOSType(osTypeId, guestOSType.asOutParam()); H();346 hrc = virtualBox->GetGuestOSType(osTypeId, guestOSType.asOutParam()); H(); 347 347 348 348 Bstr guestTypeFamilyId; 349 hrc = guestOSType->COMGETTER(FamilyId)(guestTypeFamilyId.asOutParam()); H();349 hrc = guestOSType->COMGETTER(FamilyId)(guestTypeFamilyId.asOutParam()); H(); 350 350 BOOL fOsXGuest = guestTypeFamilyId == Bstr("MacOS"); 351 351 … … 360 360 * Set the root (and VMM) level values. 361 361 */ 362 hrc = pMachine->COMGETTER(Name)(bstr.asOutParam()); H();363 rc = CFGMR3InsertStringW(pRoot, "Name", bstr.raw()); RC_CHECK();364 rc = CFGMR3InsertBytes(pRoot, "UUID", &HardwareUuid, sizeof(HardwareUuid)); RC_CHECK();365 rc = CFGMR3InsertInteger(pRoot, "RamSize", cbRam); RC_CHECK();366 rc = CFGMR3InsertInteger(pRoot, "RamHoleSize", cbRamHole); RC_CHECK();367 rc = CFGMR3InsertInteger(pRoot, "NumCPUs", cCpus); RC_CHECK();368 rc = CFGMR3InsertInteger(pRoot, "TimerMillies", 10); RC_CHECK();362 hrc = pMachine->COMGETTER(Name)(bstr.asOutParam()); H(); 363 rc = CFGMR3InsertStringW(pRoot, "Name", bstr.raw()); RC_CHECK(); 364 rc = CFGMR3InsertBytes(pRoot, "UUID", &HardwareUuid, sizeof(HardwareUuid)); RC_CHECK(); 365 rc = CFGMR3InsertInteger(pRoot, "RamSize", cbRam); RC_CHECK(); 366 rc = CFGMR3InsertInteger(pRoot, "RamHoleSize", cbRamHole); RC_CHECK(); 367 rc = CFGMR3InsertInteger(pRoot, "NumCPUs", cCpus); RC_CHECK(); 368 rc = CFGMR3InsertInteger(pRoot, "TimerMillies", 10); RC_CHECK(); 369 369 #ifdef VBOX_WITH_RAW_MODE 370 rc = CFGMR3InsertInteger(pRoot, "RawR3Enabled", 1); /* boolean */ RC_CHECK();371 rc = CFGMR3InsertInteger(pRoot, "RawR0Enabled", 1); /* boolean */ RC_CHECK();370 rc = CFGMR3InsertInteger(pRoot, "RawR3Enabled", 1); /* boolean */ RC_CHECK(); 371 rc = CFGMR3InsertInteger(pRoot, "RawR0Enabled", 1); /* boolean */ RC_CHECK(); 372 372 /** @todo Config: RawR0, PATMEnabled and CSAMEnabled needs attention later. */ 373 rc = CFGMR3InsertInteger(pRoot, "PATMEnabled", 1); /* boolean */ RC_CHECK();374 rc = CFGMR3InsertInteger(pRoot, "CSAMEnabled", 1); /* boolean */ RC_CHECK();373 rc = CFGMR3InsertInteger(pRoot, "PATMEnabled", 1); /* boolean */ RC_CHECK(); 374 rc = CFGMR3InsertInteger(pRoot, "CSAMEnabled", 1); /* boolean */ RC_CHECK(); 375 375 #endif 376 376 … … 407 407 LogRel(("Limiting CPUID leaf count for NT4 guests\n")); 408 408 PCFGMNODE pCPUM; 409 rc = CFGMR3InsertNode(pRoot, "CPUM", &pCPUM); RC_CHECK();410 rc = CFGMR3InsertInteger(pCPUM, "NT4LeafLimit", true); RC_CHECK();409 rc = CFGMR3InsertNode(pRoot, "CPUM", &pCPUM); RC_CHECK(); 410 rc = CFGMR3InsertInteger(pCPUM, "NT4LeafLimit", true); RC_CHECK(); 411 411 } 412 412 … … 418 418 LogRel(("Using MWAIT extensions\n")); 419 419 PCFGMNODE pCPUM; 420 rc = CFGMR3InsertNode(pRoot, "CPUM", &pCPUM); RC_CHECK();421 rc = CFGMR3InsertInteger(pCPUM, "MWaitExtensions", true); RC_CHECK();420 rc = CFGMR3InsertNode(pRoot, "CPUM", &pCPUM); RC_CHECK(); 421 rc = CFGMR3InsertInteger(pCPUM, "MWaitExtensions", true); RC_CHECK(); 422 422 } 423 423 … … 442 442 fHWVirtExEnabled = fHwVirtExtForced = TRUE; 443 443 #endif /* !VBOX_WITH_RAW_MODE */ 444 rc = CFGMR3InsertInteger(pRoot, "HwVirtExtForced", fHwVirtExtForced); RC_CHECK();444 rc = CFGMR3InsertInteger(pRoot, "HwVirtExtForced", fHwVirtExtForced); RC_CHECK(); 445 445 446 446 PCFGMNODE pHWVirtExt; 447 rc = CFGMR3InsertNode(pRoot, "HWVirtExt", &pHWVirtExt); RC_CHECK();447 rc = CFGMR3InsertNode(pRoot, "HWVirtExt", &pHWVirtExt); RC_CHECK(); 448 448 if (fHWVirtExEnabled) 449 449 { 450 rc = CFGMR3InsertInteger(pHWVirtExt, "Enabled", 1); RC_CHECK();450 rc = CFGMR3InsertInteger(pHWVirtExt, "Enabled", 1); RC_CHECK(); 451 451 452 452 /* Indicate whether 64-bit guests are supported or not. */ … … 456 456 BOOL fSupportsLongMode = false; 457 457 hrc = host->GetProcessorFeature(ProcessorFeature_LongMode, 458 &fSupportsLongMode); H();459 hrc = guestOSType->COMGETTER(Is64Bit)(&fIs64BitGuest); H();458 &fSupportsLongMode); H(); 459 hrc = guestOSType->COMGETTER(Is64Bit)(&fIs64BitGuest); H(); 460 460 461 461 if (fSupportsLongMode && fIs64BitGuest) 462 462 { 463 rc = CFGMR3InsertInteger(pHWVirtExt, "64bitEnabled", 1); RC_CHECK();463 rc = CFGMR3InsertInteger(pHWVirtExt, "64bitEnabled", 1); RC_CHECK(); 464 464 #if ARCH_BITS == 32 /* The recompiler must use VBoxREM64 (32-bit host only). */ 465 465 PCFGMNODE pREM; 466 rc = CFGMR3InsertNode(pRoot, "REM", &pREM); RC_CHECK();467 rc = CFGMR3InsertInteger(pREM, "64bitEnabled", 1); RC_CHECK();466 rc = CFGMR3InsertNode(pRoot, "REM", &pREM); RC_CHECK(); 467 rc = CFGMR3InsertInteger(pREM, "64bitEnabled", 1); RC_CHECK(); 468 468 #endif 469 469 } … … 471 471 else 472 472 { 473 rc = CFGMR3InsertInteger(pHWVirtExt, "64bitEnabled", 0); RC_CHECK();473 rc = CFGMR3InsertInteger(pHWVirtExt, "64bitEnabled", 0); RC_CHECK(); 474 474 } 475 475 #endif … … 486 486 * We may want to consider adding more guest OSes (Solaris) later on. 487 487 */ 488 rc = CFGMR3InsertInteger(pHWVirtExt, "TPRPatchingEnabled", 1); RC_CHECK();488 rc = CFGMR3InsertInteger(pHWVirtExt, "TPRPatchingEnabled", 1); RC_CHECK(); 489 489 } 490 490 } … … 493 493 BOOL fHWVirtExExclusive = true; 494 494 hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_Exclusive, &fHWVirtExExclusive); H(); 495 rc = CFGMR3InsertInteger(pHWVirtExt, "Exclusive", fHWVirtExExclusive); RC_CHECK();495 rc = CFGMR3InsertInteger(pHWVirtExt, "Exclusive", fHWVirtExExclusive); RC_CHECK(); 496 496 497 497 /* Nested paging (VT-x/AMD-V) */ 498 498 BOOL fEnableNestedPaging = false; 499 499 hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_NestedPaging, &fEnableNestedPaging); H(); 500 rc = CFGMR3InsertInteger(pHWVirtExt, "EnableNestedPaging", fEnableNestedPaging); RC_CHECK();500 rc = CFGMR3InsertInteger(pHWVirtExt, "EnableNestedPaging", fEnableNestedPaging); RC_CHECK(); 501 501 502 502 /* Large pages; requires nested paging */ 503 503 BOOL fEnableLargePages = false; 504 504 hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_LargePages, &fEnableLargePages); H(); 505 rc = CFGMR3InsertInteger(pHWVirtExt, "EnableLargePages", fEnableLargePages); RC_CHECK();505 rc = CFGMR3InsertInteger(pHWVirtExt, "EnableLargePages", fEnableLargePages); RC_CHECK(); 506 506 507 507 /* VPID (VT-x) */ 508 508 BOOL fEnableVPID = false; 509 hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_VPID, &fEnableVPID); H();510 rc = CFGMR3InsertInteger(pHWVirtExt, "EnableVPID", fEnableVPID); RC_CHECK();509 hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_VPID, &fEnableVPID); H(); 510 rc = CFGMR3InsertInteger(pHWVirtExt, "EnableVPID", fEnableVPID); RC_CHECK(); 511 511 512 512 /* Physical Address Extension (PAE) */ 513 513 BOOL fEnablePAE = false; 514 hrc = pMachine->GetCPUProperty(CPUPropertyType_PAE, &fEnablePAE); H();515 rc = CFGMR3InsertInteger(pRoot, "EnablePAE", fEnablePAE); RC_CHECK();514 hrc = pMachine->GetCPUProperty(CPUPropertyType_PAE, &fEnablePAE); H(); 515 rc = CFGMR3InsertInteger(pRoot, "EnablePAE", fEnablePAE); RC_CHECK(); 516 516 517 517 /* Synthetic CPU */ 518 518 BOOL fSyntheticCpu = false; 519 hrc = pMachine->GetCPUProperty(CPUPropertyType_Synthetic, &fSyntheticCpu); H();520 rc = CFGMR3InsertInteger(pRoot, "SyntheticCpu", fSyntheticCpu); RC_CHECK();519 hrc = pMachine->GetCPUProperty(CPUPropertyType_Synthetic, &fSyntheticCpu); H(); 520 rc = CFGMR3InsertInteger(pRoot, "SyntheticCpu", fSyntheticCpu); RC_CHECK(); 521 521 522 522 BOOL fPXEDebug; 523 hrc = biosSettings->COMGETTER(PXEDebugEnabled)(&fPXEDebug); H();523 hrc = biosSettings->COMGETTER(PXEDebugEnabled)(&fPXEDebug); H(); 524 524 525 525 /* … … 530 530 PCFGMNODE pDrivers; 531 531 PCFGMNODE pMod; 532 rc = CFGMR3InsertNode(pRoot, "PDM", &pPDM); RC_CHECK();533 rc = CFGMR3InsertNode(pPDM, "Drivers", &pDrivers); RC_CHECK();534 rc = CFGMR3InsertNode(pDrivers, "VBoxC", &pMod); RC_CHECK();532 rc = CFGMR3InsertNode(pRoot, "PDM", &pPDM); RC_CHECK(); 533 rc = CFGMR3InsertNode(pPDM, "Drivers", &pDrivers); RC_CHECK(); 534 rc = CFGMR3InsertNode(pDrivers, "VBoxC", &pMod); RC_CHECK(); 535 535 #ifdef VBOX_WITH_XPCOM 536 536 // VBoxC is located in the components subdirectory 537 537 char szPathVBoxC[RTPATH_MAX]; 538 rc = RTPathAppPrivateArch(szPathVBoxC, RTPATH_MAX - sizeof("/components/VBoxC")); AssertRC(rc);538 rc = RTPathAppPrivateArch(szPathVBoxC, RTPATH_MAX - sizeof("/components/VBoxC")); AssertRC(rc); 539 539 strcat(szPathVBoxC, "/components/VBoxC"); 540 rc = CFGMR3InsertString(pMod, "Path", szPathVBoxC); RC_CHECK();540 rc = CFGMR3InsertString(pMod, "Path", szPathVBoxC); RC_CHECK(); 541 541 #else 542 rc = CFGMR3InsertString(pMod, "Path", "VBoxC"); RC_CHECK();542 rc = CFGMR3InsertString(pMod, "Path", "VBoxC"); RC_CHECK(); 543 543 #endif 544 544 … … 548 548 PCFGMNODE pPDMAc; 549 549 PCFGMNODE pPDMAcFile; 550 rc = CFGMR3InsertNode(pPDM, "AsyncCompletion", &pPDMAc); RC_CHECK();551 rc = CFGMR3InsertNode(pPDMAc, "File", &pPDMAcFile); RC_CHECK();550 rc = CFGMR3InsertNode(pPDM, "AsyncCompletion", &pPDMAc); RC_CHECK(); 551 rc = CFGMR3InsertNode(pPDMAc, "File", &pPDMAcFile); RC_CHECK(); 552 552 553 553 /* Builtin I/O cache */ 554 554 BOOL fIoCache = true; 555 hrc = pMachine->COMGETTER(IoCacheEnabled)(&fIoCache); H();556 rc = CFGMR3InsertInteger(pPDMAcFile, "CacheEnabled", fIoCache); RC_CHECK();555 hrc = pMachine->COMGETTER(IoCacheEnabled)(&fIoCache); H(); 556 rc = CFGMR3InsertInteger(pPDMAcFile, "CacheEnabled", fIoCache); RC_CHECK(); 557 557 558 558 /* I/O cache size */ 559 559 ULONG ioCacheSize = 5; 560 hrc = pMachine->COMGETTER(IoCacheSize)(&ioCacheSize); H();561 rc = CFGMR3InsertInteger(pPDMAcFile, "CacheSize", ioCacheSize * _1M); RC_CHECK();560 hrc = pMachine->COMGETTER(IoCacheSize)(&ioCacheSize); H(); 561 rc = CFGMR3InsertInteger(pPDMAcFile, "CacheSize", ioCacheSize * _1M); RC_CHECK(); 562 562 563 563 /* Maximum I/O bandwidth */ 564 564 ULONG ioBandwidthMax = 0; 565 hrc = pMachine->COMGETTER(IoBandwidthMax)(&ioBandwidthMax); H();565 hrc = pMachine->COMGETTER(IoBandwidthMax)(&ioBandwidthMax); H(); 566 566 if (ioBandwidthMax != 0) 567 567 { … … 582 582 PCFGMNODE pNetBootCfg = NULL; /* /Devices/pcbios/0/Config/NetBoot/ */ 583 583 584 rc = CFGMR3InsertNode(pRoot, "Devices", &pDevices); RC_CHECK();584 rc = CFGMR3InsertNode(pRoot, "Devices", &pDevices); RC_CHECK(); 585 585 586 586 /* 587 587 * PC Arch. 588 588 */ 589 rc = CFGMR3InsertNode(pDevices, "pcarch", &pDev); RC_CHECK();590 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();591 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();592 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();589 rc = CFGMR3InsertNode(pDevices, "pcarch", &pDev); RC_CHECK(); 590 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK(); 591 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK(); 592 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK(); 593 593 594 594 /* … … 596 596 */ 597 597 LONG64 timeOffset; 598 hrc = biosSettings->COMGETTER(TimeOffset)(&timeOffset); H();598 hrc = biosSettings->COMGETTER(TimeOffset)(&timeOffset); H(); 599 599 PCFGMNODE pTMNode; 600 rc = CFGMR3InsertNode(pRoot, "TM", &pTMNode); RC_CHECK();601 rc = CFGMR3InsertInteger(pTMNode, "UTCOffset", timeOffset * 1000000); RC_CHECK();600 rc = CFGMR3InsertNode(pRoot, "TM", &pTMNode); RC_CHECK(); 601 rc = CFGMR3InsertInteger(pTMNode, "UTCOffset", timeOffset * 1000000); RC_CHECK(); 602 602 603 603 /* 604 604 * DMA 605 605 */ 606 rc = CFGMR3InsertNode(pDevices, "8237A", &pDev); RC_CHECK();607 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();608 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();606 rc = CFGMR3InsertNode(pDevices, "8237A", &pDev); RC_CHECK(); 607 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK(); 608 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK(); 609 609 610 610 /* 611 611 * PCI buses. 612 612 */ 613 rc = CFGMR3InsertNode(pDevices, "pci", &pDev); /* piix3 */ RC_CHECK();614 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();615 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();616 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();617 rc = CFGMR3InsertInteger(pCfg, "IOAPIC", fIOAPIC); RC_CHECK();613 rc = CFGMR3InsertNode(pDevices, "pci", &pDev); /* piix3 */ RC_CHECK(); 614 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK(); 615 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK(); 616 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK(); 617 rc = CFGMR3InsertInteger(pCfg, "IOAPIC", fIOAPIC); RC_CHECK(); 618 618 619 619 #if 0 /* enable this to test PCI bridging */ 620 rc = CFGMR3InsertNode(pDevices, "pcibridge", &pDev); RC_CHECK();621 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();622 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();623 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();624 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 14); RC_CHECK();625 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK();626 rc = CFGMR3InsertInteger(pInst, "PCIBusNo", 0);/* -> pci[0] */ RC_CHECK();627 628 rc = CFGMR3InsertNode(pDev, "1", &pInst); RC_CHECK();629 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();630 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();631 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 1); RC_CHECK();632 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK();633 rc = CFGMR3InsertInteger(pInst, "PCIBusNo", 1);/* ->pcibridge[0] */ RC_CHECK();634 635 rc = CFGMR3InsertNode(pDev, "2", &pInst); RC_CHECK();636 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();637 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();638 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 3); RC_CHECK();639 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK();640 rc = CFGMR3InsertInteger(pInst, "PCIBusNo", 1);/* ->pcibridge[0] */ RC_CHECK();620 rc = CFGMR3InsertNode(pDevices, "pcibridge", &pDev); RC_CHECK(); 621 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK(); 622 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK(); 623 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK(); 624 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 14); RC_CHECK(); 625 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK(); 626 rc = CFGMR3InsertInteger(pInst, "PCIBusNo", 0);/* -> pci[0] */ RC_CHECK(); 627 628 rc = CFGMR3InsertNode(pDev, "1", &pInst); RC_CHECK(); 629 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK(); 630 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK(); 631 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 1); RC_CHECK(); 632 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK(); 633 rc = CFGMR3InsertInteger(pInst, "PCIBusNo", 1);/* ->pcibridge[0] */ RC_CHECK(); 634 635 rc = CFGMR3InsertNode(pDev, "2", &pInst); RC_CHECK(); 636 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK(); 637 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK(); 638 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 3); RC_CHECK(); 639 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK(); 640 rc = CFGMR3InsertInteger(pInst, "PCIBusNo", 1);/* ->pcibridge[0] */ RC_CHECK(); 641 641 #endif 642 642 … … 650 650 #ifdef VBOX_WITH_HPET 651 651 /* Other guests may wish to use HPET too, but MacOS X not functional without it */ 652 hrc = pMachine->COMGETTER(HpetEnabled)(&fHpetEnabled); H();652 hrc = pMachine->COMGETTER(HpetEnabled)(&fHpetEnabled); H(); 653 653 /* so always enable HPET in extended profile */ 654 654 fHpetEnabled |= fOsXGuest; … … 658 658 if (fHpetEnabled) 659 659 { 660 rc = CFGMR3InsertNode(pDevices, "hpet", &pDev); RC_CHECK();661 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();662 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();660 rc = CFGMR3InsertNode(pDevices, "hpet", &pDev); RC_CHECK(); 661 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK(); 662 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK(); 663 663 } 664 664 … … 675 675 { 676 676 Bstr tmpStr2; 677 rc = CFGMR3InsertNode(pDevices, "smc", &pDev); RC_CHECK();678 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();679 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();680 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();681 rc = getSmcDeviceKey(pMachine, tmpStr2.asOutParam()); RC_CHECK();682 rc = CFGMR3InsertString(pCfg, "DeviceKey", Utf8Str(tmpStr2).raw()); RC_CHECK();677 rc = CFGMR3InsertNode(pDevices, "smc", &pDev); RC_CHECK(); 678 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK(); 679 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK(); 680 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK(); 681 rc = getSmcDeviceKey(pMachine, tmpStr2.asOutParam()); RC_CHECK(); 682 rc = CFGMR3InsertString(pCfg, "DeviceKey", Utf8Str(tmpStr2).raw()); RC_CHECK(); 683 683 } 684 684 … … 695 695 if (fLpcEnabled) 696 696 { 697 rc = CFGMR3InsertNode(pDevices, "lpc", &pDev); RC_CHECK();698 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();699 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();697 rc = CFGMR3InsertNode(pDevices, "lpc", &pDev); RC_CHECK(); 698 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK(); 699 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK(); 700 700 } 701 701 … … 703 703 * PS/2 keyboard & mouse. 704 704 */ 705 rc = CFGMR3InsertNode(pDevices, "pckbd", &pDev); RC_CHECK();706 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();707 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();708 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();709 710 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();711 rc = CFGMR3InsertString(pLunL0, "Driver", "KeyboardQueue"); RC_CHECK();712 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();713 rc = CFGMR3InsertInteger(pCfg, "QueueSize", 64); RC_CHECK();714 715 rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); RC_CHECK();716 rc = CFGMR3InsertString(pLunL1, "Driver", "MainKeyboard"); RC_CHECK();717 rc = CFGMR3InsertNode(pLunL1, "Config", &pCfg); RC_CHECK();705 rc = CFGMR3InsertNode(pDevices, "pckbd", &pDev); RC_CHECK(); 706 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK(); 707 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK(); 708 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK(); 709 710 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK(); 711 rc = CFGMR3InsertString(pLunL0, "Driver", "KeyboardQueue"); RC_CHECK(); 712 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK(); 713 rc = CFGMR3InsertInteger(pCfg, "QueueSize", 64); RC_CHECK(); 714 715 rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); RC_CHECK(); 716 rc = CFGMR3InsertString(pLunL1, "Driver", "MainKeyboard"); RC_CHECK(); 717 rc = CFGMR3InsertNode(pLunL1, "Config", &pCfg); RC_CHECK(); 718 718 Keyboard *pKeyboard = pConsole->mKeyboard; 719 rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)pKeyboard); RC_CHECK();720 721 rc = CFGMR3InsertNode(pInst, "LUN#1", &pLunL0); RC_CHECK();722 rc = CFGMR3InsertString(pLunL0, "Driver", "MouseQueue"); RC_CHECK();723 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();724 rc = CFGMR3InsertInteger(pCfg, "QueueSize", 128); RC_CHECK();725 726 rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); RC_CHECK();727 rc = CFGMR3InsertString(pLunL1, "Driver", "MainMouse"); RC_CHECK();728 rc = CFGMR3InsertNode(pLunL1, "Config", &pCfg); RC_CHECK();719 rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)pKeyboard); RC_CHECK(); 720 721 rc = CFGMR3InsertNode(pInst, "LUN#1", &pLunL0); RC_CHECK(); 722 rc = CFGMR3InsertString(pLunL0, "Driver", "MouseQueue"); RC_CHECK(); 723 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK(); 724 rc = CFGMR3InsertInteger(pCfg, "QueueSize", 128); RC_CHECK(); 725 726 rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); RC_CHECK(); 727 rc = CFGMR3InsertString(pLunL1, "Driver", "MainMouse"); RC_CHECK(); 728 rc = CFGMR3InsertNode(pLunL1, "Config", &pCfg); RC_CHECK(); 729 729 Mouse *pMouse = pConsole->mMouse; 730 rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)pMouse); RC_CHECK();730 rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)pMouse); RC_CHECK(); 731 731 732 732 /* 733 733 * i8254 Programmable Interval Timer And Dummy Speaker 734 734 */ 735 rc = CFGMR3InsertNode(pDevices, "i8254", &pDev); RC_CHECK();736 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();737 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();735 rc = CFGMR3InsertNode(pDevices, "i8254", &pDev); RC_CHECK(); 736 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK(); 737 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK(); 738 738 #ifdef DEBUG 739 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();739 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK(); 740 740 #endif 741 741 … … 743 743 * i8259 Programmable Interrupt Controller. 744 744 */ 745 rc = CFGMR3InsertNode(pDevices, "i8259", &pDev); RC_CHECK();746 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();747 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();748 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();745 rc = CFGMR3InsertNode(pDevices, "i8259", &pDev); RC_CHECK(); 746 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK(); 747 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK(); 748 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK(); 749 749 750 750 /* … … 753 753 * thus only single insert 754 754 */ 755 rc = CFGMR3InsertNode(pDevices, "apic", &pDev); RC_CHECK();756 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();757 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();758 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();759 rc = CFGMR3InsertInteger(pCfg, "IOAPIC", fIOAPIC); RC_CHECK();760 rc = CFGMR3InsertInteger(pCfg, "NumCPUs", cCpus); RC_CHECK();755 rc = CFGMR3InsertNode(pDevices, "apic", &pDev); RC_CHECK(); 756 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK(); 757 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK(); 758 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK(); 759 rc = CFGMR3InsertInteger(pCfg, "IOAPIC", fIOAPIC); RC_CHECK(); 760 rc = CFGMR3InsertInteger(pCfg, "NumCPUs", cCpus); RC_CHECK(); 761 761 762 762 if (fIOAPIC) … … 765 765 * I/O Advanced Programmable Interrupt Controller. 766 766 */ 767 rc = CFGMR3InsertNode(pDevices, "ioapic", &pDev); RC_CHECK();768 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();769 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();770 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();767 rc = CFGMR3InsertNode(pDevices, "ioapic", &pDev); RC_CHECK(); 768 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK(); 769 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK(); 770 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK(); 771 771 } 772 772 … … 774 774 * RTC MC146818. 775 775 */ 776 rc = CFGMR3InsertNode(pDevices, "mc146818", &pDev); RC_CHECK();777 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();778 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();776 rc = CFGMR3InsertNode(pDevices, "mc146818", &pDev); RC_CHECK(); 777 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK(); 778 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK(); 779 779 BOOL fRTCUseUTC; 780 hrc = pMachine->COMGETTER(RTCUseUTC)(&fRTCUseUTC); H();781 rc = CFGMR3InsertInteger(pCfg, "UseUTC", fRTCUseUTC ? 1 : 0); RC_CHECK();780 hrc = pMachine->COMGETTER(RTCUseUTC)(&fRTCUseUTC); H(); 781 rc = CFGMR3InsertInteger(pCfg, "UseUTC", fRTCUseUTC ? 1 : 0); RC_CHECK(); 782 782 783 783 /* 784 784 * VGA. 785 785 */ 786 rc = CFGMR3InsertNode(pDevices, "vga", &pDev); RC_CHECK();787 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();788 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();789 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 2); RC_CHECK();786 rc = CFGMR3InsertNode(pDevices, "vga", &pDev); RC_CHECK(); 787 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK(); 788 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK(); 789 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 2); RC_CHECK(); 790 790 Assert(!afPciDeviceNo[2]); 791 791 afPciDeviceNo[2] = true; 792 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK();793 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();792 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK(); 793 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK(); 794 794 ULONG cVRamMBs; 795 hrc = pMachine->COMGETTER(VRAMSize)(&cVRamMBs); H();796 rc = CFGMR3InsertInteger(pCfg, "VRamSize", cVRamMBs * _1M); RC_CHECK();795 hrc = pMachine->COMGETTER(VRAMSize)(&cVRamMBs); H(); 796 rc = CFGMR3InsertInteger(pCfg, "VRamSize", cVRamMBs * _1M); RC_CHECK(); 797 797 ULONG cMonitorCount; 798 hrc = pMachine->COMGETTER(MonitorCount)(&cMonitorCount); H();799 rc = CFGMR3InsertInteger(pCfg, "MonitorCount", cMonitorCount); RC_CHECK();800 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE /* not safe here yet. */ /** @todo this needs fixing !!! No wonder VGA is slooooooooow on 32-bit darwin! */801 rc = CFGMR3InsertInteger(pCfg, "R0Enabled", fHWVirtExEnabled); RC_CHECK();798 hrc = pMachine->COMGETTER(MonitorCount)(&cMonitorCount); H(); 799 rc = CFGMR3InsertInteger(pCfg, "MonitorCount", cMonitorCount); RC_CHECK(); 800 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE 801 rc = CFGMR3InsertInteger(pCfg, "R0Enabled", fHWVirtExEnabled); RC_CHECK(); 802 802 #endif 803 803 … … 806 806 */ 807 807 BOOL fFadeIn; 808 hrc = biosSettings->COMGETTER(LogoFadeIn)(&fFadeIn); H();809 rc = CFGMR3InsertInteger(pCfg, "FadeIn", fFadeIn ? 1 : 0); RC_CHECK();808 hrc = biosSettings->COMGETTER(LogoFadeIn)(&fFadeIn); H(); 809 rc = CFGMR3InsertInteger(pCfg, "FadeIn", fFadeIn ? 1 : 0); RC_CHECK(); 810 810 BOOL fFadeOut; 811 hrc = biosSettings->COMGETTER(LogoFadeOut)(&fFadeOut); H();812 rc = CFGMR3InsertInteger(pCfg, "FadeOut", fFadeOut ? 1: 0); RC_CHECK();811 hrc = biosSettings->COMGETTER(LogoFadeOut)(&fFadeOut); H(); 812 rc = CFGMR3InsertInteger(pCfg, "FadeOut", fFadeOut ? 1: 0); RC_CHECK(); 813 813 ULONG logoDisplayTime; 814 hrc = biosSettings->COMGETTER(LogoDisplayTime)(&logoDisplayTime); H();815 rc = CFGMR3InsertInteger(pCfg, "LogoTime", logoDisplayTime); RC_CHECK();814 hrc = biosSettings->COMGETTER(LogoDisplayTime)(&logoDisplayTime); H(); 815 rc = CFGMR3InsertInteger(pCfg, "LogoTime", logoDisplayTime); RC_CHECK(); 816 816 Bstr logoImagePath; 817 hrc = biosSettings->COMGETTER(LogoImagePath)(logoImagePath.asOutParam()); H();817 hrc = biosSettings->COMGETTER(LogoImagePath)(logoImagePath.asOutParam()); H(); 818 818 rc = CFGMR3InsertString(pCfg, "LogoFile", logoImagePath ? Utf8Str(logoImagePath).c_str() : ""); RC_CHECK(); 819 819 … … 830 830 default: iShowBootMenu = 2; break; 831 831 } 832 rc = CFGMR3InsertInteger(pCfg, "ShowBootMenu", iShowBootMenu); RC_CHECK();832 rc = CFGMR3InsertInteger(pCfg, "ShowBootMenu", iShowBootMenu); RC_CHECK(); 833 833 834 834 /* Custom VESA mode list */ … … 838 838 char szExtraDataKey[sizeof("CustomVideoModeXX")]; 839 839 RTStrPrintf(szExtraDataKey, sizeof(szExtraDataKey), "CustomVideoMode%u", iMode); 840 hrc = pMachine->GetExtraData(Bstr(szExtraDataKey), bstr.asOutParam()); H();840 hrc = pMachine->GetExtraData(Bstr(szExtraDataKey), bstr.asOutParam()); H(); 841 841 if (bstr.isEmpty()) 842 842 break; 843 rc = CFGMR3InsertStringW(pCfg, szExtraDataKey, bstr.raw()); RC_CHECK();843 rc = CFGMR3InsertStringW(pCfg, szExtraDataKey, bstr.raw()); RC_CHECK(); 844 844 ++cModes; 845 845 } 846 rc = CFGMR3InsertInteger(pCfg, "CustomVideoModes", cModes); RC_CHECK();846 rc = CFGMR3InsertInteger(pCfg, "CustomVideoModes", cModes); RC_CHECK(); 847 847 848 848 /* VESA height reduction */ … … 851 851 if (pFramebuffer) 852 852 { 853 hrc = pFramebuffer->COMGETTER(HeightReduction)(&ulHeightReduction); H();853 hrc = pFramebuffer->COMGETTER(HeightReduction)(&ulHeightReduction); H(); 854 854 } 855 855 else … … 858 858 ulHeightReduction = 0; 859 859 } 860 rc = CFGMR3InsertInteger(pCfg, "HeightReduction", ulHeightReduction); RC_CHECK();860 rc = CFGMR3InsertInteger(pCfg, "HeightReduction", ulHeightReduction); RC_CHECK(); 861 861 862 862 /* Attach the display. */ 863 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();864 rc = CFGMR3InsertString(pLunL0, "Driver", "MainDisplay"); RC_CHECK();865 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();863 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK(); 864 rc = CFGMR3InsertString(pLunL0, "Driver", "MainDisplay"); RC_CHECK(); 865 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK(); 866 866 Display *pDisplay = pConsole->mDisplay; 867 rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)pDisplay); RC_CHECK();867 rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)pDisplay); RC_CHECK(); 868 868 869 869 … … 872 872 */ 873 873 FirmwareType_T eFwType = FirmwareType_BIOS; 874 hrc = pMachine->COMGETTER(FirmwareType)(&eFwType); H();874 hrc = pMachine->COMGETTER(FirmwareType)(&eFwType); H(); 875 875 876 876 #ifdef VBOX_WITH_EFI … … 983 983 * EFI subtree. 984 984 */ 985 rc = CFGMR3InsertNode(pDevices, "efi", &pDev); 986 rc = CFGMR3InsertNode(pDev, "0", &pInst); 987 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ 988 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); 989 rc = CFGMR3InsertInteger(pCfg, "RamSize", cbRam); 990 rc = CFGMR3InsertInteger(pCfg, "RamHoleSize", cbRamHole); 991 rc = CFGMR3InsertInteger(pCfg, "NumCPUs", cCpus); 992 rc = CFGMR3InsertString(pCfg, "EfiRom", efiRomFile.raw()); 993 rc = CFGMR3InsertString(pCfg, "BootArgs", Utf8Str(bootArgs).raw()); 994 rc = CFGMR3InsertString(pCfg, "DeviceProps", Utf8Str(deviceProps).raw()); 995 rc = CFGMR3InsertInteger(pCfg, "IOAPIC", fIOAPIC); 996 rc = CFGMR3InsertBytes(pCfg, "UUID", &HardwareUuid,sizeof(HardwareUuid)); 997 rc = CFGMR3InsertInteger(pCfg, "64BitEntry", f64BitEntry); /* boolean */ 998 rc = CFGMR3InsertInteger(pCfg, "GopMode", u32GopMode); 999 rc = CFGMR3InsertInteger(pCfg, "UgaHorizontalResolution", u32UgaHorisontal); 1000 rc = CFGMR3InsertInteger(pCfg, "UgaVerticalResolution", u32UgaVertical); 985 rc = CFGMR3InsertNode(pDevices, "efi", &pDev); RC_CHECK(); 986 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK(); 987 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK(); 988 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK(); 989 rc = CFGMR3InsertInteger(pCfg, "RamSize", cbRam); RC_CHECK(); 990 rc = CFGMR3InsertInteger(pCfg, "RamHoleSize", cbRamHole); RC_CHECK(); 991 rc = CFGMR3InsertInteger(pCfg, "NumCPUs", cCpus); RC_CHECK(); 992 rc = CFGMR3InsertString(pCfg, "EfiRom", efiRomFile.raw()); RC_CHECK(); 993 rc = CFGMR3InsertString(pCfg, "BootArgs", Utf8Str(bootArgs).raw()); RC_CHECK(); 994 rc = CFGMR3InsertString(pCfg, "DeviceProps", Utf8Str(deviceProps).raw());RC_CHECK(); 995 rc = CFGMR3InsertInteger(pCfg, "IOAPIC", fIOAPIC); RC_CHECK(); 996 rc = CFGMR3InsertBytes(pCfg, "UUID", &HardwareUuid,sizeof(HardwareUuid)); RC_CHECK(); 997 rc = CFGMR3InsertInteger(pCfg, "64BitEntry", f64BitEntry); /* boolean */ RC_CHECK(); 998 rc = CFGMR3InsertInteger(pCfg, "GopMode", u32GopMode); RC_CHECK(); 999 rc = CFGMR3InsertInteger(pCfg, "UgaHorizontalResolution", u32UgaHorisontal); RC_CHECK(); 1000 rc = CFGMR3InsertInteger(pCfg, "UgaVerticalResolution", u32UgaVertical); RC_CHECK(); 1001 1001 1002 1002 /* For OS X guests we'll force passing host's DMI info to the guest */ 1003 1003 if (fOsXGuest) 1004 1004 { 1005 rc = CFGMR3InsertInteger(pCfg, "DmiUseHostInfo", 1); 1006 rc = CFGMR3InsertInteger(pCfg, "DmiExposeMemoryTable", 1); 1005 rc = CFGMR3InsertInteger(pCfg, "DmiUseHostInfo", 1); RC_CHECK(); 1006 rc = CFGMR3InsertInteger(pCfg, "DmiExposeMemoryTable", 1); RC_CHECK(); 1007 1007 } 1008 1008 } … … 1013 1013 com::SafeIfaceArray<IStorageController> ctrls; 1014 1014 PCFGMNODE aCtrlNodes[StorageControllerType_LsiLogicSas + 1] = {}; 1015 hrc = pMachine->COMGETTER(StorageControllers)(ComSafeArrayAsOutParam(ctrls)); 1015 hrc = pMachine->COMGETTER(StorageControllers)(ComSafeArrayAsOutParam(ctrls)); H(); 1016 1016 1017 1017 for (size_t i = 0; i < ctrls.size(); ++i) … … 1020 1020 1021 1021 StorageControllerType_T enmCtrlType; 1022 rc = ctrls[i]->COMGETTER(ControllerType)(&enmCtrlType); 1022 rc = ctrls[i]->COMGETTER(ControllerType)(&enmCtrlType); H(); 1023 1023 AssertRelease((unsigned)enmCtrlType < RT_ELEMENTS(aCtrlNodes)); 1024 1024 1025 1025 StorageBus_T enmBus; 1026 rc = ctrls[i]->COMGETTER(Bus)(&enmBus); 1026 rc = ctrls[i]->COMGETTER(Bus)(&enmBus); H(); 1027 1027 1028 1028 Bstr controllerName; 1029 rc = ctrls[i]->COMGETTER(Name)(controllerName.asOutParam()); 1029 rc = ctrls[i]->COMGETTER(Name)(controllerName.asOutParam()); H(); 1030 1030 1031 1031 ULONG ulInstance = 999; 1032 rc = ctrls[i]->COMGETTER(Instance)(&ulInstance); 1032 rc = ctrls[i]->COMGETTER(Instance)(&ulInstance); H(); 1033 1033 1034 1034 IoBackendType_T enmIoBackend; 1035 rc = ctrls[i]->COMGETTER(IoBackend)(&enmIoBackend); 1035 rc = ctrls[i]->COMGETTER(IoBackend)(&enmIoBackend); H(); 1036 1036 1037 1037 /* /Devices/<ctrldev>/ */ … … 1040 1040 if (!pDev) 1041 1041 { 1042 rc = CFGMR3InsertNode(pDevices, pszCtrlDev, &pDev); 1042 rc = CFGMR3InsertNode(pDevices, pszCtrlDev, &pDev); RC_CHECK(); 1043 1043 aCtrlNodes[enmCtrlType] = pDev; /* IDE variants are handled in the switch */ 1044 1044 } … … 1046 1046 /* /Devices/<ctrldev>/<instance>/ */ 1047 1047 PCFGMNODE pCtlInst = NULL; 1048 rc = CFGMR3InsertNodeF(pDev, &pCtlInst, "%u", ulInstance); 1048 rc = CFGMR3InsertNodeF(pDev, &pCtlInst, "%u", ulInstance); RC_CHECK(); 1049 1049 1050 1050 /* Device config: /Devices/<ctrldev>/<instance>/<values> & /ditto/Config/<values> */ 1051 rc = CFGMR3InsertInteger(pCtlInst, "Trusted", 1); 1052 rc = CFGMR3InsertNode(pCtlInst, "Config", &pCfg); 1051 rc = CFGMR3InsertInteger(pCtlInst, "Trusted", 1); RC_CHECK(); 1052 rc = CFGMR3InsertNode(pCtlInst, "Config", &pCfg); RC_CHECK(); 1053 1053 1054 1054 switch (enmCtrlType) … … 1056 1056 case StorageControllerType_LsiLogic: 1057 1057 { 1058 rc = CFGMR3InsertInteger(pCtlInst, "PCIDeviceNo", 20); 1058 rc = CFGMR3InsertInteger(pCtlInst, "PCIDeviceNo", 20); RC_CHECK(); 1059 1059 Assert(!afPciDeviceNo[20]); 1060 1060 afPciDeviceNo[20] = true; 1061 rc = CFGMR3InsertInteger(pCtlInst, "PCIFunctionNo", 0); 1061 rc = CFGMR3InsertInteger(pCtlInst, "PCIFunctionNo", 0); RC_CHECK(); 1062 1062 1063 1063 /* Attach the status driver */ 1064 rc = CFGMR3InsertNode(pCtlInst, "LUN#999", &pLunL0); 1065 rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); 1066 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); 1064 rc = CFGMR3InsertNode(pCtlInst, "LUN#999", &pLunL0); RC_CHECK(); 1065 rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); RC_CHECK(); 1066 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK(); 1067 1067 rc = CFGMR3InsertInteger(pCfg, "papLeds", (uintptr_t)&pConsole->mapStorageLeds[iLedScsi]); RC_CHECK(); 1068 rc = CFGMR3InsertInteger(pCfg, "First", 0); 1068 rc = CFGMR3InsertInteger(pCfg, "First", 0); RC_CHECK(); 1069 1069 Assert(cLedScsi >= 16); 1070 rc = CFGMR3InsertInteger(pCfg, "Last", 15); 1070 rc = CFGMR3InsertInteger(pCfg, "Last", 15); RC_CHECK(); 1071 1071 paLedDevType = &pConsole->maStorageDevType[iLedScsi]; 1072 1072 break; … … 1075 1075 case StorageControllerType_BusLogic: 1076 1076 { 1077 rc = CFGMR3InsertInteger(pCtlInst, "PCIDeviceNo", 21); 1077 rc = CFGMR3InsertInteger(pCtlInst, "PCIDeviceNo", 21); RC_CHECK(); 1078 1078 Assert(!afPciDeviceNo[21]); 1079 1079 afPciDeviceNo[21] = true; 1080 rc = CFGMR3InsertInteger(pCtlInst, "PCIFunctionNo", 0); 1080 rc = CFGMR3InsertInteger(pCtlInst, "PCIFunctionNo", 0); RC_CHECK(); 1081 1081 1082 1082 /* Attach the status driver */ 1083 rc = CFGMR3InsertNode(pCtlInst, "LUN#999", &pLunL0); 1084 rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); 1085 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); 1083 rc = CFGMR3InsertNode(pCtlInst, "LUN#999", &pLunL0); RC_CHECK(); 1084 rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); RC_CHECK(); 1085 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK(); 1086 1086 rc = CFGMR3InsertInteger(pCfg, "papLeds", (uintptr_t)&pConsole->mapStorageLeds[iLedScsi]); RC_CHECK(); 1087 rc = CFGMR3InsertInteger(pCfg, "First", 0); 1087 rc = CFGMR3InsertInteger(pCfg, "First", 0); RC_CHECK(); 1088 1088 Assert(cLedScsi >= 16); 1089 rc = CFGMR3InsertInteger(pCfg, "Last", 15); 1089 rc = CFGMR3InsertInteger(pCfg, "Last", 15); RC_CHECK(); 1090 1090 paLedDevType = &pConsole->maStorageDevType[iLedScsi]; 1091 1091 break; … … 1094 1094 case StorageControllerType_IntelAhci: 1095 1095 { 1096 rc = CFGMR3InsertInteger(pCtlInst, "PCIDeviceNo", 13); 1096 rc = CFGMR3InsertInteger(pCtlInst, "PCIDeviceNo", 13); RC_CHECK(); 1097 1097 Assert(!afPciDeviceNo[13]); 1098 1098 afPciDeviceNo[13] = true; 1099 rc = CFGMR3InsertInteger(pCtlInst, "PCIFunctionNo", 0); 1099 rc = CFGMR3InsertInteger(pCtlInst, "PCIFunctionNo", 0); RC_CHECK(); 1100 1100 1101 1101 ULONG cPorts = 0; 1102 hrc = ctrls[i]->COMGETTER(PortCount)(&cPorts); 1103 rc = CFGMR3InsertInteger(pCfg, "PortCount", cPorts); 1102 hrc = ctrls[i]->COMGETTER(PortCount)(&cPorts); H(); 1103 rc = CFGMR3InsertInteger(pCfg, "PortCount", cPorts); RC_CHECK(); 1104 1104 1105 1105 /* Needed configuration values for the bios. */ 1106 1106 if (pBiosCfg) 1107 1107 { 1108 rc = CFGMR3InsertString(pBiosCfg, "SataHardDiskDevice", "ahci"); 1108 rc = CFGMR3InsertString(pBiosCfg, "SataHardDiskDevice", "ahci"); RC_CHECK(); 1109 1109 } 1110 1110 … … 1117 1117 1118 1118 LONG lPortNumber = -1; 1119 hrc = ctrls[i]->GetIDEEmulationPort(j, &lPortNumber); 1120 rc = CFGMR3InsertInteger(pCfg, s_apszConfig[j], lPortNumber); 1119 hrc = ctrls[i]->GetIDEEmulationPort(j, &lPortNumber); H(); 1120 rc = CFGMR3InsertInteger(pCfg, s_apszConfig[j], lPortNumber); RC_CHECK(); 1121 1121 if (pBiosCfg) 1122 1122 { 1123 rc = CFGMR3InsertInteger(pBiosCfg, s_apszBiosConfig[j], lPortNumber); 1123 rc = CFGMR3InsertInteger(pBiosCfg, s_apszBiosConfig[j], lPortNumber); RC_CHECK(); 1124 1124 } 1125 1125 } 1126 1126 1127 1127 /* Attach the status driver */ 1128 rc = CFGMR3InsertNode(pCtlInst, "LUN#999", &pLunL0); 1129 rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); 1130 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); 1128 rc = CFGMR3InsertNode(pCtlInst, "LUN#999", &pLunL0); RC_CHECK(); 1129 rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); RC_CHECK(); 1130 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK(); 1131 1131 AssertRelease(cPorts <= cLedSata); 1132 1132 rc = CFGMR3InsertInteger(pCfg, "papLeds", (uintptr_t)&pConsole->mapStorageLeds[iLedSata]); RC_CHECK(); 1133 rc = CFGMR3InsertInteger(pCfg, "First", 0); 1134 rc = CFGMR3InsertInteger(pCfg, "Last", cPorts - 1); 1133 rc = CFGMR3InsertInteger(pCfg, "First", 0); RC_CHECK(); 1134 rc = CFGMR3InsertInteger(pCfg, "Last", cPorts - 1); RC_CHECK(); 1135 1135 paLedDevType = &pConsole->maStorageDevType[iLedSata]; 1136 1136 break; … … 1144 1144 * IDE (update this when the main interface changes) 1145 1145 */ 1146 rc = CFGMR3InsertInteger(pCtlInst, "PCIDeviceNo", 1); 1146 rc = CFGMR3InsertInteger(pCtlInst, "PCIDeviceNo", 1); RC_CHECK(); 1147 1147 Assert(!afPciDeviceNo[1]); 1148 1148 afPciDeviceNo[1] = true; 1149 rc = CFGMR3InsertInteger(pCtlInst, "PCIFunctionNo", 1); 1150 rc = CFGMR3InsertString(pCfg, "Type", controllerString(enmCtrlType)); 1149 rc = CFGMR3InsertInteger(pCtlInst, "PCIFunctionNo", 1); RC_CHECK(); 1150 rc = CFGMR3InsertString(pCfg, "Type", controllerString(enmCtrlType)); RC_CHECK(); 1151 1151 1152 1152 /* Attach the status driver */ 1153 rc = CFGMR3InsertNode(pCtlInst, "LUN#999", &pLunL0); 1154 rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); 1155 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); 1153 rc = CFGMR3InsertNode(pCtlInst, "LUN#999", &pLunL0); RC_CHECK(); 1154 rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); RC_CHECK(); 1155 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK(); 1156 1156 rc = CFGMR3InsertInteger(pCfg, "papLeds", (uintptr_t)&pConsole->mapStorageLeds[iLedIde]); RC_CHECK(); 1157 rc = CFGMR3InsertInteger(pCfg, "First", 0); 1157 rc = CFGMR3InsertInteger(pCfg, "First", 0); RC_CHECK(); 1158 1158 Assert(cLedIde >= 4); 1159 rc = CFGMR3InsertInteger(pCfg, "Last", 3); 1159 rc = CFGMR3InsertInteger(pCfg, "Last", 3); RC_CHECK(); 1160 1160 paLedDevType = &pConsole->maStorageDevType[iLedIde]; 1161 1161 … … 1173 1173 */ 1174 1174 fFdcEnabled = true; 1175 rc = CFGMR3InsertInteger(pCfg, "IRQ", 6); 1176 rc = CFGMR3InsertInteger(pCfg, "DMA", 2); 1177 rc = CFGMR3InsertInteger(pCfg, "MemMapped", 0 ); 1178 rc = CFGMR3InsertInteger(pCfg, "IOBase", 0x3f0); 1175 rc = CFGMR3InsertInteger(pCfg, "IRQ", 6); RC_CHECK(); 1176 rc = CFGMR3InsertInteger(pCfg, "DMA", 2); RC_CHECK(); 1177 rc = CFGMR3InsertInteger(pCfg, "MemMapped", 0 ); RC_CHECK(); 1178 rc = CFGMR3InsertInteger(pCfg, "IOBase", 0x3f0); RC_CHECK(); 1179 1179 1180 1180 /* Attach the status driver */ 1181 rc = CFGMR3InsertNode(pCtlInst, "LUN#999", &pLunL0); 1182 rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); 1183 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); 1181 rc = CFGMR3InsertNode(pCtlInst, "LUN#999", &pLunL0); RC_CHECK(); 1182 rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); RC_CHECK(); 1183 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK(); 1184 1184 rc = CFGMR3InsertInteger(pCfg, "papLeds", (uintptr_t)&pConsole->mapStorageLeds[iLedFloppy]); RC_CHECK(); 1185 rc = CFGMR3InsertInteger(pCfg, "First", 0); 1185 rc = CFGMR3InsertInteger(pCfg, "First", 0); RC_CHECK(); 1186 1186 Assert(cLedFloppy >= 1); 1187 rc = CFGMR3InsertInteger(pCfg, "Last", 0); 1187 rc = CFGMR3InsertInteger(pCfg, "Last", 0); RC_CHECK(); 1188 1188 paLedDevType = &pConsole->maStorageDevType[iLedFloppy]; 1189 1189 break; … … 1192 1192 case StorageControllerType_LsiLogicSas: 1193 1193 { 1194 rc = CFGMR3InsertInteger(pCtlInst, "PCIDeviceNo", 22); 1194 rc = CFGMR3InsertInteger(pCtlInst, "PCIDeviceNo", 22); RC_CHECK(); 1195 1195 Assert(!afPciDeviceNo[22]); 1196 1196 afPciDeviceNo[22] = true; 1197 rc = CFGMR3InsertInteger(pCtlInst, "PCIFunctionNo", 0); 1198 1199 rc = CFGMR3InsertString(pCfg, "ControllerType", "SAS1068"); 1197 rc = CFGMR3InsertInteger(pCtlInst, "PCIFunctionNo", 0); RC_CHECK(); 1198 1199 rc = CFGMR3InsertString(pCfg, "ControllerType", "SAS1068"); RC_CHECK(); 1200 1200 1201 1201 /* Attach the status driver */ 1202 rc = CFGMR3InsertNode(pCtlInst, "LUN#999", &pLunL0); 1203 rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); 1204 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); 1202 rc = CFGMR3InsertNode(pCtlInst, "LUN#999", &pLunL0); RC_CHECK(); 1203 rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); RC_CHECK(); 1204 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK(); 1205 1205 rc = CFGMR3InsertInteger(pCfg, "papLeds", (uintptr_t)&pConsole->mapStorageLeds[iLedScsi]); RC_CHECK(); 1206 rc = CFGMR3InsertInteger(pCfg, "First", 0); 1206 rc = CFGMR3InsertInteger(pCfg, "First", 0); RC_CHECK(); 1207 1207 Assert(cLedScsi >= 16); 1208 rc = CFGMR3InsertInteger(pCfg, "Last", 15) ; 1208 rc = CFGMR3InsertInteger(pCfg, "Last", 15) ; RC_CHECK(); 1209 1209 paLedDevType = &pConsole->maStorageDevType[iLedScsi]; 1210 1210 break; … … 1218 1218 com::SafeIfaceArray<IMediumAttachment> atts; 1219 1219 hrc = pMachine->GetMediumAttachmentsOfController(controllerName, 1220 ComSafeArrayAsOutParam(atts)); 1220 ComSafeArrayAsOutParam(atts)); H(); 1221 1221 1222 1222 for (size_t j = 0; j < atts.size(); ++j) … … 1236 1236 false /* fForceUnmount */, 1237 1237 NULL /* pVM */, 1238 paLedDevType); 1238 paLedDevType); RC_CHECK(); 1239 1239 } 1240 1240 H(); … … 1249 1249 #endif 1250 1250 PCFGMNODE pDevPCNet = NULL; /* PCNet-type devices */ 1251 rc = CFGMR3InsertNode(pDevices, "pcnet", &pDevPCNet); RC_CHECK();1251 rc = CFGMR3InsertNode(pDevices, "pcnet", &pDevPCNet); RC_CHECK(); 1252 1252 #ifdef VBOX_WITH_E1000 1253 1253 PCFGMNODE pDevE1000 = NULL; /* E1000-type devices */ 1254 rc = CFGMR3InsertNode(pDevices, "e1000", &pDevE1000); RC_CHECK();1254 rc = CFGMR3InsertNode(pDevices, "e1000", &pDevE1000); RC_CHECK(); 1255 1255 #endif 1256 1256 #ifdef VBOX_WITH_VIRTIO 1257 1257 PCFGMNODE pDevVirtioNet = NULL; /* Virtio network devices */ 1258 rc = CFGMR3InsertNode(pDevices, "virtio-net", &pDevVirtioNet); RC_CHECK();1258 rc = CFGMR3InsertNode(pDevices, "virtio-net", &pDevVirtioNet); RC_CHECK(); 1259 1259 #endif /* VBOX_WITH_VIRTIO */ 1260 1260 std::list<BootNic> llBootNics; … … 1262 1262 { 1263 1263 ComPtr<INetworkAdapter> networkAdapter; 1264 hrc = pMachine->GetNetworkAdapter(ulInstance, networkAdapter.asOutParam()); H();1264 hrc = pMachine->GetNetworkAdapter(ulInstance, networkAdapter.asOutParam()); H(); 1265 1265 BOOL fEnabled = FALSE; 1266 hrc = networkAdapter->COMGETTER(Enabled)(&fEnabled); H();1266 hrc = networkAdapter->COMGETTER(Enabled)(&fEnabled); H(); 1267 1267 if (!fEnabled) 1268 1268 continue; … … 1273 1273 const char *pszAdapterName = "pcnet"; 1274 1274 NetworkAdapterType_T adapterType; 1275 hrc = networkAdapter->COMGETTER(AdapterType)(&adapterType); H();1275 hrc = networkAdapter->COMGETTER(AdapterType)(&adapterType); H(); 1276 1276 switch (adapterType) 1277 1277 { … … 1302 1302 } 1303 1303 1304 rc = CFGMR3InsertNodeF(pDev, &pInst, "%u", ulInstance); RC_CHECK();1305 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();1304 rc = CFGMR3InsertNodeF(pDev, &pInst, "%u", ulInstance); RC_CHECK(); 1305 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK(); 1306 1306 /* the first network card gets the PCI ID 3, the next 3 gets 8..10, 1307 1307 * next 4 get 16..19. */ … … 1327 1327 iPciDeviceNo = 3; 1328 1328 #endif 1329 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", iPciDeviceNo); RC_CHECK();1329 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", iPciDeviceNo); RC_CHECK(); 1330 1330 Assert(!afPciDeviceNo[iPciDeviceNo]); 1331 1331 afPciDeviceNo[iPciDeviceNo] = true; 1332 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK();1333 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();1332 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK(); 1333 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK(); 1334 1334 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE /* not safe here yet. */ 1335 1335 if (pDev == pDevPCNet) 1336 1336 { 1337 rc = CFGMR3InsertInteger(pCfg, "R0Enabled", false); RC_CHECK();1337 rc = CFGMR3InsertInteger(pCfg, "R0Enabled", false); RC_CHECK(); 1338 1338 } 1339 1339 #endif … … 1347 1347 nic.mPciFn = 0; 1348 1348 1349 hrc = networkAdapter->COMGETTER(BootPriority)(&nic.mBootPrio); H();1349 hrc = networkAdapter->COMGETTER(BootPriority)(&nic.mBootPrio); H(); 1350 1350 1351 1351 llBootNics.push_back(nic); … … 1357 1357 { 1358 1358 case NetworkAdapterType_Am79C970A: 1359 rc = CFGMR3InsertInteger(pCfg, "Am79C973", 0); RC_CHECK();1359 rc = CFGMR3InsertInteger(pCfg, "Am79C973", 0); RC_CHECK(); 1360 1360 break; 1361 1361 case NetworkAdapterType_Am79C973: 1362 rc = CFGMR3InsertInteger(pCfg, "Am79C973", 1); RC_CHECK();1362 rc = CFGMR3InsertInteger(pCfg, "Am79C973", 1); RC_CHECK(); 1363 1363 break; 1364 1364 case NetworkAdapterType_I82540EM: 1365 rc = CFGMR3InsertInteger(pCfg, "AdapterType", 0); RC_CHECK();1365 rc = CFGMR3InsertInteger(pCfg, "AdapterType", 0); RC_CHECK(); 1366 1366 break; 1367 1367 case NetworkAdapterType_I82543GC: 1368 rc = CFGMR3InsertInteger(pCfg, "AdapterType", 1); RC_CHECK();1368 rc = CFGMR3InsertInteger(pCfg, "AdapterType", 1); RC_CHECK(); 1369 1369 break; 1370 1370 case NetworkAdapterType_I82545EM: 1371 rc = CFGMR3InsertInteger(pCfg, "AdapterType", 2); RC_CHECK();1371 rc = CFGMR3InsertInteger(pCfg, "AdapterType", 2); RC_CHECK(); 1372 1372 break; 1373 1373 } … … 1377 1377 */ 1378 1378 Bstr macAddr; 1379 hrc = networkAdapter->COMGETTER(MACAddress)(macAddr.asOutParam()); H();1379 hrc = networkAdapter->COMGETTER(MACAddress)(macAddr.asOutParam()); H(); 1380 1380 Assert(macAddr); 1381 1381 Utf8Str macAddrUtf8 = macAddr; … … 1395 1395 *pMac++ = ((c1 & 0x0f) << 4) | (c2 & 0x0f); 1396 1396 } 1397 rc = CFGMR3InsertBytes(pCfg, "MAC", &Mac, sizeof(Mac)); RC_CHECK();1397 rc = CFGMR3InsertBytes(pCfg, "MAC", &Mac, sizeof(Mac)); RC_CHECK(); 1398 1398 1399 1399 /* … … 1401 1401 */ 1402 1402 BOOL fCableConnected; 1403 hrc = networkAdapter->COMGETTER(CableConnected)(&fCableConnected); H();1404 rc = CFGMR3InsertInteger(pCfg, "CableConnected", fCableConnected ? 1 : 0); RC_CHECK();1403 hrc = networkAdapter->COMGETTER(CableConnected)(&fCableConnected); H(); 1404 rc = CFGMR3InsertInteger(pCfg, "CableConnected", fCableConnected ? 1 : 0); RC_CHECK(); 1405 1405 1406 1406 /* … … 1408 1408 */ 1409 1409 ULONG ulLineSpeed; 1410 hrc = networkAdapter->COMGETTER(LineSpeed)(&ulLineSpeed); H();1411 rc = CFGMR3InsertInteger(pCfg, "LineSpeed", ulLineSpeed); RC_CHECK();1410 hrc = networkAdapter->COMGETTER(LineSpeed)(&ulLineSpeed); H(); 1411 rc = CFGMR3InsertInteger(pCfg, "LineSpeed", ulLineSpeed); RC_CHECK(); 1412 1412 1413 1413 /* 1414 1414 * Attach the status driver. 1415 1415 */ 1416 rc = CFGMR3InsertNode(pInst, "LUN#999", &pLunL0); RC_CHECK();1417 rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); RC_CHECK();1418 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();1416 rc = CFGMR3InsertNode(pInst, "LUN#999", &pLunL0); RC_CHECK(); 1417 rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); RC_CHECK(); 1418 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK(); 1419 1419 rc = CFGMR3InsertInteger(pCfg, "papLeds", (uintptr_t)&pConsole->mapNetworkLeds[ulInstance]); RC_CHECK(); 1420 1420 … … 1424 1424 rc = pConsole->configNetwork(pszAdapterName, ulInstance, 0, 1425 1425 networkAdapter, pCfg, pLunL0, pInst, 1426 false /*fAttachDetach*/); RC_CHECK();1426 false /*fAttachDetach*/); RC_CHECK(); 1427 1427 } 1428 1428 … … 1445 1445 PCFGMNODE pNetBtDevCfg; 1446 1446 achBootIdx[0] = '0' + uBootIdx++; /* Boot device order. */ 1447 rc = CFGMR3InsertNode(pNetBootCfg, achBootIdx, &pNetBtDevCfg); RC_CHECK();1448 rc = CFGMR3InsertInteger(pNetBtDevCfg, "NIC", it->mInstance); RC_CHECK();1449 rc = CFGMR3InsertInteger(pNetBtDevCfg, "PCIDeviceNo", it->mPciDev); RC_CHECK();1450 rc = CFGMR3InsertInteger(pNetBtDevCfg, "PCIFunctionNo", it->mPciFn); RC_CHECK();1447 rc = CFGMR3InsertNode(pNetBootCfg, achBootIdx, &pNetBtDevCfg); RC_CHECK(); 1448 rc = CFGMR3InsertInteger(pNetBtDevCfg, "NIC", it->mInstance); RC_CHECK(); 1449 rc = CFGMR3InsertInteger(pNetBtDevCfg, "PCIDeviceNo", it->mPciDev); RC_CHECK(); 1450 rc = CFGMR3InsertInteger(pNetBtDevCfg, "PCIFunctionNo", it->mPciFn); RC_CHECK(); 1451 1451 } 1452 1452 } … … 1455 1455 * Serial (UART) Ports 1456 1456 */ 1457 rc = CFGMR3InsertNode(pDevices, "serial", &pDev); RC_CHECK();1457 rc = CFGMR3InsertNode(pDevices, "serial", &pDev); RC_CHECK(); 1458 1458 for (ULONG ulInstance = 0; ulInstance < SchemaDefs::SerialPortCount; ++ulInstance) 1459 1459 { 1460 1460 ComPtr<ISerialPort> serialPort; 1461 hrc = pMachine->GetSerialPort(ulInstance, serialPort.asOutParam()); H();1461 hrc = pMachine->GetSerialPort(ulInstance, serialPort.asOutParam()); H(); 1462 1462 BOOL fEnabled = FALSE; 1463 1463 if (serialPort) 1464 hrc = serialPort->COMGETTER(Enabled)(&fEnabled); H();1464 hrc = serialPort->COMGETTER(Enabled)(&fEnabled); H(); 1465 1465 if (!fEnabled) 1466 1466 continue; 1467 1467 1468 rc = CFGMR3InsertNodeF(pDev, &pInst, "%u", ulInstance); RC_CHECK();1469 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();1468 rc = CFGMR3InsertNodeF(pDev, &pInst, "%u", ulInstance); RC_CHECK(); 1469 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK(); 1470 1470 1471 1471 ULONG ulIRQ; 1472 hrc = serialPort->COMGETTER(IRQ)(&ulIRQ); H();1473 rc = CFGMR3InsertInteger(pCfg, "IRQ", ulIRQ); RC_CHECK();1472 hrc = serialPort->COMGETTER(IRQ)(&ulIRQ); H(); 1473 rc = CFGMR3InsertInteger(pCfg, "IRQ", ulIRQ); RC_CHECK(); 1474 1474 ULONG ulIOBase; 1475 hrc = serialPort->COMGETTER(IOBase)(&ulIOBase); H();1476 rc = CFGMR3InsertInteger(pCfg, "IOBase", ulIOBase); RC_CHECK();1475 hrc = serialPort->COMGETTER(IOBase)(&ulIOBase); H(); 1476 rc = CFGMR3InsertInteger(pCfg, "IOBase", ulIOBase); RC_CHECK(); 1477 1477 BOOL fServer; 1478 hrc = serialPort->COMGETTER(Server)(&fServer); H();1479 hrc = serialPort->COMGETTER(Path)(bstr.asOutParam()); H();1478 hrc = serialPort->COMGETTER(Server)(&fServer); H(); 1479 hrc = serialPort->COMGETTER(Path)(bstr.asOutParam()); H(); 1480 1480 PortMode_T eHostMode; 1481 hrc = serialPort->COMGETTER(HostMode)(&eHostMode); H();1481 hrc = serialPort->COMGETTER(HostMode)(&eHostMode); H(); 1482 1482 if (eHostMode != PortMode_Disconnected) 1483 1483 { 1484 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();1484 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK(); 1485 1485 if (eHostMode == PortMode_HostPipe) 1486 1486 { 1487 rc = CFGMR3InsertString(pLunL0, "Driver", "Char"); RC_CHECK();1488 rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); RC_CHECK();1489 rc = CFGMR3InsertString(pLunL1, "Driver", "NamedPipe"); RC_CHECK();1490 rc = CFGMR3InsertNode(pLunL1, "Config", &pLunL2); RC_CHECK();1491 rc = CFGMR3InsertStringW(pLunL2, "Location", bstr.raw()); RC_CHECK();1492 rc = CFGMR3InsertInteger(pLunL2, "IsServer", fServer); RC_CHECK();1487 rc = CFGMR3InsertString(pLunL0, "Driver", "Char"); RC_CHECK(); 1488 rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); RC_CHECK(); 1489 rc = CFGMR3InsertString(pLunL1, "Driver", "NamedPipe"); RC_CHECK(); 1490 rc = CFGMR3InsertNode(pLunL1, "Config", &pLunL2); RC_CHECK(); 1491 rc = CFGMR3InsertStringW(pLunL2, "Location", bstr.raw()); RC_CHECK(); 1492 rc = CFGMR3InsertInteger(pLunL2, "IsServer", fServer); RC_CHECK(); 1493 1493 } 1494 1494 else if (eHostMode == PortMode_HostDevice) 1495 1495 { 1496 rc = CFGMR3InsertString(pLunL0, "Driver", "Host Serial"); RC_CHECK();1497 rc = CFGMR3InsertNode(pLunL0, "Config", &pLunL1); RC_CHECK();1498 rc = CFGMR3InsertStringW(pLunL1, "DevicePath", bstr.raw()); RC_CHECK();1496 rc = CFGMR3InsertString(pLunL0, "Driver", "Host Serial"); RC_CHECK(); 1497 rc = CFGMR3InsertNode(pLunL0, "Config", &pLunL1); RC_CHECK(); 1498 rc = CFGMR3InsertStringW(pLunL1, "DevicePath", bstr.raw()); RC_CHECK(); 1499 1499 } 1500 1500 else if (eHostMode == PortMode_RawFile) 1501 1501 { 1502 rc = CFGMR3InsertString(pLunL0, "Driver", "Char"); RC_CHECK();1503 rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); RC_CHECK();1504 rc = CFGMR3InsertString(pLunL1, "Driver", "RawFile"); RC_CHECK();1505 rc = CFGMR3InsertNode(pLunL1, "Config", &pLunL2); RC_CHECK();1506 rc = CFGMR3InsertStringW(pLunL2, "Location", bstr.raw()); RC_CHECK();1502 rc = CFGMR3InsertString(pLunL0, "Driver", "Char"); RC_CHECK(); 1503 rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); RC_CHECK(); 1504 rc = CFGMR3InsertString(pLunL1, "Driver", "RawFile"); RC_CHECK(); 1505 rc = CFGMR3InsertNode(pLunL1, "Config", &pLunL2); RC_CHECK(); 1506 rc = CFGMR3InsertStringW(pLunL2, "Location", bstr.raw()); RC_CHECK(); 1507 1507 } 1508 1508 } … … 1512 1512 * Parallel (LPT) Ports 1513 1513 */ 1514 rc = CFGMR3InsertNode(pDevices, "parallel", &pDev); RC_CHECK();1514 rc = CFGMR3InsertNode(pDevices, "parallel", &pDev); RC_CHECK(); 1515 1515 for (ULONG ulInstance = 0; ulInstance < SchemaDefs::ParallelPortCount; ++ulInstance) 1516 1516 { 1517 1517 ComPtr<IParallelPort> parallelPort; 1518 hrc = pMachine->GetParallelPort(ulInstance, parallelPort.asOutParam()); H();1518 hrc = pMachine->GetParallelPort(ulInstance, parallelPort.asOutParam()); H(); 1519 1519 BOOL fEnabled = FALSE; 1520 1520 if (parallelPort) 1521 1521 { 1522 hrc = parallelPort->COMGETTER(Enabled)(&fEnabled); H();1522 hrc = parallelPort->COMGETTER(Enabled)(&fEnabled); H(); 1523 1523 } 1524 1524 if (!fEnabled) 1525 1525 continue; 1526 1526 1527 rc = CFGMR3InsertNodeF(pDev, &pInst, "%u", ulInstance); RC_CHECK();1528 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();1527 rc = CFGMR3InsertNodeF(pDev, &pInst, "%u", ulInstance); RC_CHECK(); 1528 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK(); 1529 1529 1530 1530 ULONG ulIRQ; 1531 hrc = parallelPort->COMGETTER(IRQ)(&ulIRQ); H();1532 rc = CFGMR3InsertInteger(pCfg, "IRQ", ulIRQ); RC_CHECK();1531 hrc = parallelPort->COMGETTER(IRQ)(&ulIRQ); H(); 1532 rc = CFGMR3InsertInteger(pCfg, "IRQ", ulIRQ); RC_CHECK(); 1533 1533 ULONG ulIOBase; 1534 hrc = parallelPort->COMGETTER(IOBase)(&ulIOBase); H();1535 rc = CFGMR3InsertInteger(pCfg, "IOBase", ulIOBase); RC_CHECK();1536 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();1537 rc = CFGMR3InsertString(pLunL0, "Driver", "HostParallel"); RC_CHECK();1538 rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); RC_CHECK();1539 hrc = parallelPort->COMGETTER(Path)(bstr.asOutParam()); H();1540 rc = CFGMR3InsertStringW(pLunL1, "DevicePath", bstr.raw()); RC_CHECK();1534 hrc = parallelPort->COMGETTER(IOBase)(&ulIOBase); H(); 1535 rc = CFGMR3InsertInteger(pCfg, "IOBase", ulIOBase); RC_CHECK(); 1536 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK(); 1537 rc = CFGMR3InsertString(pLunL0, "Driver", "HostParallel"); RC_CHECK(); 1538 rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); RC_CHECK(); 1539 hrc = parallelPort->COMGETTER(Path)(bstr.asOutParam()); H(); 1540 rc = CFGMR3InsertStringW(pLunL1, "DevicePath", bstr.raw()); RC_CHECK(); 1541 1541 } 1542 1542 … … 1544 1544 * VMM Device 1545 1545 */ 1546 rc = CFGMR3InsertNode(pDevices, "VMMDev", &pDev); RC_CHECK();1547 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();1548 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();1549 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();1550 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 4); RC_CHECK();1546 rc = CFGMR3InsertNode(pDevices, "VMMDev", &pDev); RC_CHECK(); 1547 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK(); 1548 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK(); 1549 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK(); 1550 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 4); RC_CHECK(); 1551 1551 Assert(!afPciDeviceNo[4]); 1552 1552 afPciDeviceNo[4] = true; 1553 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK();1553 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK(); 1554 1554 Bstr hwVersion; 1555 hrc = pMachine->COMGETTER(HardwareVersion)(hwVersion.asOutParam()); H();1555 hrc = pMachine->COMGETTER(HardwareVersion)(hwVersion.asOutParam()); H(); 1556 1556 if (hwVersion.compare(Bstr("1")) == 0) /* <= 2.0.x */ 1557 1557 { 1558 CFGMR3InsertInteger(pCfg, "HeapEnabled", 0); RC_CHECK();1558 CFGMR3InsertInteger(pCfg, "HeapEnabled", 0); RC_CHECK(); 1559 1559 } 1560 1560 1561 1561 /* the VMM device's Main driver */ 1562 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();1563 rc = CFGMR3InsertString(pLunL0, "Driver", "HGCM"); RC_CHECK();1564 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();1562 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK(); 1563 rc = CFGMR3InsertString(pLunL0, "Driver", "HGCM"); RC_CHECK(); 1564 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK(); 1565 1565 VMMDev *pVMMDev = pConsole->mVMMDev; 1566 rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)pVMMDev); RC_CHECK();1566 rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)pVMMDev); RC_CHECK(); 1567 1567 1568 1568 /* 1569 1569 * Attach the status driver. 1570 1570 */ 1571 rc = CFGMR3InsertNode(pInst, "LUN#999", &pLunL0); RC_CHECK();1572 rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); RC_CHECK();1573 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();1571 rc = CFGMR3InsertNode(pInst, "LUN#999", &pLunL0); RC_CHECK(); 1572 rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); RC_CHECK(); 1573 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK(); 1574 1574 rc = CFGMR3InsertInteger(pCfg, "papLeds", (uintptr_t)&pConsole->mapSharedFolderLed); RC_CHECK(); 1575 rc = CFGMR3InsertInteger(pCfg, "First", 0); RC_CHECK();1576 rc = CFGMR3InsertInteger(pCfg, "Last", 0); RC_CHECK();1575 rc = CFGMR3InsertInteger(pCfg, "First", 0); RC_CHECK(); 1576 rc = CFGMR3InsertInteger(pCfg, "Last", 0); RC_CHECK(); 1577 1577 1578 1578 /* 1579 1579 * Audio Sniffer Device 1580 1580 */ 1581 rc = CFGMR3InsertNode(pDevices, "AudioSniffer", &pDev); RC_CHECK();1582 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();1583 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();1581 rc = CFGMR3InsertNode(pDevices, "AudioSniffer", &pDev); RC_CHECK(); 1582 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK(); 1583 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK(); 1584 1584 1585 1585 /* the Audio Sniffer device's Main driver */ 1586 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();1587 rc = CFGMR3InsertString(pLunL0, "Driver", "MainAudioSniffer"); RC_CHECK();1588 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();1586 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK(); 1587 rc = CFGMR3InsertString(pLunL0, "Driver", "MainAudioSniffer"); RC_CHECK(); 1588 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK(); 1589 1589 AudioSniffer *pAudioSniffer = pConsole->mAudioSniffer; 1590 rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)pAudioSniffer); RC_CHECK();1590 rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)pAudioSniffer); RC_CHECK(); 1591 1591 1592 1592 /* … … 1595 1595 BOOL enabled; 1596 1596 ComPtr<IAudioAdapter> audioAdapter; 1597 hrc = pMachine->COMGETTER(AudioAdapter)(audioAdapter.asOutParam()); H();1597 hrc = pMachine->COMGETTER(AudioAdapter)(audioAdapter.asOutParam()); H(); 1598 1598 if (audioAdapter) 1599 hrc = audioAdapter->COMGETTER(Enabled)(&enabled); H();1599 hrc = audioAdapter->COMGETTER(Enabled)(&enabled); H(); 1600 1600 1601 1601 if (enabled) 1602 1602 { 1603 1603 AudioControllerType_T audioController; 1604 hrc = audioAdapter->COMGETTER(AudioController)(&audioController); H();1604 hrc = audioAdapter->COMGETTER(AudioController)(&audioController); H(); 1605 1605 switch (audioController) 1606 1606 { … … 1608 1608 { 1609 1609 /* default: ICH AC97 */ 1610 rc = CFGMR3InsertNode(pDevices, "ichac97", &pDev); RC_CHECK();1610 rc = CFGMR3InsertNode(pDevices, "ichac97", &pDev); RC_CHECK(); 1611 1611 rc = CFGMR3InsertNode(pDev, "0", &pInst); 1612 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* bool */ RC_CHECK();1613 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 5); RC_CHECK();1612 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* bool */ RC_CHECK(); 1613 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 5); RC_CHECK(); 1614 1614 Assert(!afPciDeviceNo[5]); 1615 1615 afPciDeviceNo[5] = true; 1616 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK();1617 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();1616 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK(); 1617 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK(); 1618 1618 break; 1619 1619 } … … 1621 1621 { 1622 1622 /* legacy SoundBlaster16 */ 1623 rc = CFGMR3InsertNode(pDevices, "sb16", &pDev); RC_CHECK();1624 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();1625 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* bool */ RC_CHECK();1626 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();1627 rc = CFGMR3InsertInteger(pCfg, "IRQ", 5); RC_CHECK();1628 rc = CFGMR3InsertInteger(pCfg, "DMA", 1); RC_CHECK();1629 rc = CFGMR3InsertInteger(pCfg, "DMA16", 5); RC_CHECK();1630 rc = CFGMR3InsertInteger(pCfg, "Port", 0x220); RC_CHECK();1631 rc = CFGMR3InsertInteger(pCfg, "Version", 0x0405); RC_CHECK();1623 rc = CFGMR3InsertNode(pDevices, "sb16", &pDev); RC_CHECK(); 1624 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK(); 1625 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* bool */ RC_CHECK(); 1626 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK(); 1627 rc = CFGMR3InsertInteger(pCfg, "IRQ", 5); RC_CHECK(); 1628 rc = CFGMR3InsertInteger(pCfg, "DMA", 1); RC_CHECK(); 1629 rc = CFGMR3InsertInteger(pCfg, "DMA16", 5); RC_CHECK(); 1630 rc = CFGMR3InsertInteger(pCfg, "Port", 0x220); RC_CHECK(); 1631 rc = CFGMR3InsertInteger(pCfg, "Version", 0x0405); RC_CHECK(); 1632 1632 break; 1633 1633 } … … 1635 1635 1636 1636 /* the Audio driver */ 1637 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();1638 rc = CFGMR3InsertString(pLunL0, "Driver", "AUDIO"); RC_CHECK();1639 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();1637 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK(); 1638 rc = CFGMR3InsertString(pLunL0, "Driver", "AUDIO"); RC_CHECK(); 1639 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK(); 1640 1640 1641 1641 AudioDriverType_T audioDriver; 1642 hrc = audioAdapter->COMGETTER(AudioDriver)(&audioDriver); H();1642 hrc = audioAdapter->COMGETTER(AudioDriver)(&audioDriver); H(); 1643 1643 switch (audioDriver) 1644 1644 { 1645 1645 case AudioDriverType_Null: 1646 1646 { 1647 rc = CFGMR3InsertString(pCfg, "AudioDriver", "null"); RC_CHECK();1647 rc = CFGMR3InsertString(pCfg, "AudioDriver", "null"); RC_CHECK(); 1648 1648 break; 1649 1649 } … … 1652 1652 case AudioDriverType_WinMM: 1653 1653 { 1654 rc = CFGMR3InsertString(pCfg, "AudioDriver", "winmm"); RC_CHECK();1654 rc = CFGMR3InsertString(pCfg, "AudioDriver", "winmm"); RC_CHECK(); 1655 1655 break; 1656 1656 } … … 1658 1658 case AudioDriverType_DirectSound: 1659 1659 { 1660 rc = CFGMR3InsertString(pCfg, "AudioDriver", "dsound"); RC_CHECK();1660 rc = CFGMR3InsertString(pCfg, "AudioDriver", "dsound"); RC_CHECK(); 1661 1661 break; 1662 1662 } … … 1665 1665 case AudioDriverType_SolAudio: 1666 1666 { 1667 rc = CFGMR3InsertString(pCfg, "AudioDriver", "solaudio"); RC_CHECK();1667 rc = CFGMR3InsertString(pCfg, "AudioDriver", "solaudio"); RC_CHECK(); 1668 1668 break; 1669 1669 } … … 1673 1673 case AudioDriverType_ALSA: 1674 1674 { 1675 rc = CFGMR3InsertString(pCfg, "AudioDriver", "alsa"); RC_CHECK();1675 rc = CFGMR3InsertString(pCfg, "AudioDriver", "alsa"); RC_CHECK(); 1676 1676 break; 1677 1677 } … … 1680 1680 case AudioDriverType_Pulse: 1681 1681 { 1682 rc = CFGMR3InsertString(pCfg, "AudioDriver", "pulse"); RC_CHECK();1682 rc = CFGMR3InsertString(pCfg, "AudioDriver", "pulse"); RC_CHECK(); 1683 1683 break; 1684 1684 } … … 1688 1688 case AudioDriverType_OSS: 1689 1689 { 1690 rc = CFGMR3InsertString(pCfg, "AudioDriver", "oss"); RC_CHECK();1690 rc = CFGMR3InsertString(pCfg, "AudioDriver", "oss"); RC_CHECK(); 1691 1691 break; 1692 1692 } … … 1696 1696 case AudioDriverType_Pulse: 1697 1697 { 1698 rc = CFGMR3InsertString(pCfg, "AudioDriver", "pulse"); RC_CHECK();1698 rc = CFGMR3InsertString(pCfg, "AudioDriver", "pulse"); RC_CHECK(); 1699 1699 break; 1700 1700 } … … 1704 1704 case AudioDriverType_CoreAudio: 1705 1705 { 1706 rc = CFGMR3InsertString(pCfg, "AudioDriver", "coreaudio"); RC_CHECK();1706 rc = CFGMR3InsertString(pCfg, "AudioDriver", "coreaudio"); RC_CHECK(); 1707 1707 break; 1708 1708 } 1709 1709 #endif 1710 1710 } 1711 hrc = pMachine->COMGETTER(Name)(bstr.asOutParam()); H();1712 rc = CFGMR3InsertStringW(pCfg, "StreamName", bstr.raw()); RC_CHECK();1711 hrc = pMachine->COMGETTER(Name)(bstr.asOutParam()); H(); 1712 rc = CFGMR3InsertStringW(pCfg, "StreamName", bstr.raw()); RC_CHECK(); 1713 1713 } 1714 1714 … … 2002 2002 */ 2003 2003 BOOL fACPI; 2004 hrc = biosSettings->COMGETTER(ACPIEnabled)(&fACPI); H();2004 hrc = biosSettings->COMGETTER(ACPIEnabled)(&fACPI); H(); 2005 2005 if (fACPI) 2006 2006 { … … 2014 2014 fShowCpu = true; 2015 2015 2016 hrc = pMachine->COMGETTER(CPUHotPlugEnabled)(&fCpuHotPlug); H();2017 2018 rc = CFGMR3InsertNode(pDevices, "acpi", &pDev); RC_CHECK();2019 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();2020 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();2021 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();2022 rc = CFGMR3InsertInteger(pCfg, "RamSize", cbRam); RC_CHECK();2023 rc = CFGMR3InsertInteger(pCfg, "RamHoleSize", cbRamHole); RC_CHECK();2024 rc = CFGMR3InsertInteger(pCfg, "NumCPUs", cCpus); RC_CHECK();2025 2026 rc = CFGMR3InsertInteger(pCfg, "IOAPIC", fIOAPIC); RC_CHECK();2027 rc = CFGMR3InsertInteger(pCfg, "FdcEnabled", fFdcEnabled); RC_CHECK();2028 rc = CFGMR3InsertInteger(pCfg, "HpetEnabled", fHpetEnabled); RC_CHECK();2029 rc = CFGMR3InsertInteger(pCfg, "SmcEnabled", fSmcEnabled); RC_CHECK();2030 rc = CFGMR3InsertInteger(pCfg, "ShowRtc", fOsXGuest); RC_CHECK();2016 hrc = pMachine->COMGETTER(CPUHotPlugEnabled)(&fCpuHotPlug); H(); 2017 2018 rc = CFGMR3InsertNode(pDevices, "acpi", &pDev); RC_CHECK(); 2019 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK(); 2020 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK(); 2021 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK(); 2022 rc = CFGMR3InsertInteger(pCfg, "RamSize", cbRam); RC_CHECK(); 2023 rc = CFGMR3InsertInteger(pCfg, "RamHoleSize", cbRamHole); RC_CHECK(); 2024 rc = CFGMR3InsertInteger(pCfg, "NumCPUs", cCpus); RC_CHECK(); 2025 2026 rc = CFGMR3InsertInteger(pCfg, "IOAPIC", fIOAPIC); RC_CHECK(); 2027 rc = CFGMR3InsertInteger(pCfg, "FdcEnabled", fFdcEnabled); RC_CHECK(); 2028 rc = CFGMR3InsertInteger(pCfg, "HpetEnabled", fHpetEnabled); RC_CHECK(); 2029 rc = CFGMR3InsertInteger(pCfg, "SmcEnabled", fSmcEnabled); RC_CHECK(); 2030 rc = CFGMR3InsertInteger(pCfg, "ShowRtc", fOsXGuest); RC_CHECK(); 2031 2031 if (fOsXGuest && !llBootNics.empty()) 2032 2032 { 2033 2033 BootNic aNic = llBootNics.front(); 2034 2034 uint32_t u32NicPciAddr = (aNic.mPciDev << 16) | aNic.mPciFn; 2035 rc = CFGMR3InsertInteger(pCfg, "NicPciAddress", u32NicPciAddr); RC_CHECK();2036 } 2037 rc = CFGMR3InsertInteger(pCfg, "ShowCpu", fShowCpu); RC_CHECK();2038 rc = CFGMR3InsertInteger(pCfg, "CpuHotPlug", fCpuHotPlug); RC_CHECK();2039 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 7); RC_CHECK();2035 rc = CFGMR3InsertInteger(pCfg, "NicPciAddress", u32NicPciAddr); RC_CHECK(); 2036 } 2037 rc = CFGMR3InsertInteger(pCfg, "ShowCpu", fShowCpu); RC_CHECK(); 2038 rc = CFGMR3InsertInteger(pCfg, "CpuHotPlug", fCpuHotPlug); RC_CHECK(); 2039 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 7); RC_CHECK(); 2040 2040 Assert(!afPciDeviceNo[7]); 2041 2041 afPciDeviceNo[7] = true; 2042 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK();2043 2044 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();2045 rc = CFGMR3InsertString(pLunL0, "Driver", "ACPIHost"); RC_CHECK();2046 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();2042 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK(); 2043 2044 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK(); 2045 rc = CFGMR3InsertString(pLunL0, "Driver", "ACPIHost"); RC_CHECK(); 2046 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK(); 2047 2047 2048 2048 /* Attach the dummy CPU drivers */ … … 2053 2053 if (fCpuHotPlug) 2054 2054 { 2055 hrc = pMachine->GetCPUStatus(iCpuCurr, &fCpuAttached); H();2055 hrc = pMachine->GetCPUStatus(iCpuCurr, &fCpuAttached); H(); 2056 2056 } 2057 2057 … … 2252 2252 Bstr bstr; 2253 2253 2254 #define RC_CHECK() do { if (RT_FAILURE(rc)) { AssertMsgFailed(("rc=%Rrc\n", rc)); return rc; } } while (0)2255 #define H() do { if (FAILED(hrc)) { AssertMsgFailed(("hrc=%Rhrc\n", hrc)); return VERR_GENERAL_FAILURE; } } while (0)2254 #define RC_CHECK() AssertMsgReturn(RT_SUCCESS(rc), ("rc=%Rrc\n", rc), rc) 2255 #define H() AssertMsgReturn(!FAILED(hrc), ("hrc=%Rhrc\n", hrc), VERR_GENERAL_FAILURE) 2256 2256 2257 2257 LONG lDev; 2258 hrc = pMediumAtt->COMGETTER(Device)(&lDev); H();2258 hrc = pMediumAtt->COMGETTER(Device)(&lDev); H(); 2259 2259 LONG lPort; 2260 hrc = pMediumAtt->COMGETTER(Port)(&lPort); H();2260 hrc = pMediumAtt->COMGETTER(Port)(&lPort); H(); 2261 2261 DeviceType_T lType; 2262 hrc = pMediumAtt->COMGETTER(Type)(&lType); H();2262 hrc = pMediumAtt->COMGETTER(Type)(&lType); H(); 2263 2263 2264 2264 unsigned uLUN; 2265 2265 PCFGMNODE pLunL0 = NULL; 2266 2266 PCFGMNODE pCfg = NULL; 2267 hrc = Console::convertBusPortDeviceToLun(enmBus, lPort, lDev, uLUN); H();2267 hrc = Console::convertBusPortDeviceToLun(enmBus, lPort, lDev, uLUN); H(); 2268 2268 2269 2269 /* First check if the LUN already exists. */ … … 2307 2307 } 2308 2308 2309 rc = CFGMR3InsertNodeF(pCtlInst, &pLunL0, "LUN#%u", uLUN); RC_CHECK();2309 rc = CFGMR3InsertNodeF(pCtlInst, &pLunL0, "LUN#%u", uLUN); RC_CHECK(); 2310 2310 2311 2311 /* SCSI has a another driver between device and block. */ 2312 2312 if (enmBus == StorageBus_SCSI || enmBus == StorageBus_SAS) 2313 2313 { 2314 rc = CFGMR3InsertString(pLunL0, "Driver", "SCSI"); RC_CHECK();2315 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();2316 2317 rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL0); RC_CHECK();2314 rc = CFGMR3InsertString(pLunL0, "Driver", "SCSI"); RC_CHECK(); 2315 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK(); 2316 2317 rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL0); RC_CHECK(); 2318 2318 } 2319 2319 2320 2320 ComPtr<IMedium> pMedium; 2321 hrc = pMediumAtt->COMGETTER(Medium)(pMedium.asOutParam()); H();2321 hrc = pMediumAtt->COMGETTER(Medium)(pMedium.asOutParam()); H(); 2322 2322 BOOL fPassthrough; 2323 hrc = pMediumAtt->COMGETTER(Passthrough)(&fPassthrough); H();2323 hrc = pMediumAtt->COMGETTER(Passthrough)(&fPassthrough); H(); 2324 2324 rc = configMedium(pLunL0, 2325 2325 !!fPassthrough, … … 2331 2331 pMedium, 2332 2332 aMachineState, 2333 phrc); RC_CHECK();2333 phrc); RC_CHECK(); 2334 2334 2335 2335 if (fAttachDetach) … … 2337 2337 /* Attach the new driver. */ 2338 2338 rc = PDMR3DeviceAttach(pVM, pcszDevice, 0, uLUN, 2339 PDM_TACH_FLAGS_NOT_HOT_PLUG, NULL /*ppBase*/); RC_CHECK();2339 PDM_TACH_FLAGS_NOT_HOT_PLUG, NULL /*ppBase*/); RC_CHECK(); 2340 2340 2341 2341 /* There is no need to handle removable medium mounting, as we … … 2368 2368 Bstr bstr; 2369 2369 2370 #define RC_CHECK() do { if (RT_FAILURE(rc)) { AssertMsgFailed(("rc=%Rrc\n", rc)); return rc; } } while (0)2371 #define H() do { if (FAILED(hrc)) { AssertMsgFailed(("hrc=%Rhrc\n", hrc)); if (phrc) *phrc = hrc; return VERR_GENERAL_FAILURE; } } while (0)2370 #define RC_CHECK() AssertMsgReturn(RT_SUCCESS(rc), ("rc=%Rrc\n", rc), rc) 2371 #define H() AssertMsgReturnStmt(!FAILED(hrc), ("hrc=%Rhrc\n", hrc), if (phrc) *phrc = hrc, VERR_GENERAL_FAILURE) 2372 2372 2373 2373 PCFGMNODE pLunL1 = NULL; … … 2643 2643 Bstr bstr; 2644 2644 2645 #define RC_CHECK() do { if (RT_FAILURE(rc)) { AssertMsgFailed(("rc=%Rrc\n", rc)); return rc; } } while (0)2646 #define H() do { if (FAILED(hrc)) { AssertMsgFailed(("hrc=%Rhrc\n", hrc)); return VERR_GENERAL_FAILURE; } } while (0)2645 #define RC_CHECK() AssertMsgReturn(RT_SUCCESS(rc), ("rc=%Rrc\n", rc), rc) 2646 #define H() AssertMsgReturn(!FAILED(hrc), ("hrc=%Rhrc\n", hrc), VERR_GENERAL_FAILURE) 2647 2647 2648 2648 /* … … 2693 2693 { 2694 2694 CFGMR3RemoveNode(pLunL0); 2695 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();2696 rc = CFGMR3InsertString(pLunL0, "Driver", "NetSniffer"); RC_CHECK();2697 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();2698 hrc = aNetworkAdapter->COMGETTER(TraceFile)(bstr.asOutParam()); H();2695 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK(); 2696 rc = CFGMR3InsertString(pLunL0, "Driver", "NetSniffer"); RC_CHECK(); 2697 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK(); 2698 hrc = aNetworkAdapter->COMGETTER(TraceFile)(bstr.asOutParam()); H(); 2699 2699 if (!bstr.isEmpty()) /* check convention for indicating default file. */ 2700 2700 { 2701 rc = CFGMR3InsertStringW(pCfg, "File", bstr.raw()); RC_CHECK();2701 rc = CFGMR3InsertStringW(pCfg, "File", bstr.raw()); RC_CHECK(); 2702 2702 } 2703 2703 } … … 2716 2716 { 2717 2717 /* insert the sniffer filter driver. */ 2718 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();2719 rc = CFGMR3InsertString(pLunL0, "Driver", "NetSniffer"); RC_CHECK();2720 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();2721 hrc = aNetworkAdapter->COMGETTER(TraceFile)(bstr.asOutParam()); H();2718 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK(); 2719 rc = CFGMR3InsertString(pLunL0, "Driver", "NetSniffer"); RC_CHECK(); 2720 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK(); 2721 hrc = aNetworkAdapter->COMGETTER(TraceFile)(bstr.asOutParam()); H(); 2722 2722 if (!bstr.isEmpty()) /* check convention for indicating default file. */ 2723 2723 { 2724 rc = CFGMR3InsertStringW(pCfg, "File", bstr.raw()); RC_CHECK();2724 rc = CFGMR3InsertStringW(pCfg, "File", bstr.raw()); RC_CHECK(); 2725 2725 } 2726 2726 } … … 2728 2728 Bstr networkName, trunkName, trunkType; 2729 2729 NetworkAttachmentType_T eAttachmentType; 2730 hrc = aNetworkAdapter->COMGETTER(AttachmentType)(&eAttachmentType); H();2730 hrc = aNetworkAdapter->COMGETTER(AttachmentType)(&eAttachmentType); H(); 2731 2731 switch (eAttachmentType) 2732 2732 { … … 2737 2737 { 2738 2738 ComPtr<INATEngine> natDriver; 2739 hrc = aNetworkAdapter->COMGETTER(NatDriver)(natDriver.asOutParam()); 2739 hrc = aNetworkAdapter->COMGETTER(NatDriver)(natDriver.asOutParam()); H(); 2740 2740 if (fSniffer) 2741 2741 { 2742 rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL0); RC_CHECK();2742 rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL0); RC_CHECK(); 2743 2743 } 2744 2744 else 2745 2745 { 2746 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();2747 } 2748 rc = CFGMR3InsertString(pLunL0, "Driver", "NAT"); RC_CHECK();2749 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();2746 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK(); 2747 } 2748 rc = CFGMR3InsertString(pLunL0, "Driver", "NAT"); RC_CHECK(); 2749 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK(); 2750 2750 2751 2751 /* Configure TFTP prefix and boot filename. */ 2752 hrc = virtualBox->COMGETTER(HomeFolder)(bstr.asOutParam()); H();2752 hrc = virtualBox->COMGETTER(HomeFolder)(bstr.asOutParam()); H(); 2753 2753 if (!bstr.isEmpty()) 2754 2754 { 2755 2755 rc = CFGMR3InsertStringF(pCfg, "TFTPPrefix", "%ls%c%s", bstr.raw(), RTPATH_DELIMITER, "TFTP"); RC_CHECK(); 2756 2756 } 2757 hrc = pMachine->COMGETTER(Name)(bstr.asOutParam()); H();2758 rc = CFGMR3InsertStringF(pCfg, "BootFile", "%ls.pxe", bstr.raw()); RC_CHECK();2759 2760 hrc = natDriver->COMGETTER(Network)(bstr.asOutParam()); H();2757 hrc = pMachine->COMGETTER(Name)(bstr.asOutParam()); H(); 2758 rc = CFGMR3InsertStringF(pCfg, "BootFile", "%ls.pxe", bstr.raw()); RC_CHECK(); 2759 2760 hrc = natDriver->COMGETTER(Network)(bstr.asOutParam()); H(); 2761 2761 if (!bstr.isEmpty()) 2762 2762 { 2763 rc = CFGMR3InsertStringW(pCfg, "Network", bstr.raw()); RC_CHECK();2763 rc = CFGMR3InsertStringW(pCfg, "Network", bstr.raw()); RC_CHECK(); 2764 2764 } 2765 2765 else 2766 2766 { 2767 2767 ULONG uSlot; 2768 hrc = aNetworkAdapter->COMGETTER(Slot)(&uSlot); H();2769 rc = CFGMR3InsertStringF(pCfg, "Network", "10.0.%d.0/24", uSlot+2); RC_CHECK();2770 } 2771 hrc = natDriver->COMGETTER(HostIP)(bstr.asOutParam()); H();2768 hrc = aNetworkAdapter->COMGETTER(Slot)(&uSlot); H(); 2769 rc = CFGMR3InsertStringF(pCfg, "Network", "10.0.%d.0/24", uSlot+2); RC_CHECK(); 2770 } 2771 hrc = natDriver->COMGETTER(HostIP)(bstr.asOutParam()); H(); 2772 2772 if (!bstr.isEmpty()) 2773 2773 { 2774 rc = CFGMR3InsertStringW(pCfg, "BindIP", bstr.raw()); RC_CHECK();2774 rc = CFGMR3InsertStringW(pCfg, "BindIP", bstr.raw()); RC_CHECK(); 2775 2775 } 2776 2776 ULONG mtu = 0; … … 2782 2782 if (mtu) 2783 2783 { 2784 rc = CFGMR3InsertInteger(pCfg, "SlirpMTU", mtu); RC_CHECK();2784 rc = CFGMR3InsertInteger(pCfg, "SlirpMTU", mtu); RC_CHECK(); 2785 2785 } 2786 2786 if (sockRcv) 2787 2787 { 2788 rc = CFGMR3InsertInteger(pCfg, "SockRcv", sockRcv); RC_CHECK();2788 rc = CFGMR3InsertInteger(pCfg, "SockRcv", sockRcv); RC_CHECK(); 2789 2789 } 2790 2790 if (sockSnd) 2791 2791 { 2792 rc = CFGMR3InsertInteger(pCfg, "SockSnd", sockSnd); RC_CHECK();2792 rc = CFGMR3InsertInteger(pCfg, "SockSnd", sockSnd); RC_CHECK(); 2793 2793 } 2794 2794 if (tcpRcv) 2795 2795 { 2796 rc = CFGMR3InsertInteger(pCfg, "TcpRcv", tcpRcv); RC_CHECK();2796 rc = CFGMR3InsertInteger(pCfg, "TcpRcv", tcpRcv); RC_CHECK(); 2797 2797 } 2798 2798 if (tcpSnd) 2799 2799 { 2800 rc = CFGMR3InsertInteger(pCfg, "TcpSnd", tcpSnd); RC_CHECK();2801 } 2802 hrc = natDriver->COMGETTER(TftpPrefix)(bstr.asOutParam()); H();2800 rc = CFGMR3InsertInteger(pCfg, "TcpSnd", tcpSnd); RC_CHECK(); 2801 } 2802 hrc = natDriver->COMGETTER(TftpPrefix)(bstr.asOutParam()); H(); 2803 2803 if (!bstr.isEmpty()) 2804 2804 { 2805 rc = CFGMR3RemoveValue(pCfg, "TFTPPrefix"); RC_CHECK();2806 rc = CFGMR3InsertStringW(pCfg, "TFTPPrefix", bstr); RC_CHECK();2807 } 2808 hrc = natDriver->COMGETTER(TftpBootFile)(bstr.asOutParam()); H();2805 rc = CFGMR3RemoveValue(pCfg, "TFTPPrefix"); RC_CHECK(); 2806 rc = CFGMR3InsertStringW(pCfg, "TFTPPrefix", bstr); RC_CHECK(); 2807 } 2808 hrc = natDriver->COMGETTER(TftpBootFile)(bstr.asOutParam()); H(); 2809 2809 if (!bstr.isEmpty()) 2810 2810 { 2811 rc = CFGMR3RemoveValue(pCfg, "BootFile"); RC_CHECK();2812 rc = CFGMR3InsertStringW(pCfg, "BootFile", bstr); RC_CHECK();2813 } 2814 hrc = natDriver->COMGETTER(TftpNextServer)(bstr.asOutParam()); H();2811 rc = CFGMR3RemoveValue(pCfg, "BootFile"); RC_CHECK(); 2812 rc = CFGMR3InsertStringW(pCfg, "BootFile", bstr); RC_CHECK(); 2813 } 2814 hrc = natDriver->COMGETTER(TftpNextServer)(bstr.asOutParam()); H(); 2815 2815 if (!bstr.isEmpty()) 2816 2816 { 2817 rc = CFGMR3InsertStringW(pCfg, "NextServer", bstr); RC_CHECK();2817 rc = CFGMR3InsertStringW(pCfg, "NextServer", bstr); RC_CHECK(); 2818 2818 } 2819 2819 BOOL fDnsFlag; 2820 hrc = natDriver->COMGETTER(DnsPassDomain)(&fDnsFlag); H();2821 rc = CFGMR3InsertInteger(pCfg, "PassDomain", fDnsFlag); RC_CHECK();2822 hrc = natDriver->COMGETTER(DnsProxy)(&fDnsFlag); H();2823 rc = CFGMR3InsertInteger(pCfg, "DNSProxy", fDnsFlag); RC_CHECK();2824 hrc = natDriver->COMGETTER(DnsUseHostResolver)(&fDnsFlag); H();2825 rc = CFGMR3InsertInteger(pCfg, "UseHostResolver", fDnsFlag); RC_CHECK();2820 hrc = natDriver->COMGETTER(DnsPassDomain)(&fDnsFlag); H(); 2821 rc = CFGMR3InsertInteger(pCfg, "PassDomain", fDnsFlag); RC_CHECK(); 2822 hrc = natDriver->COMGETTER(DnsProxy)(&fDnsFlag); H(); 2823 rc = CFGMR3InsertInteger(pCfg, "DNSProxy", fDnsFlag); RC_CHECK(); 2824 hrc = natDriver->COMGETTER(DnsUseHostResolver)(&fDnsFlag); H(); 2825 rc = CFGMR3InsertInteger(pCfg, "UseHostResolver", fDnsFlag); RC_CHECK(); 2826 2826 2827 2827 ULONG aliasMode; 2828 hrc = natDriver->COMGETTER(AliasMode)(&aliasMode); H();2829 rc = CFGMR3InsertInteger(pCfg, "AliasMode", aliasMode); RC_CHECK();2828 hrc = natDriver->COMGETTER(AliasMode)(&aliasMode); H(); 2829 rc = CFGMR3InsertInteger(pCfg, "AliasMode", aliasMode); RC_CHECK(); 2830 2830 2831 2831 /* port-forwarding */ 2832 2832 SafeArray<BSTR> pfs; 2833 hrc = natDriver->COMGETTER(Redirects)(ComSafeArrayAsOutParam(pfs)); H();2833 hrc = natDriver->COMGETTER(Redirects)(ComSafeArrayAsOutParam(pfs)); H(); 2834 2834 PCFGMNODE pPF = NULL; /* /Devices/Dev/.../Config/PF#0/ */ 2835 2835 for (unsigned int i = 0; i < pfs.size(); ++i) … … 2846 2846 size_t pos, ppos; 2847 2847 pos = ppos = 0; 2848 #define ITERATE_TO_NEXT_TERM(res, str, pos, ppos)\2849 do {\2850 pos = str.find(",", ppos);\2851 if (pos == Utf8Str::npos)\2852 {\2853 2854 continue;\2855 }\2856 res = str.substr(ppos, pos - ppos);\2857 2858 ppos = pos + 1;\2859 2848 #define ITERATE_TO_NEXT_TERM(res, str, pos, ppos) \ 2849 do { \ 2850 pos = str.find(",", ppos); \ 2851 if (pos == Utf8Str::npos) \ 2852 { \ 2853 Log(( #res " extracting from %s is failed\n", str.raw())); \ 2854 continue; \ 2855 } \ 2856 res = str.substr(ppos, pos - ppos); \ 2857 Log2((#res " %s pos:%d, ppos:%d\n", res.raw(), pos, ppos)); \ 2858 ppos = pos + 1; \ 2859 } while (0) 2860 2860 ITERATE_TO_NEXT_TERM(strName, utf, pos, ppos); 2861 2861 ITERATE_TO_NEXT_TERM(strProto, utf, pos, ppos); … … 2864 2864 ITERATE_TO_NEXT_TERM(strGuestIP, utf, pos, ppos); 2865 2865 strGuestPort = utf.substr(ppos, utf.length() - ppos); 2866 2866 #undef ITERATE_TO_NEXT_TERM 2867 2867 2868 2868 uint32_t proto = strProto.toUInt32(); … … 2872 2872 case NATProtocol_UDP: 2873 2873 strProto = "UDP"; 2874 break;2874 break; 2875 2875 case NATProtocol_TCP: 2876 2876 strProto = "TCP"; 2877 break;2877 break; 2878 2878 default: 2879 2879 fValid = false; … … 2883 2883 continue; 2884 2884 2885 rc = CFGMR3InsertNode(pCfg, strName.raw(), &pPF); RC_CHECK();2886 rc = CFGMR3InsertString(pPF, "Protocol", strProto.raw()); RC_CHECK();2885 rc = CFGMR3InsertNode(pCfg, strName.raw(), &pPF); RC_CHECK(); 2886 rc = CFGMR3InsertString(pPF, "Protocol", strProto.raw()); RC_CHECK(); 2887 2887 2888 2888 if (!strHostIP.isEmpty()) 2889 2889 { 2890 rc = CFGMR3InsertString(pPF, "BindIP", strHostIP.raw()); RC_CHECK();2890 rc = CFGMR3InsertString(pPF, "BindIP", strHostIP.raw()); RC_CHECK(); 2891 2891 } 2892 2892 2893 2893 if (!strGuestIP.isEmpty()) 2894 2894 { 2895 rc = CFGMR3InsertString(pPF, "GuestIP", strGuestIP.raw()); RC_CHECK();2895 rc = CFGMR3InsertString(pPF, "GuestIP", strGuestIP.raw()); RC_CHECK(); 2896 2896 } 2897 2897 … … 2899 2899 if (port) 2900 2900 { 2901 rc = CFGMR3InsertInteger(pPF, "HostPort", port); RC_CHECK();2901 rc = CFGMR3InsertInteger(pPF, "HostPort", port); RC_CHECK(); 2902 2902 } 2903 2903 … … 2905 2905 if (port) 2906 2906 { 2907 rc = CFGMR3InsertInteger(pPF, "GuestPort", port); RC_CHECK();2907 rc = CFGMR3InsertInteger(pPF, "GuestPort", port); RC_CHECK(); 2908 2908 } 2909 2909 } … … 2921 2921 case VERR_ACCESS_DENIED: 2922 2922 return VMSetError(pVM, VERR_HOSTIF_INIT_FAILED, RT_SRC_POS, N_( 2923 "Failed to open '/dev/net/tun' for read/write access. Please check the "2924 "permissions of that node. Either run 'chmod 0666 /dev/net/tun' or "2925 "change the group of that node and make yourself a member of that group. Make "2926 "sure that these changes are permanent, especially if you are "2927 "using udev"));2923 "Failed to open '/dev/net/tun' for read/write access. Please check the " 2924 "permissions of that node. Either run 'chmod 0666 /dev/net/tun' or " 2925 "change the group of that node and make yourself a member of that group. Make " 2926 "sure that these changes are permanent, especially if you are " 2927 "using udev")); 2928 2928 default: 2929 2929 AssertMsgFailed(("Could not attach to host interface! Bad!\n")); 2930 2930 return VMSetError(pVM, VERR_HOSTIF_INIT_FAILED, RT_SRC_POS, N_( 2931 "Failed to initialize Host Interface Networking"));2931 "Failed to initialize Host Interface Networking")); 2932 2932 } 2933 2933 } … … 2938 2938 if (fSniffer) 2939 2939 { 2940 rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL0); 2940 rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL0); RC_CHECK(); 2941 2941 } 2942 2942 else 2943 2943 { 2944 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); 2945 } 2946 rc = CFGMR3InsertString(pLunL0, "Driver", "HostInterface"); 2947 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); 2948 rc = CFGMR3InsertInteger(pCfg, "FileHandle", maTapFD[uInstance]); RC_CHECK();2944 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK(); 2945 } 2946 rc = CFGMR3InsertString(pLunL0, "Driver", "HostInterface"); RC_CHECK(); 2947 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK(); 2948 rc = CFGMR3InsertInteger(pCfg, "FileHandle", maTapFD[uInstance]); RC_CHECK(); 2949 2949 } 2950 2950 … … 2955 2955 if (fSniffer) 2956 2956 { 2957 rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL0); 2957 rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL0); RC_CHECK(); 2958 2958 } 2959 2959 else 2960 2960 { 2961 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); 2961 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK(); 2962 2962 } 2963 2963 … … 3134 3134 case VERR_ACCESS_DENIED: 3135 3135 return VMSetError(pVM, VERR_HOSTIF_INIT_FAILED, RT_SRC_POS, N_( 3136 "Failed to open '/dev/%s' for read/write access. Please check the "3137 "permissions of that node, and that the net.link.tap.user_open "3138 "sysctl is set. Either run 'chmod 0666 /dev/%s' or "3139 "change the group of that node to vboxusers and make yourself "3140 "a member of that group. Make sure that these changes are permanent."), pszHifName, pszHifName);3136 "Failed to open '/dev/%s' for read/write access. Please check the " 3137 "permissions of that node, and that the net.link.tap.user_open " 3138 "sysctl is set. Either run 'chmod 0666 /dev/%s' or " 3139 "change the group of that node to vboxusers and make yourself " 3140 "a member of that group. Make sure that these changes are permanent."), pszHifName, pszHifName); 3141 3141 default: 3142 3142 AssertMsgFailed(("Could not attach to tap interface! Bad!\n")); 3143 3143 return VMSetError(pVM, VERR_HOSTIF_INIT_FAILED, RT_SRC_POS, N_( 3144 "Failed to initialize Host Interface Networking"));3144 "Failed to initialize Host Interface Networking")); 3145 3145 } 3146 3146 } … … 3149 3149 if ((int)maTapFD[uInstance] >= 0) 3150 3150 { 3151 rc = CFGMR3InsertString(pLunL0, "Driver", "HostInterface"); 3152 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); 3153 rc = CFGMR3InsertInteger(pCfg, "FileHandle", maTapFD[uInstance]); 3151 rc = CFGMR3InsertString(pLunL0, "Driver", "HostInterface"); RC_CHECK(); 3152 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK(); 3153 rc = CFGMR3InsertInteger(pCfg, "FileHandle", maTapFD[uInstance]); RC_CHECK(); 3154 3154 } 3155 3155 break; … … 3182 3182 # endif 3183 3183 3184 rc = CFGMR3InsertString(pLunL0, "Driver", "IntNet"); RC_CHECK();3185 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();3186 rc = CFGMR3InsertString(pCfg, "Trunk", pszTrunk); RC_CHECK();3184 rc = CFGMR3InsertString(pLunL0, "Driver", "IntNet"); RC_CHECK(); 3185 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK(); 3186 rc = CFGMR3InsertString(pCfg, "Trunk", pszTrunk); RC_CHECK(); 3187 3187 rc = CFGMR3InsertInteger(pCfg, "TrunkType", kIntNetTrunkType_NetFlt); 3188 3188 RC_CHECK(); 3189 3189 char szNetwork[INTNET_MAX_NETWORK_NAME]; 3190 3190 RTStrPrintf(szNetwork, sizeof(szNetwork), "HostInterfaceNetworking-%s", pszHifName); 3191 rc = CFGMR3InsertString(pCfg, "Network", szNetwork); RC_CHECK();3191 rc = CFGMR3InsertString(pCfg, "Network", szNetwork); RC_CHECK(); 3192 3192 networkName = Bstr(szNetwork); 3193 3193 trunkName = Bstr(pszTrunk); … … 3199 3199 || strstr(pszHifName, "AirPort" )) 3200 3200 { 3201 rc = CFGMR3InsertInteger(pCfg, "SharedMacOnWire", true); RC_CHECK();3201 rc = CFGMR3InsertInteger(pCfg, "SharedMacOnWire", true); RC_CHECK(); 3202 3202 } 3203 3203 # elif defined(RT_OS_LINUX) … … 3305 3305 { 3306 3306 Log(("this is a wireless adapter")); 3307 rc = CFGMR3InsertInteger(pCfg, "SharedMacOnWire", true); RC_CHECK();3307 rc = CFGMR3InsertInteger(pCfg, "SharedMacOnWire", true); RC_CHECK(); 3308 3308 Log(("Set SharedMacOnWire\n")); 3309 3309 } … … 3332 3332 if (ZoneId != GLOBAL_ZONEID) 3333 3333 { 3334 rc = CFGMR3InsertInteger(pCfg, "IgnoreAllPromisc", true); RC_CHECK();3334 rc = CFGMR3InsertInteger(pCfg, "IgnoreAllPromisc", true); RC_CHECK(); 3335 3335 } 3336 3336 # endif … … 3351 3351 case NetworkAttachmentType_Internal: 3352 3352 { 3353 hrc = aNetworkAdapter->COMGETTER(InternalNetwork)(bstr.asOutParam()); H();3353 hrc = aNetworkAdapter->COMGETTER(InternalNetwork)(bstr.asOutParam()); H(); 3354 3354 if (!bstr.isEmpty()) 3355 3355 { … … 3364 3364 RC_CHECK(); 3365 3365 } 3366 rc = CFGMR3InsertString(pLunL0, "Driver", "IntNet"); RC_CHECK();3367 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();3368 rc = CFGMR3InsertStringW(pCfg, "Network", bstr); RC_CHECK();3366 rc = CFGMR3InsertString(pLunL0, "Driver", "IntNet"); RC_CHECK(); 3367 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK(); 3368 rc = CFGMR3InsertStringW(pCfg, "Network", bstr); RC_CHECK(); 3369 3369 rc = CFGMR3InsertInteger(pCfg, "TrunkType", kIntNetTrunkType_WhateverNone); RC_CHECK(); 3370 3370 networkName = bstr; … … 3387 3387 } 3388 3388 3389 rc = CFGMR3InsertString(pLunL0, "Driver", "IntNet"); RC_CHECK();3390 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();3389 rc = CFGMR3InsertString(pLunL0, "Driver", "IntNet"); RC_CHECK(); 3390 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK(); 3391 3391 3392 3392 Bstr HifName; … … 3516 3516 const char *pszTrunk = szTrunkName; 3517 3517 3518 rc = CFGMR3InsertInteger(pCfg, "TrunkType", kIntNetTrunkType_NetAdp); RC_CHECK();3519 rc = CFGMR3InsertString(pCfg, "Trunk", pszTrunk); RC_CHECK();3520 rc = CFGMR3InsertString(pCfg, "Network", szNetwork); RC_CHECK();3518 rc = CFGMR3InsertInteger(pCfg, "TrunkType", kIntNetTrunkType_NetAdp); RC_CHECK(); 3519 rc = CFGMR3InsertString(pCfg, "Trunk", pszTrunk); RC_CHECK(); 3520 rc = CFGMR3InsertString(pCfg, "Network", szNetwork); RC_CHECK(); 3521 3521 networkName = Bstr(szNetwork); 3522 3522 trunkName = Bstr(pszTrunk); … … 3524 3524 # endif /* defined VBOX_WITH_NETFLT*/ 3525 3525 #elif defined(RT_OS_DARWIN) 3526 rc = CFGMR3InsertString(pCfg, "Trunk", pszHifName); RC_CHECK();3527 rc = CFGMR3InsertString(pCfg, "Network", szNetwork); RC_CHECK();3528 rc = CFGMR3InsertInteger(pCfg, "TrunkType", kIntNetTrunkType_NetAdp); RC_CHECK();3526 rc = CFGMR3InsertString(pCfg, "Trunk", pszHifName); RC_CHECK(); 3527 rc = CFGMR3InsertString(pCfg, "Network", szNetwork); RC_CHECK(); 3528 rc = CFGMR3InsertInteger(pCfg, "TrunkType", kIntNetTrunkType_NetAdp); RC_CHECK(); 3529 3529 networkName = Bstr(szNetwork); 3530 3530 trunkName = Bstr(pszHifName); 3531 3531 trunkType = TRUNKTYPE_NETADP; 3532 3532 #else 3533 rc = CFGMR3InsertString(pCfg, "Trunk", pszHifName); RC_CHECK();3534 rc = CFGMR3InsertString(pCfg, "Network", szNetwork); RC_CHECK();3535 rc = CFGMR3InsertInteger(pCfg, "TrunkType", kIntNetTrunkType_NetFlt); RC_CHECK();3533 rc = CFGMR3InsertString(pCfg, "Trunk", pszHifName); RC_CHECK(); 3534 rc = CFGMR3InsertString(pCfg, "Network", szNetwork); RC_CHECK(); 3535 rc = CFGMR3InsertInteger(pCfg, "TrunkType", kIntNetTrunkType_NetFlt); RC_CHECK(); 3536 3536 networkName = Bstr(szNetwork); 3537 3537 trunkName = Bstr(pszHifName); … … 3576 3576 case NetworkAttachmentType_VDE: 3577 3577 { 3578 hrc = aNetworkAdapter->COMGETTER(VDENetwork)(bstr.asOutParam()); H();3579 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();3580 rc = CFGMR3InsertString(pLunL0, "Driver", "VDE"); RC_CHECK();3581 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();3578 hrc = aNetworkAdapter->COMGETTER(VDENetwork)(bstr.asOutParam()); H(); 3579 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK(); 3580 rc = CFGMR3InsertString(pLunL0, "Driver", "VDE"); RC_CHECK(); 3581 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK(); 3582 3582 if (!bstr.isEmpty()) 3583 3583 { 3584 rc = CFGMR3InsertStringW(pCfg, "Network", bstr); RC_CHECK();3584 rc = CFGMR3InsertStringW(pCfg, "Network", bstr); RC_CHECK(); 3585 3585 networkName = bstr; 3586 3586 }
Note:
See TracChangeset
for help on using the changeset viewer.