ConsoleImpl2.cpp revision fdc51737abe37c84fd160dfed1089fb5c3618095
42576743851c3c956ad7e867e74df1084c30d434vboxsync * VBox Console COM Class implementation
42576743851c3c956ad7e867e74df1084c30d434vboxsync * @remark We've split out the code that the 64-bit VC++ v8 compiler finds
42576743851c3c956ad7e867e74df1084c30d434vboxsync * problematic to optimize so we can disable optimizations and later,
42576743851c3c956ad7e867e74df1084c30d434vboxsync * perhaps, find a real solution for it (like rewriting the code and
42576743851c3c956ad7e867e74df1084c30d434vboxsync * to stop resemble a tonne of spaghetti).
42576743851c3c956ad7e867e74df1084c30d434vboxsync * Copyright (C) 2006-2009 Sun Microsystems, Inc.
42576743851c3c956ad7e867e74df1084c30d434vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
42576743851c3c956ad7e867e74df1084c30d434vboxsync * available from http://www.virtualbox.org. This file is free software;
42576743851c3c956ad7e867e74df1084c30d434vboxsync * you can redistribute it and/or modify it under the terms of the GNU
42576743851c3c956ad7e867e74df1084c30d434vboxsync * General Public License (GPL) as published by the Free Software
42576743851c3c956ad7e867e74df1084c30d434vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
42576743851c3c956ad7e867e74df1084c30d434vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
42576743851c3c956ad7e867e74df1084c30d434vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
42576743851c3c956ad7e867e74df1084c30d434vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
42576743851c3c956ad7e867e74df1084c30d434vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
42576743851c3c956ad7e867e74df1084c30d434vboxsync * additional information or have any questions.
42576743851c3c956ad7e867e74df1084c30d434vboxsync/*******************************************************************************
42576743851c3c956ad7e867e74df1084c30d434vboxsync* Header Files *
42576743851c3c956ad7e867e74df1084c30d434vboxsync*******************************************************************************/
42576743851c3c956ad7e867e74df1084c30d434vboxsync// generated header
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync#if 0 /* enable to play with lots of memory. */
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync# include <hgcm/HGCM.h> /** @todo it should be possible to register a service
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync * extension using a VMMDev callback. */
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync#endif /* VBOX_WITH_GUEST_PROPS */
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync#if defined(RT_OS_SOLARIS) && defined(VBOX_WITH_NETFLT)
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync#if defined(RT_OS_LINUX) && defined(VBOX_WITH_NETFLT)
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync#if defined(RT_OS_FREEBSD) && defined(VBOX_WITH_NETFLT)
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync#if defined(RT_OS_WINDOWS) && defined(VBOX_WITH_NETFLT)
42576743851c3c956ad7e867e74df1084c30d434vboxsync#if !defined(RT_OS_WINDOWS) && defined(VBOX_WITH_NETFLT)
42576743851c3c956ad7e867e74df1084c30d434vboxsync/* Comment out the following line to remove VMWare compatibility hack. */
42576743851c3c956ad7e867e74df1084c30d434vboxsync * Translate IDE StorageControllerType_T to string representation.
42576743851c3c956ad7e867e74df1084c30d434vboxsyncconst char* controllerString(StorageControllerType_T enmType)
42576743851c3c956ad7e867e74df1084c30d434vboxsync return "PIIX3";
42576743851c3c956ad7e867e74df1084c30d434vboxsync return "PIIX4";
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync return "ICH6";
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync return "Unknown";
42576743851c3c956ad7e867e74df1084c30d434vboxsync * VC++ 8 / amd64 has some serious trouble with this function.
42576743851c3c956ad7e867e74df1084c30d434vboxsync * As a temporary measure, we'll drop global optimizations.
42576743851c3c956ad7e867e74df1084c30d434vboxsyncstatic int findEfiRom(IVirtualBox* vbox, FirmwareType_T aFirmwareType, Utf8Str& aEfiRomFile)
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = vbox->CheckFirmwarePresent(aFirmwareType, empty,
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync empty.asOutParam(), aFilePath.asOutParam(), &fPresent);
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync * Construct the VM configuration tree (CFGM).
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync * This is a callback for VMR3Create() call. It is called from CFGMR3Init()
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync * in the emulation thread (EMT). Any per thread COM/XPCOM initialization
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync * is done here.
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync * @param pVM VM handle.
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync * @param pvConsole Pointer to the VMPowerUpTask object.
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync * @return VBox status code.
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync * @note Locks the Console object for writing.
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsyncDECLCALLBACK(int) Console::configConstructor(PVM pVM, void *pvConsole)
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync /* Note: hardcoded assumption about number of slots; see rom bios */
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync bool fFdcEnabled = false;
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync /* initialize COM */
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync LogFlow (("Console::configConstructor(): CoInitializeEx()=%08X\n", hrc));
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync ComObjPtr<Console> pConsole = static_cast <Console *> (pvConsole);
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync AssertComRCReturn (autoCaller.rc(), VERR_ACCESS_DENIED);
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync /* lock the console because we widely use internal fields and methods */
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync AutoWriteLock alock(pConsole COMMA_LOCKVAL_SRC_POS);
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync /* Save the VM pointer in the machine object */
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync#define STR_FREE() do { if (str) { SysFreeString(str); str = NULL; } } while (0)
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync#define RC_CHECK() do { if (RT_FAILURE(rc)) { AssertMsgFailed(("rc=%Rrc\n", rc)); STR_FREE(); return rc; } } while (0)
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync#define H() do { if (FAILED(hrc)) { AssertMsgFailed(("hrc=%#x\n", hrc)); STR_FREE(); return VERR_GENERAL_FAILURE; } } while (0)
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync * Get necessary objects and frequently used parameters.
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync hrc = pMachine->COMGETTER(Parent)(virtualBox.asOutParam()); H();
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync hrc = virtualBox->COMGETTER(Host)(host.asOutParam()); H();
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync hrc = virtualBox->COMGETTER(SystemProperties)(systemProperties.asOutParam()); H();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync hrc = pMachine->COMGETTER(BIOSSettings)(biosSettings.asOutParam()); H();
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync hrc = pMachine->COMGETTER(HardwareUUID)(&str); H();
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync rc = RTUuidFromUtf16(&HardwareUuid, str); RC_CHECK();
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync hrc = pMachine->COMGETTER(MemorySize)(&cRamMBs); H();
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync#if 0 /* enable to play with lots of memory. */
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync cRamMBs = RTStrToUInt64(RTEnvGet("VBOX_RAM_SIZE"));
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync uint32_t const cbRamHole = MM_RAM_HOLE_SIZE_DEFAULT;
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync hrc = pMachine->COMGETTER(OSTypeId)(osTypeId.asOutParam()); H();
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync hrc = biosSettings->COMGETTER(IOAPICEnabled)(&fIOAPIC); H();
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync * Get root node first.
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync * This is the only node in the tree.
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync * Set the root (and VMM) level values.
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertStringW(pRoot, "Name", str); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertBytes(pRoot, "UUID", &HardwareUuid, sizeof(HardwareUuid)); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pRoot, "RamSize", cbRam); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pRoot, "RamHoleSize", cbRamHole); RC_CHECK();
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync rc = CFGMR3InsertInteger(pRoot, "NumCPUs", cCpus); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pRoot, "TimerMillies", 10); RC_CHECK();
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync rc = CFGMR3InsertInteger(pRoot, "RawR3Enabled", 1); /* boolean */ RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pRoot, "RawR0Enabled", 1); /* boolean */ RC_CHECK();
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync /** @todo Config: RawR0, PATMEnabled and CSAMEnabled needs attention later. */
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pRoot, "PATMEnabled", 1); /* boolean */ RC_CHECK();
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync rc = CFGMR3InsertInteger(pRoot, "CSAMEnabled", 1); /* boolean */ RC_CHECK();
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync /* cpuid leaf overrides. */
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync for (unsigned i = 0; i < RT_ELEMENTS(s_auCpuIdRanges); i += 2)
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync for (uint32_t uLeaf = s_auCpuIdRanges[i]; uLeaf < s_auCpuIdRanges[i + 1]; uLeaf++)
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync hrc = pMachine->GetCpuIdLeaf(uLeaf, &ulEax, &ulEbx, &ulEcx, &ulEdx);
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync rc = CFGMR3InsertNodeF(pRoot, &pLeaf, "CPUM/HostCPUID/%RX32", uLeaf); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pLeaf, "eax", ulEax); RC_CHECK();
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync rc = CFGMR3InsertInteger(pLeaf, "ebx", ulEbx); RC_CHECK();
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync rc = CFGMR3InsertInteger(pLeaf, "ecx", ulEcx); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pLeaf, "edx", ulEdx); RC_CHECK();
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync * We must limit CPUID count for Windows NT 4, as otherwise it stops
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync * with error 0x3e (MULTIPROCESSOR_CONFIGURATION_NOT_SUPPORTED).
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync LogRel(("Limiting CPUID leaf count for NT4 guests\n"));
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pRoot, "CPUM", &pCPUM); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pCPUM, "NT4LeafLimit", true); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync /* hardware virtualization extensions */
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_Enabled, &fHWVirtExEnabled); H();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync if (cCpus > 1) /** @todo SMP: This isn't nice, but things won't work on mac otherwise. */
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pRoot, "HwVirtExtForced", fHWVirtExEnabled); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync /* - With more than 4GB PGM will use different RAMRANGE sizes for raw
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync mode and hv mode to optimize lookup times.
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync - With more than one virtual CPU, raw-mode isn't a fallback option. */
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pRoot, "HwVirtExtForced", fHwVirtExtForced); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pRoot, "HWVirtExt", &pHWVirtExt); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pHWVirtExt, "Enabled", 1); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync /* Indicate whether 64-bit guests are supported or not. */
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync /** @todo This is currently only forced off on 32-bit hosts only because it
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync * makes a lof of difference there (REM and Solaris performance).
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync hrc = virtualBox->GetGuestOSType(osTypeId, guestOSType.asOutParam()); H();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync hrc = host->GetProcessorFeature(ProcessorFeature_LongMode,
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync hrc = guestOSType->COMGETTER(Is64Bit)(&fIs64BitGuest); H();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pHWVirtExt, "64bitEnabled", 1); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync#if ARCH_BITS == 32 /* The recompiler must use VBoxREM64 (32-bit host only). */
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pRoot, "REM", &pREM); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pREM, "64bitEnabled", 1); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pHWVirtExt, "64bitEnabled", 0); RC_CHECK();
2d0371c5f4b5bf0651da37a13cd3ae7479dd0432vboxsync /* @todo Not exactly pretty to check strings; VBOXOSTYPE would be better, but that requires quite a bit of API change in Main. */
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync /* Only allow TPR patching for NT, Win2k, XP and Windows Server 2003. (32 bits mode)
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync * We may want to consider adding more guest OSes (Solaris) later on.
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pHWVirtExt, "TPRPatchingEnabled", 1); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync /* HWVirtEx exclusive mode */
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_Exclusive, &fHWVirtExExclusive); H();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pHWVirtExt, "Exclusive", fHWVirtExExclusive); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync /* Nested paging (VT-x/AMD-V) */
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_NestedPaging, &fEnableNestedPaging); H();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pHWVirtExt, "EnableNestedPaging", fEnableNestedPaging); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync /* VPID (VT-x) */
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_VPID, &fEnableVPID); H();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pHWVirtExt, "EnableVPID", fEnableVPID); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync /* Physical Address Extension (PAE) */
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync hrc = pMachine->GetCpuProperty(CpuPropertyType_PAE, &fEnablePAE); H();
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync rc = CFGMR3InsertInteger(pRoot, "EnablePAE", fEnablePAE); RC_CHECK();
42576743851c3c956ad7e867e74df1084c30d434vboxsync /* Synthetic CPU */
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync hrc = pMachine->GetCpuProperty(CpuPropertyType_Synthetic, &fSyntheticCpu); H();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pRoot, "SyntheticCpu", fSyntheticCpu); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync hrc = biosSettings->COMGETTER(PXEDebugEnabled)(&fPXEDebug); H();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync * PDM config.
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync * Load drivers in VBoxC.[so|dll]
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pRoot, "PDM", &pPDM); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pPDM, "Drivers", &pDrivers); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pDrivers, "VBoxC", &pMod); RC_CHECK();
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync // VBoxC is located in the components subdirectory
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync rc = RTPathAppPrivateArch(szPathVBoxC, RTPATH_MAX - sizeof("/components/VBoxC")); AssertRC(rc);
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync rc = CFGMR3InsertString(pMod, "Path", szPathVBoxC); RC_CHECK();
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync rc = CFGMR3InsertString(pMod, "Path", "VBoxC"); RC_CHECK();
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync PCFGMNODE pCfg = NULL; /* /Devices/Dev/.../Config/ */
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync PCFGMNODE pLunL0 = NULL; /* /Devices/Dev/0/LUN#0/ */
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync PCFGMNODE pLunL1 = NULL; /* /Devices/Dev/0/LUN#0/AttachedDriver/ */
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync PCFGMNODE pLunL2 = NULL; /* /Devices/Dev/0/LUN#0/AttachedDriver/Config/ */
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync PCFGMNODE pBiosCfg = NULL; /* /Devices/pcbios/0/Config/ */
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pRoot, "Devices", &pDevices); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pDevices, "pcarch", &pDev); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync * The time offset
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync hrc = biosSettings->COMGETTER(TimeOffset)(&timeOffset); H();
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync rc = CFGMR3InsertNode(pRoot, "TM", &pTMNode); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pTMNode, "UTCOffset", timeOffset * 1000000); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pDevices, "8237A", &pDev); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync * PCI buses.
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pDevices, "pci", &pDev); /* piix3 */ RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pCfg, "IOAPIC", fIOAPIC); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync#if 0 /* enable this to test PCI bridging */
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pDevices, "pcibridge", &pDev); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 14); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pInst, "PCIBusNo", 0);/* -> pci[0] */ RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pDev, "1", &pInst); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 1); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pInst, "PCIBusNo", 1);/* ->pcibridge[0] */ RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pDev, "2", &pInst); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 3); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pInst, "PCIBusNo", 1);/* ->pcibridge[0] */ RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync * Temporary hack for enabling the next three devices and various ACPI features.
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync hrc = pMachine->GetExtraData(Bstr("VBoxInternal2/SupportExtHwProfile"), tmpStr2.asOutParam()); H();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync * High Precision Event Timer (HPET)
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pDevices, "hpet", &pDev); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync * System Management Controller (SMC)
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pDevices, "smc", &pDev); RC_CHECK();
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync * Low Pin Count (LPC) bus
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync /** @todo: implement appropriate getter */
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pDevices, "lpc", &pDev); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync * PS/2 keyboard & mouse.
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pDevices, "pckbd", &pDev); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "KeyboardQueue"); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pCfg, "QueueSize", 64); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertString(pLunL1, "Driver", "MainKeyboard"); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pLunL1, "Config", &pCfg); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)pKeyboard); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pInst, "LUN#1", &pLunL0); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "MouseQueue"); RC_CHECK();
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync rc = CFGMR3InsertInteger(pCfg, "QueueSize", 128); RC_CHECK();
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); RC_CHECK();
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync rc = CFGMR3InsertString(pLunL1, "Driver", "MainMouse"); RC_CHECK();
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync rc = CFGMR3InsertNode(pLunL1, "Config", &pCfg); RC_CHECK();
42576743851c3c956ad7e867e74df1084c30d434vboxsync rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)pMouse); RC_CHECK();
42576743851c3c956ad7e867e74df1084c30d434vboxsync * i8254 Programmable Interval Timer And Dummy Speaker
42576743851c3c956ad7e867e74df1084c30d434vboxsync rc = CFGMR3InsertNode(pDevices, "i8254", &pDev); RC_CHECK();
42576743851c3c956ad7e867e74df1084c30d434vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
42576743851c3c956ad7e867e74df1084c30d434vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync * i8259 Programmable Interrupt Controller.
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pDevices, "i8259", &pDev); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
42576743851c3c956ad7e867e74df1084c30d434vboxsync * Advanced Programmable Interrupt Controller.
42576743851c3c956ad7e867e74df1084c30d434vboxsync * SMP: Each CPU has a LAPIC, but we have a single device representing all LAPICs states,
42576743851c3c956ad7e867e74df1084c30d434vboxsync * thus only single insert
42576743851c3c956ad7e867e74df1084c30d434vboxsync rc = CFGMR3InsertNode(pDevices, "apic", &pDev); RC_CHECK();
42576743851c3c956ad7e867e74df1084c30d434vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
42576743851c3c956ad7e867e74df1084c30d434vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
42576743851c3c956ad7e867e74df1084c30d434vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
42576743851c3c956ad7e867e74df1084c30d434vboxsync rc = CFGMR3InsertInteger(pCfg, "IOAPIC", fIOAPIC); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pCfg, "NumCPUs", cCpus); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync * I/O Advanced Programmable Interrupt Controller.
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pDevices, "ioapic", &pDev); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync * RTC MC146818.
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pDevices, "mc146818", &pDev); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
42576743851c3c956ad7e867e74df1084c30d434vboxsync rc = CFGMR3InsertNode(pDevices, "vga", &pDev); RC_CHECK();
42576743851c3c956ad7e867e74df1084c30d434vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
42576743851c3c956ad7e867e74df1084c30d434vboxsync rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 2); RC_CHECK();
42576743851c3c956ad7e867e74df1084c30d434vboxsync rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK();
42576743851c3c956ad7e867e74df1084c30d434vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync hrc = pMachine->COMGETTER(VRAMSize)(&cVRamMBs); H();
42576743851c3c956ad7e867e74df1084c30d434vboxsync rc = CFGMR3InsertInteger(pCfg, "VRamSize", cVRamMBs * _1M); RC_CHECK();
42576743851c3c956ad7e867e74df1084c30d434vboxsync hrc = pMachine->COMGETTER(MonitorCount)(&cMonitorCount); H();
42576743851c3c956ad7e867e74df1084c30d434vboxsync rc = CFGMR3InsertInteger(pCfg, "MonitorCount", cMonitorCount); RC_CHECK();
42576743851c3c956ad7e867e74df1084c30d434vboxsync#ifdef VBOX_WITH_2X_4GB_ADDR_SPACE /* not safe here yet. */ /** @todo this needs fixing !!! No wonder VGA is slooooooooow on 32-bit darwin! */
42576743851c3c956ad7e867e74df1084c30d434vboxsync rc = CFGMR3InsertInteger(pCfg, "R0Enabled", fHWVirtExEnabled); RC_CHECK();
42576743851c3c956ad7e867e74df1084c30d434vboxsync * BIOS logo
42576743851c3c956ad7e867e74df1084c30d434vboxsync hrc = biosSettings->COMGETTER(LogoFadeIn)(&fFadeIn); H();
42576743851c3c956ad7e867e74df1084c30d434vboxsync rc = CFGMR3InsertInteger(pCfg, "FadeIn", fFadeIn ? 1 : 0); RC_CHECK();
42576743851c3c956ad7e867e74df1084c30d434vboxsync hrc = biosSettings->COMGETTER(LogoFadeOut)(&fFadeOut); H();
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync rc = CFGMR3InsertInteger(pCfg, "FadeOut", fFadeOut ? 1: 0); RC_CHECK();
42576743851c3c956ad7e867e74df1084c30d434vboxsync hrc = biosSettings->COMGETTER(LogoDisplayTime)(&logoDisplayTime); H();
42576743851c3c956ad7e867e74df1084c30d434vboxsync rc = CFGMR3InsertInteger(pCfg, "LogoTime", logoDisplayTime); RC_CHECK();
42576743851c3c956ad7e867e74df1084c30d434vboxsync hrc = biosSettings->COMGETTER(LogoImagePath)(logoImagePath.asOutParam()); H();
42576743851c3c956ad7e867e74df1084c30d434vboxsync rc = CFGMR3InsertString(pCfg, "LogoFile", logoImagePath ? Utf8Str(logoImagePath).c_str() : ""); RC_CHECK();
42576743851c3c956ad7e867e74df1084c30d434vboxsync * Boot menu
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync biosSettings->COMGETTER(BootMenuMode)(&eBootMenuMode);
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync case BIOSBootMenuMode_Disabled: iShowBootMenu = 0; break;
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync case BIOSBootMenuMode_MenuOnly: iShowBootMenu = 1; break;
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pCfg, "ShowBootMenu", iShowBootMenu); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync /* Custom VESA mode list */
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync unsigned cModes = 0;
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync RTStrPrintf(szExtraDataKey, sizeof(szExtraDataKey), "CustomVideoMode%u", iMode);
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync hrc = pMachine->GetExtraData(Bstr(szExtraDataKey), &str); H();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertStringW(pCfg, szExtraDataKey, str); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pCfg, "CustomVideoModes", cModes);
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync /* VESA height reduction */
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync IFramebuffer *pFramebuffer = pConsole->getDisplay()->getFramebuffer();
6998b7cea7c904f33047cd17b05bea760a5839a9vboxsync hrc = pFramebuffer->COMGETTER(HeightReduction)(&ulHeightReduction); H();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync /* If framebuffer is not available, there is no height reduction. */
6998b7cea7c904f33047cd17b05bea760a5839a9vboxsync rc = CFGMR3InsertInteger(pCfg, "HeightReduction", ulHeightReduction); RC_CHECK();
6998b7cea7c904f33047cd17b05bea760a5839a9vboxsync /* Attach the display. */
6998b7cea7c904f33047cd17b05bea760a5839a9vboxsync rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();
6998b7cea7c904f33047cd17b05bea760a5839a9vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "MainDisplay"); RC_CHECK();
6998b7cea7c904f33047cd17b05bea760a5839a9vboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)pDisplay); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync * Firmware.
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync hrc = pMachine->COMGETTER(FirmwareType)(&eFwType); H();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync BOOL fEfiEnabled = (eFwType >= FirmwareType_EFI) && (eFwType <= FirmwareType_EFIDUAL);
6998b7cea7c904f33047cd17b05bea760a5839a9vboxsync rc = CFGMR3InsertNode(pDevices, "pcbios", &pDev); RC_CHECK();
6998b7cea7c904f33047cd17b05bea760a5839a9vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
6998b7cea7c904f33047cd17b05bea760a5839a9vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
6998b7cea7c904f33047cd17b05bea760a5839a9vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pBiosCfg); RC_CHECK();
6998b7cea7c904f33047cd17b05bea760a5839a9vboxsync rc = CFGMR3InsertInteger(pBiosCfg, "RamSize", cbRam); RC_CHECK();
6998b7cea7c904f33047cd17b05bea760a5839a9vboxsync rc = CFGMR3InsertInteger(pBiosCfg, "RamHoleSize", cbRamHole); RC_CHECK();
6998b7cea7c904f33047cd17b05bea760a5839a9vboxsync rc = CFGMR3InsertInteger(pBiosCfg, "NumCPUs", cCpus); RC_CHECK();
6998b7cea7c904f33047cd17b05bea760a5839a9vboxsync rc = CFGMR3InsertString(pBiosCfg, "HardDiskDevice", "piix3ide"); RC_CHECK();
6998b7cea7c904f33047cd17b05bea760a5839a9vboxsync rc = CFGMR3InsertString(pBiosCfg, "FloppyDevice", "i82078"); RC_CHECK();
6998b7cea7c904f33047cd17b05bea760a5839a9vboxsync rc = CFGMR3InsertInteger(pBiosCfg, "IOAPIC", fIOAPIC); RC_CHECK();
6998b7cea7c904f33047cd17b05bea760a5839a9vboxsync rc = CFGMR3InsertInteger(pBiosCfg, "PXEDebug", fPXEDebug); RC_CHECK();
6998b7cea7c904f33047cd17b05bea760a5839a9vboxsync rc = CFGMR3InsertBytes(pBiosCfg, "UUID", &HardwareUuid,sizeof(HardwareUuid));RC_CHECK();
6998b7cea7c904f33047cd17b05bea760a5839a9vboxsync for (ULONG pos = 1; pos <= SchemaDefs::MaxBootPosition; ++pos)
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync hrc = pMachine->GetBootOrder(pos, &bootDevice); H();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync szParamName[sizeof (szParamName) - 2] = ((char (pos - 1)) + '0');
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync AssertMsgFailed(("Invalid bootDevice=%d\n", bootDevice));
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync return VMSetError(pVM, VERR_INVALID_PARAMETER, RT_SRC_POS,
42576743851c3c956ad7e867e74df1084c30d434vboxsync rc = CFGMR3InsertString(pBiosCfg, szParamName, pszBootDevice); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync /* Autodetect firmware type, basing on guest type */
42576743851c3c956ad7e867e74df1084c30d434vboxsync rc = findEfiRom(virtualBox, eFwType, efiRomFile); RC_CHECK();
42576743851c3c956ad7e867e74df1084c30d434vboxsync rc = CFGMR3InsertNode(pDevices, "efi", &pDev); RC_CHECK();
02f73b88a6e96b7f1b8ab0bbb98cfb798b566fbdvboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
42576743851c3c956ad7e867e74df1084c30d434vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
42576743851c3c956ad7e867e74df1084c30d434vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pCfg, "RamSize", cbRam); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pCfg, "RamHoleSize", cbRamHole); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pCfg, "NumCPUs", cCpus); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertString(pCfg, "EfiRom", efiRomFile.raw()); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pCfg, "IOAPIC", fIOAPIC); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertBytes(pCfg, "UUID", &HardwareUuid,sizeof(HardwareUuid));RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertInteger(pCfg, "64BitEntry", f64BitEntry); /* boolean */ RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync * Storage controllers.
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync PCFGMNODE aCtrlNodes[StorageControllerType_I82078 + 1] = {};
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync hrc = pMachine->COMGETTER(StorageControllers)(ComSafeArrayAsOutParam(ctrls)); H();
42576743851c3c956ad7e867e74df1084c30d434vboxsync rc = ctrls[i]->COMGETTER(ControllerType)(&enmCtrlType); H();
a5af4f8add719046631d3d68734b9b6d9ca9d046vboxsync AssertRelease((unsigned)enmCtrlType < RT_ELEMENTS(aCtrlNodes));
42576743851c3c956ad7e867e74df1084c30d434vboxsync rc = ctrls[i]->COMGETTER(Name)(controllerName.asOutParam()); H();
a5af4f8add719046631d3d68734b9b6d9ca9d046vboxsync rc = ctrls[i]->COMGETTER(Instance)(&ulInstance); H();
42576743851c3c956ad7e867e74df1084c30d434vboxsync /* /Devices/<ctrldev>/ */
42576743851c3c956ad7e867e74df1084c30d434vboxsync const char *pszCtrlDev = pConsole->convertControllerTypeToDev(enmCtrlType);
42576743851c3c956ad7e867e74df1084c30d434vboxsync rc = CFGMR3InsertNode(pDevices, pszCtrlDev, &pDev); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync aCtrlNodes[enmCtrlType] = pDev; /* IDE variants are handled in the switch */
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync /* /Devices/<ctrldev>/<instance>/ */
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync rc = CFGMR3InsertNodeF(pDev, &pCtlInst, "%u", ulInstance); RC_CHECK();
cdcfac625bb49f1d4b67aaf8fb8b1cdb69fe49c2vboxsync /* Device config: /Devices/<ctrldev>/<instance>/<values> & /ditto/Config/<values> */
42576743851c3c956ad7e867e74df1084c30d434vboxsync rc = CFGMR3InsertInteger(pCtlInst, "Trusted", 1); RC_CHECK();
switch (enmCtrlType)
if (pBiosCfg)
{ "SataPrimaryMasterLUN", "SataPrimarySlaveLUN", "SataSecondaryMasterLUN", "SataSecondarySlaveLUN" };
if (pBiosCfg)
fFdcEnabled = true;
AssertMsgFailedReturn(("invalid storage controller type: %d\n", enmCtrlType), VERR_GENERAL_FAILURE);
unsigned uLUN;
if (fHostDrive)
STR_FREE();
STR_FREE();
switch (lType)
case DeviceType_DVD:
case DeviceType_Floppy:
case DeviceType_HardDisk:
STR_FREE();
STR_FREE();
bool fHostIP = true;
rc = CFGMR3InsertString(pVDC, name.c_str(), value.c_str()); AssertRC(rc); /** @todo r=bird: why not RC_CHECK() here? (I added the AssertRC.)*/
fHostIP = false;
STR_FREE();
STR_FREE();
rc = CFGMR3InsertString(pVDC, name.c_str(), value.c_str()); AssertRC(rc); /** @todo r=bird: why not RC_HCECK here? (I added the AssertRC.)*/
fHostIP = false;
if (!fHostIP)
#ifdef VMWARE_NET_IN_SLOT_11
bool fSwapSlots3and11 = false;
#ifdef VBOX_WITH_E1000
#ifdef VBOX_WITH_VIRTIO
if (!fEnabled)
switch (adapterType)
#ifdef VBOX_WITH_E1000
#ifdef VBOX_WITH_VIRTIO
if (ulInstance)
#ifdef VMWARE_NET_IN_SLOT_11
fSwapSlots3and11 = true;
switch (adapterType)
rc = CFGMR3InsertInteger(pCfg, "papLeds", (uintptr_t)&pConsole->mapNetworkLeds[ulInstance]); RC_CHECK();
if (serialPort)
if (!fEnabled)
STR_FREE();
if (parallelPort)
if (!fEnabled)
STR_FREE();
if (audioAdapter)
if (enabled)
switch (audioController)
case AudioControllerType_AC97:
case AudioControllerType_SB16:
switch (audioDriver)
case AudioDriverType_Null:
#ifdef RT_OS_WINDOWS
#ifdef VBOX_WITH_WINMM
case AudioDriverType_WinMM:
#ifdef RT_OS_SOLARIS
case AudioDriverType_SolAudio:
#ifdef RT_OS_LINUX
# ifdef VBOX_WITH_ALSA
case AudioDriverType_ALSA:
# ifdef VBOX_WITH_PULSE
case AudioDriverType_Pulse:
case AudioDriverType_OSS:
#ifdef RT_OS_DARWIN
STR_FREE();
if (USBCtlPtr)
if (fEnabled)
#ifdef VBOX_WITH_EHCI
if (fEnabled)
// VBoxManage setextradata "myvm" "VBoxInternal/USB/USBProxy/GlobalConfig/Force11PacketSize" 1
switch (mode)
case ClipboardMode_Disabled:
pConsole->mVMMDev->hgcmHostCall ("VBoxSharedClipboard", VBOX_SHARED_CLIPBOARD_HOST_FN_SET_MODE, 1, &parm);
#ifdef VBOX_WITH_CROGL
if (fEnabled)
rc = pConsole->mVMMDev->hgcmHostCall("VBoxSharedCrOpenGL", SHCRGL_HOST_FN_SET_FRAMEBUFFER, 1, &parm);
#ifdef VBOX_WITH_GUEST_PROPS
size_t i = 0;
++it, ++i)
if (i < cGlobalValues)
if (pszCFGMValueName)
if (pNode)
if ( pszCFGMValue
&& *pszCFGMValue)
AssertLogRelMsgRC(rc, ("failed to insert CFGM value '%s' to key '%s'\n", pszCFGMValue, pszExtraDataKey));
if (fACPI)
fShowCpu = true;
#ifdef VBOX_WITH_HPET
#ifdef VBOX_WITH_SMC
#undef H
return rc;
/*static*/ void Console::setVMRuntimeErrorCallbackF(PVM pVM, void *pvConsole, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, ...)
#define RC_CHECK() do { if (RT_FAILURE(rc)) { AssertMsgFailed(("rc=%Rrc\n", rc)); STR_FREE(); return rc; } } while (0)
#define H() do { if (FAILED(hrc)) { AssertMsgFailed(("hrc=%#x\n", hrc)); STR_FREE(); return VERR_GENERAL_FAILURE; } } while (0)
if (pLunAD)
STR_FREE();
STR_FREE();
switch (eAttachmentType)
if (fSniffer)
STR_FREE();
STR_FREE();
STR_FREE();
switch (hrc)
case VERR_ACCESS_DENIED:
if (fSniffer)
if (fSniffer)
# if defined(RT_OS_DARWIN)
if (!pszColon)
if (pszSpace)
if (pszColon)
AssertLogRelMsgFailed(("NetworkAttachmentType_Bridged: FindByName failed, rc=%Rhrc (0x%x)", hrc, hrc));
STR_FREE();
&pNc,
&pszApp);
hrc = VBoxNetCfgWinGetComponentByGuid(pNc, &GUID_DEVCLASS_NET, (GUID*)hostIFGuid.ptr(), pAdaptorComponent.asOutParam());
wchar_t * pswzBindName;
AssertLogRelMsgFailed(("NetworkAttachmentType_Bridged: WideCharToMultiByte failed, hr=%Rhrc (0x%x) err=%u\n", hrc, hrc, err));
AssertFailed();
AssertLogRelMsgFailed(("NetworkAttachmentType_Bridged: VBoxNetCfgWinGetComponentByGuid failed, hrc (0x%x)", hrc));
/* we're not releasing the INetCfg stuff here since we use it later to figure out whether it is wireless */
if (iSock >= 0)
setVMRuntimeErrorCallbackF(pVM, pThis, 0, "BridgedInterfaceDown", "Bridged interface %s is down. Guest will not be able to use this interface", pszHifName);
RC_CHECK();
# if defined(RT_OS_DARWIN)
/** @todo Come up with a better deal here. Problem is that IHostNetworkInterface is completely useless here. */
if (iSock >= 0)
if (fSharedMacOnWire)
RC_CHECK();
NULL,
NULL);
bool fSharedMacOnWire = false;
&Oid,
sizeof(Oid),
&PhMedium,
sizeof(PhMedium),
&cbResult,
NULL))
fSharedMacOnWire = true;
Assert(winEr == ERROR_INVALID_PARAMETER || winEr == ERROR_NOT_SUPPORTED || winEr == ERROR_BAD_COMMAND);
if (fSharedMacOnWire)
AssertLogRelMsgFailed(("Console::configConstructor: CreateFile failed, err (0x%x), ignoring\n", winEr));
# if defined(RT_OS_SOLARIS)
if (fSniffer)
RC_CHECK();
RC_CHECK();
STR_FREE();
if (fSniffer)
RC_CHECK();
RC_CHECK();
#if defined(RT_OS_WINDOWS)
# ifndef VBOX_WITH_NETFLT
STR_FREE();
&pNc,
&pszApp);
hrc = VBoxNetCfgWinGetComponentByGuid(pNc, &GUID_DEVCLASS_NET, (GUID*)hostIFGuid.ptr(), pAdaptorComponent.asOutParam());
LogRel(("NetworkAttachmentType_HostOnly: VBoxNetCfgWinGetComponentByGuid failed, hrc=%Rhrc (0x%x)\n", hrc, hrc));
wchar_t * pswzBindName;
AssertLogRelMsgFailed(("NetworkAttachmentType_HostOnly: WideCharToMultiByte failed, hr=%Rhrc (0x%x) err=%u\n", hrc, hrc, err));
AssertFailed();
AssertLogRelMsgFailed(("NetworkAttachmentType_HostOnly: VBoxNetCfgWinGetComponentByGuid failed, hrc=%Rhrc (0x%x)\n", hrc, hrc));
hrc = virtualBox->GetExtraData(BstrFmt("HostOnly/%s/IPV6Address", pszHifName), tmpAddr.asOutParam());
hrc = virtualBox->GetExtraData(BstrFmt("HostOnly/%s/IPV6NetMask", pszHifName), tmpMask.asOutParam());
switch (eAttachmentType)
if (fAttachDetach)
if (fEnabled)
#undef H
return VINF_SUCCESS;
#ifdef VBOX_WITH_GUEST_PROPS
&parms[0]);
&parms[0]);
&paParm);
return rc;
#ifdef VBOX_WITH_GUEST_PROPS
if (valuesOut[i])
if (flagsOut[i])
(void *)papszNames,
(void *)papszValues,
(void *)pau64Timestamps,
(void *)papszFlags);
for (unsigned i = 0; i < cProps; ++i)
if (valuesOut[i])
if (flagsOut[i])
return VINF_SUCCESS;
return VERR_NOT_SUPPORTED;