ConsoleImpl2.cpp revision 6e12ccc60ac657fb87e27b7a2b26e0a63bebe024
af062818b47340eef15700d2f0211576ba3506eevboxsync * VBox Console COM Class implementation
af062818b47340eef15700d2f0211576ba3506eevboxsync * @remark We've split out the code that the 64-bit VC++ v8 compiler finds
af062818b47340eef15700d2f0211576ba3506eevboxsync * problematic to optimize so we can disable optimizations and later,
af062818b47340eef15700d2f0211576ba3506eevboxsync * perhaps, find a real solution for it (like rewriting the code and
af062818b47340eef15700d2f0211576ba3506eevboxsync * to stop resemble a tonne of spaghetti).
af062818b47340eef15700d2f0211576ba3506eevboxsync * Copyright (C) 2006-2010 Sun Microsystems, Inc.
af062818b47340eef15700d2f0211576ba3506eevboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
af062818b47340eef15700d2f0211576ba3506eevboxsync * available from http://www.virtualbox.org. This file is free software;
af062818b47340eef15700d2f0211576ba3506eevboxsync * you can redistribute it and/or modify it under the terms of the GNU
af062818b47340eef15700d2f0211576ba3506eevboxsync * General Public License (GPL) as published by the Free Software
af062818b47340eef15700d2f0211576ba3506eevboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
af062818b47340eef15700d2f0211576ba3506eevboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
af062818b47340eef15700d2f0211576ba3506eevboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
af062818b47340eef15700d2f0211576ba3506eevboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
af062818b47340eef15700d2f0211576ba3506eevboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
af062818b47340eef15700d2f0211576ba3506eevboxsync * additional information or have any questions.
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync/*******************************************************************************
4b9d6701570cb98fd36e209314239d104ec584d3vboxsync* Header Files *
4b9d6701570cb98fd36e209314239d104ec584d3vboxsync*******************************************************************************/
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync// generated header
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync#if 0 /* enable to play with lots of memory. */
5112e32d7072e280613921c982a6672f2c859cf3vboxsync# include <hgcm/HGCM.h> /** @todo it should be possible to register a service
5112e32d7072e280613921c982a6672f2c859cf3vboxsync * extension using a VMMDev callback. */
5112e32d7072e280613921c982a6672f2c859cf3vboxsync#endif /* VBOX_WITH_GUEST_PROPS */
5112e32d7072e280613921c982a6672f2c859cf3vboxsync#if defined(RT_OS_SOLARIS) && defined(VBOX_WITH_NETFLT)
af062818b47340eef15700d2f0211576ba3506eevboxsync#if defined(RT_OS_LINUX) && defined(VBOX_WITH_NETFLT)
5112e32d7072e280613921c982a6672f2c859cf3vboxsync#if defined(RT_OS_FREEBSD) && defined(VBOX_WITH_NETFLT)
5112e32d7072e280613921c982a6672f2c859cf3vboxsync#if defined(RT_OS_WINDOWS) && defined(VBOX_WITH_NETFLT)
5112e32d7072e280613921c982a6672f2c859cf3vboxsync#if !defined(RT_OS_WINDOWS) && defined(VBOX_WITH_NETFLT)
5112e32d7072e280613921c982a6672f2c859cf3vboxsync/* Comment out the following line to remove VMWare compatibility hack. */
5112e32d7072e280613921c982a6672f2c859cf3vboxsync * Translate IDE StorageControllerType_T to string representation.
af062818b47340eef15700d2f0211576ba3506eevboxsyncconst char* controllerString(StorageControllerType_T enmType)
5112e32d7072e280613921c982a6672f2c859cf3vboxsync return "PIIX3";
5112e32d7072e280613921c982a6672f2c859cf3vboxsync return "PIIX4";
5112e32d7072e280613921c982a6672f2c859cf3vboxsync return "ICH6";
5112e32d7072e280613921c982a6672f2c859cf3vboxsync return "Unknown";
5112e32d7072e280613921c982a6672f2c859cf3vboxsync * VC++ 8 / amd64 has some serious trouble with this function.
5112e32d7072e280613921c982a6672f2c859cf3vboxsync * As a temporary measure, we'll drop global optimizations.
5112e32d7072e280613921c982a6672f2c859cf3vboxsyncstatic int findEfiRom(IVirtualBox* vbox, FirmwareType_T aFirmwareType, Utf8Str& aEfiRomFile)
5112e32d7072e280613921c982a6672f2c859cf3vboxsync rc = vbox->CheckFirmwarePresent(aFirmwareType, empty,
5112e32d7072e280613921c982a6672f2c859cf3vboxsync empty.asOutParam(), aFilePath.asOutParam(), &fPresent);
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * Construct the VM configuration tree (CFGM).
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * This is a callback for VMR3Create() call. It is called from CFGMR3Init()
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * in the emulation thread (EMT). Any per thread COM/XPCOM initialization
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * is done here.
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * @param pVM VM handle.
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * @param pvConsole Pointer to the VMPowerUpTask object.
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * @return VBox status code.
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * @note Locks the Console object for writing.
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsyncDECLCALLBACK(int) Console::configConstructor(PVM pVM, void *pvConsole)
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync /* Note: hardcoded assumption about number of slots; see rom bios */
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync bool fFdcEnabled = false;
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync /* initialize COM */
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync LogFlow (("Console::configConstructor(): CoInitializeEx()=%08X\n", hrc));
040b4a09341f574825386333398110f4db3e1e51vboxsync ComObjPtr<Console> pConsole = static_cast <Console *> (pvConsole);
040b4a09341f574825386333398110f4db3e1e51vboxsync AssertComRCReturn (autoCaller.rc(), VERR_ACCESS_DENIED);
040b4a09341f574825386333398110f4db3e1e51vboxsync /* lock the console because we widely use internal fields and methods */
040b4a09341f574825386333398110f4db3e1e51vboxsync AutoWriteLock alock(pConsole COMMA_LOCKVAL_SRC_POS);
040b4a09341f574825386333398110f4db3e1e51vboxsync /* Save the VM pointer in the machine object */
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync#define STR_FREE() do { if (str) { SysFreeString(str); str = NULL; } } while (0)
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync#define RC_CHECK() do { if (RT_FAILURE(rc)) { AssertMsgFailed(("rc=%Rrc\n", rc)); STR_FREE(); return rc; } } while (0)
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync#define H() do { if (FAILED(hrc)) { AssertMsgFailed(("hrc=%#x\n", hrc)); STR_FREE(); return VERR_GENERAL_FAILURE; } } while (0)
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync * Get necessary objects and frequently used parameters.
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync hrc = pMachine->COMGETTER(Parent)(virtualBox.asOutParam()); H();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync hrc = virtualBox->COMGETTER(Host)(host.asOutParam()); H();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync hrc = virtualBox->COMGETTER(SystemProperties)(systemProperties.asOutParam()); H();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync hrc = pMachine->COMGETTER(BIOSSettings)(biosSettings.asOutParam()); H();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync hrc = pMachine->COMGETTER(HardwareUUID)(&str); H();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = RTUuidFromUtf16(&HardwareUuid, str); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync hrc = pMachine->COMGETTER(MemorySize)(&cRamMBs); H();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync#if 0 /* enable to play with lots of memory. */
af062818b47340eef15700d2f0211576ba3506eevboxsync cRamMBs = RTStrToUInt64(RTEnvGet("VBOX_RAM_SIZE"));
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync uint32_t const cbRamHole = MM_RAM_HOLE_SIZE_DEFAULT;
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync hrc = pMachine->COMGETTER(OSTypeId)(osTypeId.asOutParam()); H();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync hrc = biosSettings->COMGETTER(IOAPICEnabled)(&fIOAPIC); H();
af062818b47340eef15700d2f0211576ba3506eevboxsync * Get root node first.
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * This is the only node in the tree.
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * Set the root (and VMM) level values.
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertStringW(pRoot, "Name", str); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertBytes(pRoot, "UUID", &HardwareUuid, sizeof(HardwareUuid)); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pRoot, "RamSize", cbRam); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pRoot, "RamHoleSize", cbRamHole); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pRoot, "NumCPUs", cCpus); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pRoot, "TimerMillies", 10); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pRoot, "RawR3Enabled", 1); /* boolean */ RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pRoot, "RawR0Enabled", 1); /* boolean */ RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync /** @todo Config: RawR0, PATMEnabled and CSAMEnabled needs attention later. */
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pRoot, "PATMEnabled", 1); /* boolean */ RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pRoot, "CSAMEnabled", 1); /* boolean */ RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync /* cpuid leaf overrides. */
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync for (unsigned i = 0; i < RT_ELEMENTS(s_auCpuIdRanges); i += 2)
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync for (uint32_t uLeaf = s_auCpuIdRanges[i]; uLeaf < s_auCpuIdRanges[i + 1]; uLeaf++)
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync hrc = pMachine->GetCpuIdLeaf(uLeaf, &ulEax, &ulEbx, &ulEcx, &ulEdx);
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNodeF(pRoot, &pLeaf, "CPUM/HostCPUID/%RX32", uLeaf); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pLeaf, "eax", ulEax); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pLeaf, "ebx", ulEbx); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pLeaf, "ecx", ulEcx); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pLeaf, "edx", ulEdx); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * We must limit CPUID count for Windows NT 4, as otherwise it stops
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * with error 0x3e (MULTIPROCESSOR_CONFIGURATION_NOT_SUPPORTED).
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync LogRel(("Limiting CPUID leaf count for NT4 guests\n"));
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pRoot, "CPUM", &pCPUM); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pCPUM, "NT4LeafLimit", true); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync /* hardware virtualization extensions */
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_Enabled, &fHWVirtExEnabled); H();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync if (cCpus > 1) /** @todo SMP: This isn't nice, but things won't work on mac otherwise. */
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pRoot, "HwVirtExtForced", fHWVirtExEnabled); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync /* - With more than 4GB PGM will use different RAMRANGE sizes for raw
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync mode and hv mode to optimize lookup times.
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync - With more than one virtual CPU, raw-mode isn't a fallback option. */
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pRoot, "HwVirtExtForced", fHwVirtExtForced); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pRoot, "HWVirtExt", &pHWVirtExt); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pHWVirtExt, "Enabled", 1); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync /* Indicate whether 64-bit guests are supported or not. */
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync /** @todo This is currently only forced off on 32-bit hosts only because it
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * makes a lof of difference there (REM and Solaris performance).
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync hrc = virtualBox->GetGuestOSType(osTypeId, guestOSType.asOutParam()); H();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync hrc = host->GetProcessorFeature(ProcessorFeature_LongMode,
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync hrc = guestOSType->COMGETTER(Is64Bit)(&fIs64BitGuest); H();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pHWVirtExt, "64bitEnabled", 1); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync#if ARCH_BITS == 32 /* The recompiler must use VBoxREM64 (32-bit host only). */
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pRoot, "REM", &pREM); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pREM, "64bitEnabled", 1); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pHWVirtExt, "64bitEnabled", 0); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync /* @todo Not exactly pretty to check strings; VBOXOSTYPE would be better, but that requires quite a bit of API change in Main. */
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync /* Only allow TPR patching for NT, Win2k, XP and Windows Server 2003. (32 bits mode)
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * We may want to consider adding more guest OSes (Solaris) later on.
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pHWVirtExt, "TPRPatchingEnabled", 1); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync /* HWVirtEx exclusive mode */
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_Exclusive, &fHWVirtExExclusive); H();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pHWVirtExt, "Exclusive", fHWVirtExExclusive); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync /* Nested paging (VT-x/AMD-V) */
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_NestedPaging, &fEnableNestedPaging); H();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pHWVirtExt, "EnableNestedPaging", fEnableNestedPaging); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync /* VPID (VT-x) */
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_VPID, &fEnableVPID); H();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pHWVirtExt, "EnableVPID", fEnableVPID); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync /* Physical Address Extension (PAE) */
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync hrc = pMachine->GetCpuProperty(CpuPropertyType_PAE, &fEnablePAE); H();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pRoot, "EnablePAE", fEnablePAE); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync /* Synthetic CPU */
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync hrc = pMachine->GetCpuProperty(CpuPropertyType_Synthetic, &fSyntheticCpu); H();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pRoot, "SyntheticCpu", fSyntheticCpu); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync hrc = biosSettings->COMGETTER(PXEDebugEnabled)(&fPXEDebug); H();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * PDM config.
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * Load drivers in VBoxC.[so|dll]
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pRoot, "PDM", &pPDM); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pPDM, "Drivers", &pDrivers); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pDrivers, "VBoxC", &pMod); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync // VBoxC is located in the components subdirectory
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = RTPathAppPrivateArch(szPathVBoxC, RTPATH_MAX - sizeof("/components/VBoxC")); AssertRC(rc);
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertString(pMod, "Path", szPathVBoxC); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertString(pMod, "Path", "VBoxC"); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync PCFGMNODE pCfg = NULL; /* /Devices/Dev/.../Config/ */
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync PCFGMNODE pLunL0 = NULL; /* /Devices/Dev/0/LUN#0/ */
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync PCFGMNODE pLunL1 = NULL; /* /Devices/Dev/0/LUN#0/AttachedDriver/ */
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync PCFGMNODE pLunL2 = NULL; /* /Devices/Dev/0/LUN#0/AttachedDriver/Config/ */
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync PCFGMNODE pBiosCfg = NULL; /* /Devices/pcbios/0/Config/ */
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pRoot, "Devices", &pDevices); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pDevices, "pcarch", &pDev); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * The time offset
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync hrc = biosSettings->COMGETTER(TimeOffset)(&timeOffset); H();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pRoot, "TM", &pTMNode); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pTMNode, "UTCOffset", timeOffset * 1000000); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pDevices, "8237A", &pDev); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * PCI buses.
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pDevices, "pci", &pDev); /* piix3 */ RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pCfg, "IOAPIC", fIOAPIC); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync#if 0 /* enable this to test PCI bridging */
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pDevices, "pcibridge", &pDev); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 14); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pInst, "PCIBusNo", 0);/* -> pci[0] */ RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pDev, "1", &pInst); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 1); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pInst, "PCIBusNo", 1);/* ->pcibridge[0] */ RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pDev, "2", &pInst); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 3); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pInst, "PCIBusNo", 1);/* ->pcibridge[0] */ RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * Temporary hack for enabling the next three devices and various ACPI features.
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync hrc = pMachine->GetExtraData(Bstr("VBoxInternal2/SupportExtHwProfile"), tmpStr2.asOutParam()); H();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * High Precision Event Timer (HPET)
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pDevices, "hpet", &pDev); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * System Management Controller (SMC)
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pDevices, "smc", &pDev); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * Low Pin Count (LPC) bus
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync /** @todo: implement appropriate getter */
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pDevices, "lpc", &pDev); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * PS/2 keyboard & mouse.
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pDevices, "pckbd", &pDev); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "KeyboardQueue"); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync rc = CFGMR3InsertInteger(pCfg, "QueueSize", 64); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertString(pLunL1, "Driver", "MainKeyboard"); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pLunL1, "Config", &pCfg); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)pKeyboard); RC_CHECK();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync rc = CFGMR3InsertNode(pInst, "LUN#1", &pLunL0); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "MouseQueue"); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pCfg, "QueueSize", 128); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync rc = CFGMR3InsertString(pLunL1, "Driver", "MainMouse"); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pLunL1, "Config", &pCfg); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)pMouse); RC_CHECK();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync * i8254 Programmable Interval Timer And Dummy Speaker
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync rc = CFGMR3InsertNode(pDevices, "i8254", &pDev); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync * i8259 Programmable Interrupt Controller.
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync rc = CFGMR3InsertNode(pDevices, "i8259", &pDev); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync * Advanced Programmable Interrupt Controller.
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * SMP: Each CPU has a LAPIC, but we have a single device representing all LAPICs states,
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync * thus only single insert
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync rc = CFGMR3InsertNode(pDevices, "apic", &pDev); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync rc = CFGMR3InsertInteger(pCfg, "IOAPIC", fIOAPIC); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pCfg, "NumCPUs", cCpus); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * I/O Advanced Programmable Interrupt Controller.
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pDevices, "ioapic", &pDev); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync * RTC MC146818.
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync rc = CFGMR3InsertNode(pDevices, "mc146818", &pDev); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync hrc = pMachine->COMGETTER(RTCUseUTC)(&fRTCUseUTC); H();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pCfg, "UseUTC", fRTCUseUTC ? 1 : 0);
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pDevices, "vga", &pDev); RC_CHECK();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 2); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK();
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync hrc = pMachine->COMGETTER(VRAMSize)(&cVRamMBs); H();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pCfg, "VRamSize", cVRamMBs * _1M); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync hrc = pMachine->COMGETTER(MonitorCount)(&cMonitorCount); H();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync rc = CFGMR3InsertInteger(pCfg, "MonitorCount", cMonitorCount); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync#ifdef VBOX_WITH_2X_4GB_ADDR_SPACE /* not safe here yet. */ /** @todo this needs fixing !!! No wonder VGA is slooooooooow on 32-bit darwin! */
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync rc = CFGMR3InsertInteger(pCfg, "R0Enabled", fHWVirtExEnabled); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * BIOS logo
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync hrc = biosSettings->COMGETTER(LogoFadeIn)(&fFadeIn); H();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pCfg, "FadeIn", fFadeIn ? 1 : 0); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync hrc = biosSettings->COMGETTER(LogoFadeOut)(&fFadeOut); H();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "FadeOut", fFadeOut ? 1: 0); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync hrc = biosSettings->COMGETTER(LogoDisplayTime)(&logoDisplayTime); H();
5112e32d7072e280613921c982a6672f2c859cf3vboxsync rc = CFGMR3InsertInteger(pCfg, "LogoTime", logoDisplayTime); RC_CHECK();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync hrc = biosSettings->COMGETTER(LogoImagePath)(logoImagePath.asOutParam()); H();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertString(pCfg, "LogoFile", logoImagePath ? Utf8Str(logoImagePath).c_str() : ""); RC_CHECK();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync * Boot menu
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync biosSettings->COMGETTER(BootMenuMode)(&eBootMenuMode);
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync case BIOSBootMenuMode_Disabled: iShowBootMenu = 0; break;
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync case BIOSBootMenuMode_MenuOnly: iShowBootMenu = 1; break;
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pCfg, "ShowBootMenu", iShowBootMenu); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync /* Custom VESA mode list */
5112e32d7072e280613921c982a6672f2c859cf3vboxsync unsigned cModes = 0;
5112e32d7072e280613921c982a6672f2c859cf3vboxsync RTStrPrintf(szExtraDataKey, sizeof(szExtraDataKey), "CustomVideoMode%u", iMode);
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync hrc = pMachine->GetExtraData(Bstr(szExtraDataKey), &str); H();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync rc = CFGMR3InsertStringW(pCfg, szExtraDataKey, str); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pCfg, "CustomVideoModes", cModes);
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync /* VESA height reduction */
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync IFramebuffer *pFramebuffer = pConsole->getDisplay()->getFramebuffer();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync hrc = pFramebuffer->COMGETTER(HeightReduction)(&ulHeightReduction); H();
5112e32d7072e280613921c982a6672f2c859cf3vboxsync /* If framebuffer is not available, there is no height reduction. */
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pCfg, "HeightReduction", ulHeightReduction); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync /* Attach the display. */
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "MainDisplay"); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)pDisplay); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * Firmware.
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync hrc = pMachine->COMGETTER(FirmwareType)(&eFwType); H();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync BOOL fEfiEnabled = (eFwType >= FirmwareType_EFI) && (eFwType <= FirmwareType_EFIDUAL);
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync rc = CFGMR3InsertNode(pDevices, "pcbios", &pDev); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pBiosCfg); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pBiosCfg, "RamSize", cbRam); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync rc = CFGMR3InsertInteger(pBiosCfg, "RamHoleSize", cbRamHole); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pBiosCfg, "NumCPUs", cCpus); RC_CHECK();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync rc = CFGMR3InsertString(pBiosCfg, "HardDiskDevice", "piix3ide"); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertString(pBiosCfg, "FloppyDevice", "i82078"); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync rc = CFGMR3InsertInteger(pBiosCfg, "IOAPIC", fIOAPIC); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pBiosCfg, "PXEDebug", fPXEDebug); RC_CHECK();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync rc = CFGMR3InsertBytes(pBiosCfg, "UUID", &HardwareUuid,sizeof(HardwareUuid));RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync for (ULONG pos = 1; pos <= SchemaDefs::MaxBootPosition; ++pos)
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync hrc = pMachine->GetBootOrder(pos, &bootDevice); H();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync szParamName[sizeof (szParamName) - 2] = ((char (pos - 1)) + '0');
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync AssertMsgFailed(("Invalid bootDevice=%d\n", bootDevice));
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync return VMSetError(pVM, VERR_INVALID_PARAMETER, RT_SRC_POS,
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertString(pBiosCfg, szParamName, pszBootDevice); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync /* Autodetect firmware type, basing on guest type */
5112e32d7072e280613921c982a6672f2c859cf3vboxsync rc = findEfiRom(virtualBox, eFwType, efiRomFile); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pDevices, "efi", &pDev); RC_CHECK();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pCfg, "RamSize", cbRam); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync rc = CFGMR3InsertInteger(pCfg, "RamHoleSize", cbRamHole); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pCfg, "NumCPUs", cCpus); RC_CHECK();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync rc = CFGMR3InsertString(pCfg, "EfiRom", efiRomFile.raw()); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pCfg, "IOAPIC", fIOAPIC); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync rc = CFGMR3InsertBytes(pCfg, "UUID", &HardwareUuid,sizeof(HardwareUuid));RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pCfg, "64BitEntry", f64BitEntry); /* boolean */ RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * Storage controllers.
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync PCFGMNODE aCtrlNodes[StorageControllerType_LsiLogicSas + 1] = {};
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync hrc = pMachine->COMGETTER(StorageControllers)(ComSafeArrayAsOutParam(ctrls)); H();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = ctrls[i]->COMGETTER(ControllerType)(&enmCtrlType); H();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync AssertRelease((unsigned)enmCtrlType < RT_ELEMENTS(aCtrlNodes));
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = ctrls[i]->COMGETTER(Name)(controllerName.asOutParam()); H();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync rc = ctrls[i]->COMGETTER(Instance)(&ulInstance); H();
af062818b47340eef15700d2f0211576ba3506eevboxsync /* /Devices/<ctrldev>/ */
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync const char *pszCtrlDev = pConsole->convertControllerTypeToDev(enmCtrlType);
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync rc = CFGMR3InsertNode(pDevices, pszCtrlDev, &pDev); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync aCtrlNodes[enmCtrlType] = pDev; /* IDE variants are handled in the switch */
af062818b47340eef15700d2f0211576ba3506eevboxsync /* /Devices/<ctrldev>/<instance>/ */
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNodeF(pDev, &pCtlInst, "%u", ulInstance); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync /* Device config: /Devices/<ctrldev>/<instance>/<values> & /ditto/Config/<values> */
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCtlInst, "Trusted", 1); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pCtlInst, "Config", &pCfg); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCtlInst, "PCIDeviceNo", 20); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCtlInst, "PCIFunctionNo", 0); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync /* Attach the status driver */
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pCtlInst, "LUN#999", &pLunL0); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertInteger(pCfg, "papLeds", (uintptr_t)&pConsole->mapSCSILeds[0]); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertInteger(pCfg, "First", 0); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertInteger(pCfg, "Last", 15); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertInteger(pCtlInst, "PCIDeviceNo", 21); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertInteger(pCtlInst, "PCIFunctionNo", 0); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync /* Attach the status driver */
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertNode(pCtlInst, "LUN#999", &pLunL0); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertInteger(pCfg, "papLeds", (uintptr_t)&pConsole->mapSCSILeds[0]); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertInteger(pCfg, "First", 0); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertInteger(pCfg, "Last", 15); RC_CHECK();
5112e32d7072e280613921c982a6672f2c859cf3vboxsync rc = CFGMR3InsertInteger(pCtlInst, "PCIDeviceNo", 13); RC_CHECK();
5112e32d7072e280613921c982a6672f2c859cf3vboxsync rc = CFGMR3InsertInteger(pCtlInst, "PCIFunctionNo", 0); RC_CHECK();
5112e32d7072e280613921c982a6672f2c859cf3vboxsync hrc = ctrls[i]->COMGETTER(PortCount)(&cPorts); H();
5112e32d7072e280613921c982a6672f2c859cf3vboxsync rc = CFGMR3InsertInteger(pCfg, "PortCount", cPorts); RC_CHECK();
5112e32d7072e280613921c982a6672f2c859cf3vboxsync /* Needed configuration values for the bios. */
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertString(pBiosCfg, "SataHardDiskDevice", "ahci"); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync { "PrimaryMaster", "PrimarySlave", "SecondaryMaster", "SecondarySlave" };
040b4a09341f574825386333398110f4db3e1e51vboxsync { "SataPrimaryMasterLUN", "SataPrimarySlaveLUN", "SataSecondaryMasterLUN", "SataSecondarySlaveLUN" };
040b4a09341f574825386333398110f4db3e1e51vboxsync hrc = ctrls[i]->GetIDEEmulationPort(j, &lPortNumber); H();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertInteger(pCfg, s_apszConfig[j], lPortNumber); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertInteger(pBiosCfg, s_apszBiosConfig[j], lPortNumber); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync /* Attach the status driver */
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertNode(pCtlInst, "LUN#999", &pLunL0); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync AssertRelease(cPorts <= RT_ELEMENTS(pConsole->mapSATALeds));
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertInteger(pCfg, "papLeds", (uintptr_t)&pConsole->mapSATALeds[0]); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertInteger(pCfg, "First", 0); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertInteger(pCfg, "Last", cPorts - 1); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync * IDE (update this when the main interface changes)
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertInteger(pCtlInst, "PCIDeviceNo", 1); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync rc = CFGMR3InsertInteger(pCtlInst, "PCIFunctionNo", 1); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync rc = CFGMR3InsertString(pCfg, "Type", controllerString(enmCtrlType)); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync /* Attach the status driver */
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertNode(pCtlInst, "LUN#999", &pLunL0); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertInteger(pCfg, "papLeds", (uintptr_t)&pConsole->mapIDELeds[0]);RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertInteger(pCfg, "First", 0); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertInteger(pCfg, "Last", 3); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync /* IDE flavors */
040b4a09341f574825386333398110f4db3e1e51vboxsync * i82078 Floppy drive controller
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertInteger(pCfg, "IRQ", 6); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertInteger(pCfg, "DMA", 2); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertInteger(pCfg, "MemMapped", 0 ); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertInteger(pCfg, "IOBase", 0x3f0); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync /* Attach the status driver */
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertNode(pCtlInst, "LUN#999", &pLunL0); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertInteger(pCfg, "papLeds", (uintptr_t)&pConsole->mapFDLeds[0]); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertInteger(pCfg, "First", 0); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertInteger(pCfg, "Last", 0); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertInteger(pCtlInst, "PCIDeviceNo", 21); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertInteger(pCtlInst, "PCIFunctionNo", 0); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertString(pCfg, "ControllerType", "SAS1068"); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync /* Attach the status driver */
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertNode(pCtlInst, "LUN#999", &pLunL0); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertInteger(pCfg, "papLeds", (uintptr_t)&pConsole->mapSCSILeds[0]); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertInteger(pCfg, "First", 0); RC_CHECK();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync rc = CFGMR3InsertInteger(pCfg, "Last", 15); RC_CHECK();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync AssertMsgFailedReturn(("invalid storage controller type: %d\n", enmCtrlType), VERR_GENERAL_FAILURE);
040b4a09341f574825386333398110f4db3e1e51vboxsync /* Attach the media to the storage controllers. */
040b4a09341f574825386333398110f4db3e1e51vboxsync hrc = pMachine->GetMediumAttachmentsOfController(controllerName,
040b4a09341f574825386333398110f4db3e1e51vboxsync hrc = atts [j]->COMGETTER(Medium)(medium.asOutParam()); H();
040b4a09341f574825386333398110f4db3e1e51vboxsync hrc = pConsole->convertBusPortDeviceToLun(enmBus, lPort, lDev, uLUN); H();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync rc = CFGMR3InsertNodeF(pCtlInst, &pLunL0, "LUN#%u", uLUN); RC_CHECK();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync /* SCSI has a another driver between device and block. */
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync if (enmBus == StorageBus_SCSI || enmBus == StorageBus_SAS)
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "SCSI"); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL0); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync hrc = medium->COMGETTER(HostDrive)(&fHostDrive); H();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "HostDVD"); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertStringW(pCfg, "Path", str); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync hrc = atts[j]->COMGETTER(Passthrough)(&fPassthrough); H();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertInteger(pCfg, "Passthrough", !!fPassthrough); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "HostFloppy"); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertStringW(pCfg, "Path", str); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "Block"); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertString(pCfg, "Type", "DVD"); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync rc = CFGMR3InsertInteger(pCfg, "Mountable", 1); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertString(pCfg, "Type", "Floppy 1.44"); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertInteger(pCfg, "Mountable", 1); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertString(pCfg, "Type", "HardDisk"); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertInteger(pCfg, "Mountable", 0); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertString(pLunL1, "Driver", "VD"); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertNode(pLunL1, "Config", &pCfg); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertStringW(pCfg, "Path", str); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync rc = CFGMR3InsertStringW(pCfg, "Format", str); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync /* DVDs are always readonly */
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertInteger(pCfg, "ReadOnly", 1); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync /* Start without exclusive write access to the images. */
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync /** @todo Live Migration: I don't quite like this, we risk screwing up when
040b4a09341f574825386333398110f4db3e1e51vboxsync * we're resuming the VM if some 3rd dude have any of the VDIs open
040b4a09341f574825386333398110f4db3e1e51vboxsync * with write sharing denied. However, if the two VMs are sharing a
040b4a09341f574825386333398110f4db3e1e51vboxsync * image it really is necessary....
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync * So, on the "lock-media" command, the target teleporter should also
040b4a09341f574825386333398110f4db3e1e51vboxsync * make DrvVD undo TempReadOnly. It gets interesting if we fail after
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync * that. Grumble. */
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync else if (pConsole->mMachineState == MachineState_TeleportingIn)
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pCfg, "TempReadOnly", 1); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync /* Pass all custom parameters. */
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync bool fHostIP = true;
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertNode(pCfg, "VDConfig", &pVDC); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertString(pVDC, name.c_str(), value.c_str()); AssertRC(rc); /** @todo r=bird: why not RC_CHECK() here? (I added the AssertRC.)*/
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync /* Create an inversed tree of parents. */
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync hrc = parentMedium->COMGETTER(Parent)(medium.asOutParam()); H();
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync rc = CFGMR3InsertNode(pParent, "Parent", &pCur); RC_CHECK();
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync rc = CFGMR3InsertStringW(pCur, "Path", str); RC_CHECK();
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync rc = CFGMR3InsertStringW(pCur, "Format", str); RC_CHECK();
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync /* Pass all custom parameters. */
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync rc = CFGMR3InsertNode(pCur, "VDConfig", &pVDC); RC_CHECK();
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync rc = CFGMR3InsertString(pVDC, name.c_str(), value.c_str()); AssertRC(rc); /** @todo r=bird: why not RC_HCECK here? (I added the AssertRC.)*/
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync /* Custom code: put marker to not use host IP stack to driver
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync * configuration node. Simplifies life of DrvVD a bit. */
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync rc = CFGMR3InsertInteger(pCfg, "HostIPStack", 0); RC_CHECK();
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync * Network adapters
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync PCFGMNODE pDevPCNet = NULL; /* PCNet-type devices */
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync rc = CFGMR3InsertNode(pDevices, "pcnet", &pDevPCNet); RC_CHECK();
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync PCFGMNODE pDevE1000 = NULL; /* E1000-type devices */
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync rc = CFGMR3InsertNode(pDevices, "e1000", &pDevE1000); RC_CHECK();
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync PCFGMNODE pDevVirtioNet = NULL; /* Virtio network devices */
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync rc = CFGMR3InsertNode(pDevices, "virtio-net", &pDevVirtioNet); RC_CHECK();
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync#endif /* VBOX_WITH_VIRTIO */
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync for (ULONG ulInstance = 0; ulInstance < SchemaDefs::NetworkAdapterCount; ++ulInstance)
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync hrc = pMachine->GetNetworkAdapter(ulInstance, networkAdapter.asOutParam()); H();
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync hrc = networkAdapter->COMGETTER(Enabled)(&fEnabled); H();
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync * The virtual hardware type. Create appropriate device first.
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync hrc = networkAdapter->COMGETTER(AdapterType)(&adapterType); H();
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync#endif /* VBOX_WITH_VIRTIO */
5112e32d7072e280613921c982a6672f2c859cf3vboxsync AssertMsgFailed(("Invalid network adapter type '%d' for slot '%d'",
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync return VMSetError(pVM, VERR_INVALID_PARAMETER, RT_SRC_POS,
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync N_("Invalid network adapter type '%d' for slot '%d'"),
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync rc = CFGMR3InsertNodeF(pDev, &pInst, "%u", ulInstance); RC_CHECK();
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync /* the first network card gets the PCI ID 3, the next 3 gets 8..10,
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync * next 4 get 16..19. */
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync * Dirty hack for PCI slot compatibility with VMWare,
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync * it assigns slot 11 to the first network controller.
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync if (iPciDeviceNo == 3 && adapterType == NetworkAdapterType_I82545EM)
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", iPciDeviceNo); RC_CHECK();
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK();
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync#ifdef VBOX_WITH_2X_4GB_ADDR_SPACE /* not safe here yet. */
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync rc = CFGMR3InsertInteger(pCfg, "R0Enabled", false); RC_CHECK();
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync * The virtual hardware type. PCNet supports two types.
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync rc = CFGMR3InsertInteger(pCfg, "Am79C973", 0); RC_CHECK();
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync rc = CFGMR3InsertInteger(pCfg, "Am79C973", 1); RC_CHECK();
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync rc = CFGMR3InsertInteger(pCfg, "AdapterType", 0); RC_CHECK();
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync rc = CFGMR3InsertInteger(pCfg, "AdapterType", 1); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertInteger(pCfg, "AdapterType", 2); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync * Get the MAC address and convert it to binary representation
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = networkAdapter->COMGETTER(MACAddress)(macAddr.asOutParam()); H();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertBytes(pCfg, "MAC", &Mac, sizeof(Mac)); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync * Check if the cable is supposed to be unplugged
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = networkAdapter->COMGETTER(CableConnected)(&fCableConnected); H();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertInteger(pCfg, "CableConnected", fCableConnected ? 1 : 0); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync * Line speed to report from custom drivers
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = networkAdapter->COMGETTER(LineSpeed)(&ulLineSpeed); H();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "LineSpeed", ulLineSpeed); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync * Attach the status driver.
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pInst, "LUN#999", &pLunL0); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "papLeds", (uintptr_t)&pConsole->mapNetworkLeds[ulInstance]); RC_CHECK();
5112e32d7072e280613921c982a6672f2c859cf3vboxsync * Configure the network card now
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = configNetwork(pConsole, pszAdapterName, ulInstance, 0, networkAdapter,
af062818b47340eef15700d2f0211576ba3506eevboxsync pCfg, pLunL0, pInst, false /*fAttachDetach*/); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync * Serial (UART) Ports
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertNode(pDevices, "serial", &pDev); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync for (ULONG ulInstance = 0; ulInstance < SchemaDefs::SerialPortCount; ++ulInstance)
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = pMachine->GetSerialPort (ulInstance, serialPort.asOutParam()); H();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync hrc = serialPort->COMGETTER(Enabled)(&fEnabled); H();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNodeF(pDev, &pInst, "%u", ulInstance); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertInteger(pCfg, "IRQ", ulIRQ); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync hrc = serialPort->COMGETTER(IOBase)(&ulIOBase); H();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "IOBase", ulIOBase); RC_CHECK();
5112e32d7072e280613921c982a6672f2c859cf3vboxsync hrc = serialPort->COMGETTER(Server)(&fServer); H();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync hrc = serialPort->COMGETTER(HostMode)(&eHostMode); H();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "Char"); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertString(pLunL1, "Driver", "NamedPipe"); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertNode(pLunL1, "Config", &pLunL2); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertStringW(pLunL2, "Location", str); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertInteger(pLunL2, "IsServer", fServer); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "Host Serial"); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pLunL1); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertStringW(pLunL1, "DevicePath", str); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "Char"); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertString(pLunL1, "Driver", "RawFile"); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertNode(pLunL1, "Config", &pLunL2); RC_CHECK();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync rc = CFGMR3InsertStringW(pLunL2, "Location", str); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync * Parallel (LPT) Ports
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertNode(pDevices, "parallel", &pDev); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync for (ULONG ulInstance = 0; ulInstance < SchemaDefs::ParallelPortCount; ++ulInstance)
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = pMachine->GetParallelPort(ulInstance, parallelPort.asOutParam()); H();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync hrc = parallelPort->COMGETTER(Enabled)(&fEnabled); H();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNodeF(pDev, &pInst, "%u", ulInstance); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertInteger(pCfg, "IRQ", ulIRQ); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync hrc = parallelPort->COMGETTER(IOBase)(&ulIOBase); H();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertInteger(pCfg, "IOBase", ulIOBase); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "HostParallel"); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertStringW(pLunL1, "DevicePath", str); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync * VMM Device
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pDevices, "VMMDev", &pDev); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 4); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK();
5112e32d7072e280613921c982a6672f2c859cf3vboxsync hrc = pMachine->COMGETTER(HardwareVersion)(hwVersion.asOutParam()); H();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync if (hwVersion.compare(Bstr("1")) == 0) /* <= 2.0.x */
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync CFGMR3InsertInteger(pCfg, "HeapEnabled", 0); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync /* the VMM device's Main driver */
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();
5112e32d7072e280613921c982a6672f2c859cf3vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "HGCM"); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)pVMMDev); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync * Attach the status driver.
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertNode(pInst, "LUN#999", &pLunL0); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); RC_CHECK();
5112e32d7072e280613921c982a6672f2c859cf3vboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertInteger(pCfg, "papLeds", (uintptr_t)&pConsole->mapSharedFolderLed); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertInteger(pCfg, "First", 0); RC_CHECK();
040b4a09341f574825386333398110f4db3e1e51vboxsync rc = CFGMR3InsertInteger(pCfg, "Last", 0); RC_CHECK();
5112e32d7072e280613921c982a6672f2c859cf3vboxsync * Audio Sniffer Device
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pDevices, "AudioSniffer", &pDev); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync /* the Audio Sniffer device's Main driver */
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "MainAudioSniffer"); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync AudioSniffer *pAudioSniffer = pConsole->mAudioSniffer;
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)pAudioSniffer); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync * AC'97 ICH / SoundBlaster16 audio
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = pMachine->COMGETTER(AudioAdapter)(audioAdapter.asOutParam()); H();
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = audioAdapter->COMGETTER(Enabled)(&enabled); H();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync hrc = audioAdapter->COMGETTER(AudioController)(&audioController); H();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync /* default: ICH AC97 */
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync rc = CFGMR3InsertNode(pDevices, "ichac97", &pDev); RC_CHECK();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* bool */ RC_CHECK();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 5); RC_CHECK();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync /* legacy SoundBlaster16 */
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pDevices, "sb16", &pDev); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* bool */ RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "IRQ", 5); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "DMA", 1); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "DMA16", 5); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "Port", 0x220); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "Version", 0x0405); RC_CHECK();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync /* the Audio driver */
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "AUDIO"); RC_CHECK();
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = audioAdapter->COMGETTER(AudioDriver)(&audioDriver); H();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertString(pCfg, "AudioDriver", "null"); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertString(pCfg, "AudioDriver", "winmm"); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertString(pCfg, "AudioDriver", "dsound"); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync#endif /* RT_OS_WINDOWS */
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertString(pCfg, "AudioDriver", "solaudio"); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertString(pCfg, "AudioDriver", "alsa"); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertString(pCfg, "AudioDriver", "pulse"); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync#endif /* RT_OS_LINUX */
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync#if defined (RT_OS_LINUX) || defined (RT_OS_FREEBSD) || defined(VBOX_WITH_SOLARIS_OSS)
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertString(pCfg, "AudioDriver", "oss"); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertString(pCfg, "AudioDriver", "pulse"); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertString(pCfg, "AudioDriver", "coreaudio"); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertStringW(pCfg, "StreamName", str); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync * The USB Controller.
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync hrc = pMachine->COMGETTER(USBController)(USBCtlPtr.asOutParam());
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync hrc = USBCtlPtr->COMGETTER(Enabled)(&fEnabled); H();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertNode(pDevices, "usb-ohci", &pDev); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 6); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "VUSBRootHub"); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync * Attach the status driver.
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pInst, "LUN#999", &pLunL0); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "papLeds", (uintptr_t)&pConsole->mapUSBLed[0]);RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "First", 0); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "Last", 0); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = USBCtlPtr->COMGETTER(EnabledEhci)(&fEnabled); H();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pDevices, "usb-ehci", &pDev); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* bool */ RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 11); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "VUSBRootHub"); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync * Attach the status driver.
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pInst, "LUN#999", &pLunL0); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "papLeds", (uintptr_t)&pConsole->mapUSBLed[1]);RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "First", 0); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "Last", 0); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync * Global USB options, currently unused as we'll apply the 2.0 -> 1.1 morphing
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync * on a per device level now.
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pRoot, "USB", &pCfg); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pCfg, "USBProxy", &pCfg); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync rc = CFGMR3InsertNode(pCfg, "GlobalConfig", &pCfg); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync // This globally enables the 2.0 -> 1.1 device morphing of proxied devies to keep windows quiet.
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync //rc = CFGMR3InsertInteger(pCfg, "Force11Device", true); RC_CHECK();
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync // The following breaks stuff, but it makes MSDs work in vista. (I include it here so
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync // that it's documented somewhere.) Users needing it can use:
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync // VBoxManage setextradata "myvm" "VBoxInternal/USB/USBProxy/GlobalConfig/Force11PacketSize" 1
af062818b47340eef15700d2f0211576ba3506eevboxsync //rc = CFGMR3InsertInteger(pCfg, "Force11PacketSize", true); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync * Clipboard
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync hrc = pMachine->COMGETTER(ClipboardMode)(&mode); H();
af062818b47340eef15700d2f0211576ba3506eevboxsync /* Load the service */
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = pConsole->mVMMDev->hgcmLoadService ("VBoxSharedClipboard", "VBoxSharedClipboard");
af062818b47340eef15700d2f0211576ba3506eevboxsync LogRel(("VBoxSharedClipboard is not available. rc = %Rrc\n", rc));
af062818b47340eef15700d2f0211576ba3506eevboxsync /* That is not a fatal failure. */
af062818b47340eef15700d2f0211576ba3506eevboxsync /* Setup the service. */
af062818b47340eef15700d2f0211576ba3506eevboxsync LogRel(("VBoxSharedClipboard mode: Guest to Host\n"));
af062818b47340eef15700d2f0211576ba3506eevboxsync parm.u.uint32 = VBOX_SHARED_CLIPBOARD_MODE_GUEST_TO_HOST;
af062818b47340eef15700d2f0211576ba3506eevboxsync LogRel(("VBoxSharedClipboard mode: Host to Guest\n"));
af062818b47340eef15700d2f0211576ba3506eevboxsync parm.u.uint32 = VBOX_SHARED_CLIPBOARD_MODE_HOST_TO_GUEST;
af062818b47340eef15700d2f0211576ba3506eevboxsync LogRel(("VBoxSharedClipboard mode: Bidirectional\n"));
af062818b47340eef15700d2f0211576ba3506eevboxsync parm.u.uint32 = VBOX_SHARED_CLIPBOARD_MODE_BIDIRECTIONAL;
af062818b47340eef15700d2f0211576ba3506eevboxsync pConsole->mVMMDev->hgcmHostCall ("VBoxSharedClipboard", VBOX_SHARED_CLIPBOARD_HOST_FN_SET_MODE, 1, &parm);
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync hrc = pMachine->COMGETTER(Accelerate3DEnabled)(&fEnabled); H();
af062818b47340eef15700d2f0211576ba3506eevboxsync /* Load the service */
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = pConsole->mVMMDev->hgcmLoadService ("VBoxSharedCrOpenGL", "VBoxSharedCrOpenGL");
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync LogRel(("Failed to load Shared OpenGL service %Rrc\n", rc));
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync /* That is not a fatal failure. */
af062818b47340eef15700d2f0211576ba3506eevboxsync /* Setup the service. */
af062818b47340eef15700d2f0211576ba3506eevboxsync parm.u.pointer.addr = pConsole->getDisplay()->getFramebuffer();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = pConsole->mVMMDev->hgcmHostCall("VBoxSharedCrOpenGL", SHCRGL_HOST_FN_SET_FRAMEBUFFER, 1, &parm);
af062818b47340eef15700d2f0211576ba3506eevboxsync AssertMsgFailed(("SHCRGL_HOST_FN_SET_FRAMEBUFFER failed with %Rrc\n", rc));
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = pConsole->mVMMDev->hgcmHostCall("VBoxSharedCrOpenGL", SHCRGL_HOST_FN_SET_VM, 1, &parm);
af062818b47340eef15700d2f0211576ba3506eevboxsync AssertMsgFailed(("SHCRGL_HOST_FN_SET_VM failed with %Rrc\n", rc));
af062818b47340eef15700d2f0211576ba3506eevboxsync * Guest property service
af062818b47340eef15700d2f0211576ba3506eevboxsync#endif /* VBOX_WITH_GUEST_PROPS defined */
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = biosSettings->COMGETTER(ACPIEnabled)(&fACPI); H();
af062818b47340eef15700d2f0211576ba3506eevboxsync /* Always show the CPU leafs when we have multiple VCPUs or when the IO-APIC is enabled.
af062818b47340eef15700d2f0211576ba3506eevboxsync * The Windows SMP kernel needs a CPU leaf or else its idle loop will burn cpu cycles; the
af062818b47340eef15700d2f0211576ba3506eevboxsync * intelppm driver refuses to register an idle state handler.
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = pMachine->COMGETTER(CPUHotPlugEnabled)(&fCpuHotPlug); H();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pDevices, "acpi", &pDev); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "RamSize", cbRam); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "RamHoleSize", cbRamHole); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "NumCPUs", cCpus); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "IOAPIC", fIOAPIC); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "FdcEnabled", fFdcEnabled); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "HpetEnabled", fHpetEnabled); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "SmcEnabled", fSmcEnabled); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "ShowRtc", fExtProfile); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "ShowCpu", fShowCpu); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "CpuHotPlug", fCpuHotPlug); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 7); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "ACPIHost"); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync /* Attach the dummy CPU drivers */
af062818b47340eef15700d2f0211576ba3506eevboxsync for (ULONG iCpuCurr = 1; iCpuCurr < cCpus; iCpuCurr++)
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = pMachine->GetCPUStatus(iCpuCurr, &fCpuAttached); H();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNodeF(pInst, &pLunL0, "LUN#%u", iCpuCurr); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "ACPICpu"); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync * CFGM overlay handling.
af062818b47340eef15700d2f0211576ba3506eevboxsync * Here we check the extra data entries for CFGM values
af062818b47340eef15700d2f0211576ba3506eevboxsync * and create the nodes and insert the values on the fly. Existing
af062818b47340eef15700d2f0211576ba3506eevboxsync * values will be removed and reinserted. CFGM is typed, so by default
af062818b47340eef15700d2f0211576ba3506eevboxsync * we will guess whether it's a string or an integer (byte arrays are
af062818b47340eef15700d2f0211576ba3506eevboxsync * not currently supported). It's possible to override this autodetection
af062818b47340eef15700d2f0211576ba3506eevboxsync * by adding "string:", "integer:" or "bytes:" (future).
af062818b47340eef15700d2f0211576ba3506eevboxsync * We first perform a run on global extra data, then on the machine
af062818b47340eef15700d2f0211576ba3506eevboxsync * extra data to support global settings with local overrides.
af062818b47340eef15700d2f0211576ba3506eevboxsync /** @todo add support for removing nodes and byte blobs. */
af062818b47340eef15700d2f0211576ba3506eevboxsync * Get the next key
af062818b47340eef15700d2f0211576ba3506eevboxsync if (FAILED(hrc = virtualBox->GetExtraDataKeys(ComSafeArrayAsOutParam(aGlobalExtraDataKeys))))
af062818b47340eef15700d2f0211576ba3506eevboxsync AssertMsgFailed(("VirtualBox::GetExtraDataKeys failed with %Rrc\n", hrc));
af062818b47340eef15700d2f0211576ba3506eevboxsync // remember the no. of global values so we can call the correct method below
af062818b47340eef15700d2f0211576ba3506eevboxsync size_t cGlobalValues = aGlobalExtraDataKeys.size();
af062818b47340eef15700d2f0211576ba3506eevboxsync if (FAILED(hrc = pMachine->GetExtraDataKeys(ComSafeArrayAsOutParam(aMachineExtraDataKeys))))
af062818b47340eef15700d2f0211576ba3506eevboxsync AssertMsgFailed(("IMachine::GetExtraDataKeys failed with %Rrc\n", hrc));
af062818b47340eef15700d2f0211576ba3506eevboxsync // build a combined list from global keys...
af062818b47340eef15700d2f0211576ba3506eevboxsync llExtraDataKeys.push_back(Utf8Str(aGlobalExtraDataKeys[i]));
af062818b47340eef15700d2f0211576ba3506eevboxsync // ... and machine keys
af062818b47340eef15700d2f0211576ba3506eevboxsync llExtraDataKeys.push_back(Utf8Str(aMachineExtraDataKeys[i]));
af062818b47340eef15700d2f0211576ba3506eevboxsync for (std::list<Utf8Str>::const_iterator it = llExtraDataKeys.begin();
af062818b47340eef15700d2f0211576ba3506eevboxsync * We only care about keys starting with "VBoxInternal/" (skip "G:" or "M:")
af062818b47340eef15700d2f0211576ba3506eevboxsync const char *pszExtraDataKey = strKey.raw() + sizeof("VBoxInternal/") - 1;
af062818b47340eef15700d2f0211576ba3506eevboxsync // get the value
af062818b47340eef15700d2f0211576ba3506eevboxsync // this is still one of the global values:
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = virtualBox->GetExtraData(Bstr(strKey), strExtraDataValue.asOutParam());
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = pMachine->GetExtraData(Bstr(strKey), strExtraDataValue.asOutParam());
af062818b47340eef15700d2f0211576ba3506eevboxsync LogRel(("Warning: Cannot get extra data key %s, rc = %Rrc\n", strKey.raw(), hrc));
af062818b47340eef15700d2f0211576ba3506eevboxsync * The key will be in the format "Node1/Node2/Value" or simply "Value".
af062818b47340eef15700d2f0211576ba3506eevboxsync * Split the two and get the node, delete the value and create the node
af062818b47340eef15700d2f0211576ba3506eevboxsync * if necessary.
af062818b47340eef15700d2f0211576ba3506eevboxsync const char *pszCFGMValueName = strrchr(pszExtraDataKey, '/');
af062818b47340eef15700d2f0211576ba3506eevboxsync /* terminate the node and advance to the value (Utf8Str might not
af062818b47340eef15700d2f0211576ba3506eevboxsync offically like this but wtf) */
af062818b47340eef15700d2f0211576ba3506eevboxsync /* does the node already exist? */
af062818b47340eef15700d2f0211576ba3506eevboxsync /* create the node */
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pRoot, pszExtraDataKey, &pNode);
af062818b47340eef15700d2f0211576ba3506eevboxsync AssertLogRelMsgRC(rc, ("failed to insert node '%s'\n", pszExtraDataKey));
af062818b47340eef15700d2f0211576ba3506eevboxsync /* root value (no node path). */
af062818b47340eef15700d2f0211576ba3506eevboxsync * Now let's have a look at the value.
af062818b47340eef15700d2f0211576ba3506eevboxsync * Empty strings means that we should remove the value, which we've
af062818b47340eef15700d2f0211576ba3506eevboxsync * already done above.
af062818b47340eef15700d2f0211576ba3506eevboxsync /* check for type prefix first. */
af062818b47340eef15700d2f0211576ba3506eevboxsync if (!strncmp(pszCFGMValue, "string:", sizeof("string:") - 1))
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertString(pNode, pszCFGMValueName, pszCFGMValue + sizeof("string:") - 1);
af062818b47340eef15700d2f0211576ba3506eevboxsync else if (!strncmp(pszCFGMValue, "integer:", sizeof("integer:") - 1))
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = RTStrToUInt64Full(pszCFGMValue + sizeof("integer:") - 1, 0, &u64Value);
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pNode, pszCFGMValueName, u64Value);
af062818b47340eef15700d2f0211576ba3506eevboxsync else if (!strncmp(pszCFGMValue, "bytes:", sizeof("bytes:") - 1))
af062818b47340eef15700d2f0211576ba3506eevboxsync /* auto detect type. */
af062818b47340eef15700d2f0211576ba3506eevboxsync else if (RT_SUCCESS(RTStrToUInt64Full(pszCFGMValue, 0, &u64Value)))
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pNode, pszCFGMValueName, u64Value);
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertString(pNode, pszCFGMValueName, pszCFGMValue);
af062818b47340eef15700d2f0211576ba3506eevboxsync AssertLogRelMsgRC(rc, ("failed to insert CFGM value '%s' to key '%s'\n", pszCFGMValue, pszExtraDataKey));
af062818b47340eef15700d2f0211576ba3506eevboxsync /* Register VM state change handler */
af062818b47340eef15700d2f0211576ba3506eevboxsync int rc2 = VMR3AtStateRegister (pVM, Console::vmstateChangeCallback, pConsole);
af062818b47340eef15700d2f0211576ba3506eevboxsync /* Register VM runtime error handler */
af062818b47340eef15700d2f0211576ba3506eevboxsync rc2 = VMR3AtRuntimeErrorRegister (pVM, Console::setVMRuntimeErrorCallback, pConsole);
af062818b47340eef15700d2f0211576ba3506eevboxsync * Ellipsis to va_list wrapper for calling setVMRuntimeErrorCallback.
af062818b47340eef15700d2f0211576ba3506eevboxsync/*static*/ void Console::setVMRuntimeErrorCallbackF(PVM pVM, void *pvConsole, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, ...)
af062818b47340eef15700d2f0211576ba3506eevboxsync setVMRuntimeErrorCallback(pVM, pvConsole, fFlags, pszErrorId, pszFormat, va);
af062818b47340eef15700d2f0211576ba3506eevboxsync * Construct the Network configuration tree
af062818b47340eef15700d2f0211576ba3506eevboxsync * @returns VBox status code.
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * @param pThis Pointer to the Console object.
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * @param pszDevice The PDM device name.
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * @param uInstance The PDM device instance.
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * @param uLun The PDM LUN number of the drive.
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * @param aNetworkAdapter The network adapter whose attachment needs to be changed
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * @param pCfg Configuration node for the device
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * @param pLunL0 To store the pointer to the LUN#0.
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * @param pInst The instance CFGM node
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * @param fAttachDetach To determine if the network attachment should
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * configuration.
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * @note Locks the Console object for writing.
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync/*static*/ int Console::configNetwork(Console *pThis, const char *pszDevice,
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync AssertComRCReturn(autoCaller.rc(), VERR_ACCESS_DENIED);
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * Locking the object before doing VMR3* calls is quite safe here, since
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * we're on EMT. Write lock is necessary because we indirectly modify the
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * meAttachmentType member.
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync#define STR_FREE() do { if (str) { SysFreeString(str); str = NULL; } } while (0)
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync#define RC_CHECK() do { if (RT_FAILURE(rc)) { AssertMsgFailed(("rc=%Rrc\n", rc)); STR_FREE(); return rc; } } while (0)
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync#define H() do { if (FAILED(hrc)) { AssertMsgFailed(("hrc=%#x\n", hrc)); STR_FREE(); return VERR_GENERAL_FAILURE; } } while (0)
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync hrc = pMachine->COMGETTER(Parent)(virtualBox.asOutParam());
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync hrc = virtualBox->COMGETTER(Host)(host.asOutParam());
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = aNetworkAdapter->COMGETTER(TraceEnabled)(&fSniffer);
af062818b47340eef15700d2f0211576ba3506eevboxsync if (pThis->meAttachmentType[uInstance] == NetworkAttachmentType_NAT)
af062818b47340eef15700d2f0211576ba3506eevboxsync#if !defined(VBOX_WITH_NETFLT) && defined(RT_OS_LINUX)
af062818b47340eef15700d2f0211576ba3506eevboxsync if (pThis->meAttachmentType[uInstance] == NetworkAttachmentType_Bridged)
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync rc = PDMR3DriverDetach(pVM, pszDevice, uInstance, uLun, pszNetDriver, 0, 0 /*fFlags*/);
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync PCFGMNODE pLunAD = CFGMR3GetChildF(pLunL0, "AttachedDriver");
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "NetSniffer"); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = aNetworkAdapter->COMGETTER(TraceFile)(&str); H();
af062818b47340eef15700d2f0211576ba3506eevboxsync if (str) /* check convention for indicating default file. */
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertStringW(pCfg, "File", str); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = PDMR3DeviceDetach(pVM, pszDevice, uInstance, uLun, 0 /*fFlags*/);
af062818b47340eef15700d2f0211576ba3506eevboxsync /* nuke anything which might have been left behind. */
af062818b47340eef15700d2f0211576ba3506eevboxsync CFGMR3RemoveNode(CFGMR3GetChildF(pInst, "LUN#%u", uLun));
af062818b47340eef15700d2f0211576ba3506eevboxsync /* insert the sniffer filter driver. */
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "NetSniffer"); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = aNetworkAdapter->COMGETTER(TraceFile)(&str); H();
af062818b47340eef15700d2f0211576ba3506eevboxsync if (str) /* check convention for indicating default file. */
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertStringW(pCfg, "File", str); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = aNetworkAdapter->COMGETTER(AttachmentType)(&eAttachmentType); H();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL0); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "NAT"); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync /* Configure TFTP prefix and boot filename. */
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = virtualBox->COMGETTER(HomeFolder)(&str); H();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertStringF(pCfg, "TFTPPrefix", "%ls%c%s", str, RTPATH_DELIMITER, "TFTP"); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertStringF(pCfg, "BootFile", "%ls.pxe", str); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = aNetworkAdapter->COMGETTER(NATNetwork)(&str); H();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertStringW(pCfg, "Network", str); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync /* NAT uses its own DHCP implementation */
af062818b47340eef15700d2f0211576ba3506eevboxsync //networkName = Bstr(psz);
af062818b47340eef15700d2f0211576ba3506eevboxsync#if (defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD)) && !defined(VBOX_WITH_NETFLT)
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = pThis->attachToTapInterface(aNetworkAdapter);
af062818b47340eef15700d2f0211576ba3506eevboxsync return VMSetError(pVM, VERR_HOSTIF_INIT_FAILED, RT_SRC_POS, N_(
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync "Failed to open '/dev/net/tun' for read/write access. Please check the "
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync "permissions of that node. Either run 'chmod 0666 /dev/net/tun' or "
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync "change the group of that node and make yourself a member of that group. Make "
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync "sure that these changes are permanent, especially if you are "
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync "using udev"));
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync AssertMsgFailed(("Could not attach to host interface! Bad!\n"));
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync return VMSetError(pVM, VERR_HOSTIF_INIT_FAILED, RT_SRC_POS, N_(
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync "Failed to initialize Host Interface Networking"));
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL0); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "HostInterface"); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "FileHandle", pThis->maTapFD[uInstance]); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync * This is the new VBoxNetFlt+IntNet stuff.
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL0); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = aNetworkAdapter->COMGETTER(HostInterface)(HifName.asOutParam());
af062818b47340eef15700d2f0211576ba3506eevboxsync LogRel(("NetworkAttachmentType_Bridged: COMGETTER(HostInterface) failed, hrc (0x%x)", hrc));
af062818b47340eef15700d2f0211576ba3506eevboxsync /* The name is on the form 'ifX: long name', chop it off at the colon. */
af062818b47340eef15700d2f0211576ba3506eevboxsync char *pszColon = (char *)memchr(szTrunk, ':', sizeof(szTrunk));
af062818b47340eef15700d2f0211576ba3506eevboxsync return VMSetError(pVM, VERR_INTERNAL_ERROR, RT_SRC_POS,
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync N_("Malformed host interface networking name '%ls'"),
af062818b47340eef15700d2f0211576ba3506eevboxsync /* The name is on the form format 'ifX[:1] - long name, chop it off at space. */
af062818b47340eef15700d2f0211576ba3506eevboxsync char *pszSpace = (char *)memchr(szTrunk, ' ', sizeof(szTrunk));
af062818b47340eef15700d2f0211576ba3506eevboxsync * Currently don't bother about malformed names here for the sake of people using
af062818b47340eef15700d2f0211576ba3506eevboxsync * VBoxManage and setting only the NIC name from there. If there is a space we
af062818b47340eef15700d2f0211576ba3506eevboxsync * chop it off and proceed, otherwise just use whatever we've got.
af062818b47340eef15700d2f0211576ba3506eevboxsync /* Chop it off at the colon (zone naming eg: e1000g:1 we need only the e1000g) */
af062818b47340eef15700d2f0211576ba3506eevboxsync char *pszColon = (char *)memchr(szTrunk, ':', sizeof(szTrunk));
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = host->FindHostNetworkInterfaceByName(HifName, hostInterface.asOutParam());
af062818b47340eef15700d2f0211576ba3506eevboxsync AssertLogRelMsgFailed(("NetworkAttachmentType_Bridged: FindByName failed, rc=%Rhrc (0x%x)", hrc, hrc));
af062818b47340eef15700d2f0211576ba3506eevboxsync return VMSetError(pVM, VERR_INTERNAL_ERROR, RT_SRC_POS,
af062818b47340eef15700d2f0211576ba3506eevboxsync N_("Inexistent host networking interface, name '%ls'"),
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync hrc = hostInterface->COMGETTER(InterfaceType)(&eIfType);
af062818b47340eef15700d2f0211576ba3506eevboxsync LogRel(("NetworkAttachmentType_Bridged: COMGETTER(InterfaceType) failed, hrc (0x%x)", hrc));
af062818b47340eef15700d2f0211576ba3506eevboxsync return VMSetError(pVM, VERR_INTERNAL_ERROR, RT_SRC_POS,
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync N_("Interface ('%ls') is not a Bridged Adapter interface"),
af062818b47340eef15700d2f0211576ba3506eevboxsync LogRel(("NetworkAttachmentType_Bridged: COMGETTER(Id) failed, hrc (0x%x)", hrc));
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = VBoxNetCfgWinQueryINetCfg(FALSE /*fGetWriteLock*/,
af062818b47340eef15700d2f0211576ba3506eevboxsync L"VirtualBox",
af062818b47340eef15700d2f0211576ba3506eevboxsync /* get the adapter's INetCfgComponent*/
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = VBoxNetCfgWinGetComponentByGuid(pNc, &GUID_DEVCLASS_NET, (GUID*)hostIFGuid.ptr(), pAdaptorComponent.asOutParam());
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxNetCfgWinReleaseINetCfg(pNc, FALSE /*fHasWriteLock*/);
af062818b47340eef15700d2f0211576ba3506eevboxsync LogRel(("NetworkAttachmentType_Bridged: VBoxNetCfgWinGetComponentByGuid failed, hrc (0x%x)", hrc));
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = pAdaptorComponent->GetBindName(&pswzBindName);
af062818b47340eef15700d2f0211576ba3506eevboxsync int cbFullBindNamePrefix = sizeof(VBOX_WIN_BINDNAME_PREFIX);
af062818b47340eef15700d2f0211576ba3506eevboxsync if (sizeof(szTrunkName) > cbFullBindNamePrefix + cwBindName)
af062818b47340eef15700d2f0211576ba3506eevboxsync if (!WideCharToMultiByte(CP_ACP, 0, pswzBindName, cwBindName, pszTrunkName,
af062818b47340eef15700d2f0211576ba3506eevboxsync sizeof(szTrunkName) - cbFullBindNamePrefix + 1, NULL, NULL))
af062818b47340eef15700d2f0211576ba3506eevboxsync AssertLogRelMsgFailed(("NetworkAttachmentType_Bridged: WideCharToMultiByte failed, hr=%Rhrc (0x%x) err=%u\n", hrc, hrc, err));
af062818b47340eef15700d2f0211576ba3506eevboxsync AssertLogRelMsgFailed(("NetworkAttachmentType_Bridged: insufficient szTrunkName buffer space\n"));
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync /** @todo set appropriate error code */
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync VBoxNetCfgWinReleaseINetCfg(pNc, FALSE /*fHasWriteLock*/);
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync /* we're not freeing the bind name since we'll use it later for detecting wireless*/
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync VBoxNetCfgWinReleaseINetCfg(pNc, FALSE /*fHasWriteLock*/);
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync AssertLogRelMsgFailed(("NetworkAttachmentType_Bridged: VBoxNetCfgWinGetComponentByGuid failed, hrc (0x%x)", hrc));
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync /* we're not releasing the INetCfg stuff here since we use it later to figure out whether it is wireless */
af062818b47340eef15700d2f0211576ba3506eevboxsync# elif defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD)
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync * If we bridge to a tap interface open it the `old' direct way.
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync * This works and performs better than bridging a physical
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync * interface via the current FreeBSD vboxnetflt implementation.
af062818b47340eef15700d2f0211576ba3506eevboxsync if (!strncmp(pszHifName, "tap", sizeof "tap" - 1)) {
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync hrc = pThis->attachToTapInterface(aNetworkAdapter);
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync return VMSetError(pVM, VERR_HOSTIF_INIT_FAILED, RT_SRC_POS, N_(
af062818b47340eef15700d2f0211576ba3506eevboxsync "Failed to open '/dev/%s' for read/write access. Please check the "
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync "permissions of that node, and that the net.link.tap.user_open "
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync "sysctl is set. Either run 'chmod 0666 /dev/%s' or "
af062818b47340eef15700d2f0211576ba3506eevboxsync "change the group of that node to vboxusers and make yourself "
af062818b47340eef15700d2f0211576ba3506eevboxsync "a member of that group. Make sure that these changes are permanent."), pszHifName, pszHifName);
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync AssertMsgFailed(("Could not attach to tap interface! Bad!\n"));
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync return VMSetError(pVM, VERR_HOSTIF_INIT_FAILED, RT_SRC_POS, N_(
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync "Failed to initialize Host Interface Networking"));
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "HostInterface"); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "FileHandle", pThis->maTapFD[uInstance]); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync /** @todo Check for malformed names. */
af062818b47340eef15700d2f0211576ba3506eevboxsync /* Issue a warning if the interface is down */
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync strncpy(Req.ifr_name, pszHifName, sizeof(Req.ifr_name) - 1);
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync setVMRuntimeErrorCallbackF(pVM, pThis, 0, "BridgedInterfaceDown", "Bridged interface %s is down. Guest will not be able to use this interface", pszHifName);
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "IntNet"); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertString(pCfg, "Trunk", pszTrunk); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pCfg, "TrunkType", kIntNetTrunkType_NetFlt);
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync RTStrPrintf(szNetwork, sizeof(szNetwork), "HostInterfaceNetworking-%s", pszHifName);
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertString(pCfg, "Network", szNetwork); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync /** @todo Come up with a better deal here. Problem is that IHostNetworkInterface is completely useless here. */
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pCfg, "SharedMacOnWire", true); RC_CHECK();
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync bool fSharedMacOnWire = ioctl(iSock, SIOCGIWNAME, &WRq) >= 0;
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pCfg, "SharedMacOnWire", true);
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync strncpy(WReq.i_name, pszHifName, sizeof(WReq.i_name));
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync bool fSharedMacOnWire = ioctl(iSock, SIOCG80211, &WReq) >= 0;
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync rc = CFGMR3InsertInteger(pCfg, "SharedMacOnWire", true);
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync /* we are getting the medium type via IOCTL_NDIS_QUERY_GLOBAL_STATS Io Control
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * there is a pretty long way till there though since we need to obtain the symbolic link name
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync * for the adapter device we are going to query given the device Guid */
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync /* prepend the "\\\\.\\" to the bind name to obtain the link name */
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync wcscpy((wchar_t*)(((char*)FileName) + sizeof(DEVNAME_PREFIX) - sizeof(FileName[0])), pswzBindName);
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync /* open the device */
ee6bcfc59fe3b0230aad85e2ef63d0402b7719b2vboxsync GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync /* now issue the OID_GEN_PHYSICAL_MEDIUM query */
af062818b47340eef15700d2f0211576ba3506eevboxsync /* that was simple, now examine PhMedium */
af062818b47340eef15700d2f0211576ba3506eevboxsync LogRel(("Console::configConstructor: DeviceIoControl failed, err (0x%x), ignoring\n", winEr));
af062818b47340eef15700d2f0211576ba3506eevboxsync Assert(winEr == ERROR_INVALID_PARAMETER || winEr == ERROR_NOT_SUPPORTED || winEr == ERROR_BAD_COMMAND);
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "SharedMacOnWire", true); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync AssertLogRelMsgFailed(("Console::configConstructor: CreateFile failed, err (0x%x), ignoring\n", winEr));
af062818b47340eef15700d2f0211576ba3506eevboxsync /* release the pNc finally */
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxNetCfgWinReleaseINetCfg(pNc, FALSE /*fHasWriteLock*/);
af062818b47340eef15700d2f0211576ba3506eevboxsync /** @todo PORTME: wireless detection */
af062818b47340eef15700d2f0211576ba3506eevboxsync# if 0 /* bird: this is a bit questionable and might cause more trouble than its worth. */
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync /* Zone access restriction, don't allow snopping the global zone. */
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "IgnoreAllPromisc", true); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync#elif defined(RT_OS_WINDOWS) /* not defined NetFlt */
af062818b47340eef15700d2f0211576ba3506eevboxsync /* NOTHING TO DO HERE */
af062818b47340eef15700d2f0211576ba3506eevboxsync/// @todo aleksey: is there anything to be done here?
af062818b47340eef15700d2f0211576ba3506eevboxsync/** @todo FreeBSD: Check out this later (HIF networking). */
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = aNetworkAdapter->COMGETTER(InternalNetwork)(&str); H();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL0);
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "IntNet"); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertStringW(pCfg, "Network", str); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "TrunkType", kIntNetTrunkType_WhateverNone); RC_CHECK();
5112e32d7072e280613921c982a6672f2c859cf3vboxsync rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL0);
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "IntNet"); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = aNetworkAdapter->COMGETTER(HostInterface)(HifName.asOutParam());
af062818b47340eef15700d2f0211576ba3506eevboxsync LogRel(("NetworkAttachmentType_HostOnly: COMGETTER(HostInterface) failed, hrc (0x%x)\n", hrc));
af062818b47340eef15700d2f0211576ba3506eevboxsync LogRel(("NetworkAttachmentType_HostOnly: COMGETTER(HostInterface): %s\n", pszHifName));
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = host->FindHostNetworkInterfaceByName(HifName, hostInterface.asOutParam());
af062818b47340eef15700d2f0211576ba3506eevboxsync LogRel(("NetworkAttachmentType_HostOnly: FindByName failed, rc (0x%x)\n", rc));
af062818b47340eef15700d2f0211576ba3506eevboxsync return VMSetError(pVM, VERR_INTERNAL_ERROR, RT_SRC_POS,
af062818b47340eef15700d2f0211576ba3506eevboxsync N_("Inexistent host networking interface, name '%ls'"),
af062818b47340eef15700d2f0211576ba3506eevboxsync RTStrPrintf(szNetwork, sizeof(szNetwork), "HostInterfaceNetworking-%s", pszHifName);
af062818b47340eef15700d2f0211576ba3506eevboxsync LogRel(("NetworkAttachmentType_HostOnly: Not Implemented\n"));
af062818b47340eef15700d2f0211576ba3506eevboxsync# else /* defined VBOX_WITH_NETFLT*/
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync /** @todo r=bird: Put this in a function. */
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = hostInterface->COMGETTER(InterfaceType)(&eIfType);
af062818b47340eef15700d2f0211576ba3506eevboxsync LogRel(("NetworkAttachmentType_HostOnly: COMGETTER(InterfaceType) failed, hrc (0x%x)\n", hrc));
040b4a09341f574825386333398110f4db3e1e51vboxsync return VMSetError(pVM, VERR_INTERNAL_ERROR, RT_SRC_POS,
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync N_("Interface ('%ls') is not a Host-Only Adapter interface"),
af062818b47340eef15700d2f0211576ba3506eevboxsync LogRel(("NetworkAttachmentType_HostOnly: COMGETTER(Id) failed, hrc (0x%x)\n", hrc));
af062818b47340eef15700d2f0211576ba3506eevboxsync L"VirtualBox",
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync /* get the adapter's INetCfgComponent*/
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync hrc = VBoxNetCfgWinGetComponentByGuid(pNc, &GUID_DEVCLASS_NET, (GUID*)hostIFGuid.ptr(), pAdaptorComponent.asOutParam());
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxNetCfgWinReleaseINetCfg(pNc, FALSE /*fHasWriteLock*/);
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync LogRel(("NetworkAttachmentType_HostOnly: VBoxNetCfgWinGetComponentByGuid failed, hrc=%Rhrc (0x%x)\n", hrc, hrc));
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync hrc = pAdaptorComponent->GetBindName(&pswzBindName);
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync int cbFullBindNamePrefix = sizeof(VBOX_WIN_BINDNAME_PREFIX);
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync if (sizeof(szTrunkName) > cbFullBindNamePrefix + cwBindName)
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync if (!WideCharToMultiByte(CP_ACP, 0, pswzBindName, cwBindName, pszTrunkName,
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync sizeof(szTrunkName) - cbFullBindNamePrefix + 1, NULL, NULL))
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync AssertLogRelMsgFailed(("NetworkAttachmentType_HostOnly: WideCharToMultiByte failed, hr=%Rhrc (0x%x) err=%u\n", hrc, hrc, err));
af062818b47340eef15700d2f0211576ba3506eevboxsync AssertLogRelMsgFailed(("NetworkAttachmentType_HostOnly: insufficient szTrunkName buffer space\n"));
040b4a09341f574825386333398110f4db3e1e51vboxsync /** @todo set appropriate error code */
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxNetCfgWinReleaseINetCfg(pNc, FALSE /*fHasWriteLock*/);
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxNetCfgWinReleaseINetCfg(pNc, FALSE /*fHasWriteLock*/);
af062818b47340eef15700d2f0211576ba3506eevboxsync AssertLogRelMsgFailed(("NetworkAttachmentType_HostOnly: VBoxNetCfgWinGetComponentByGuid failed, hrc=%Rhrc (0x%x)\n", hrc, hrc));
af062818b47340eef15700d2f0211576ba3506eevboxsync /* release the pNc finally */
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxNetCfgWinReleaseINetCfg(pNc, FALSE /*fHasWriteLock*/);
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "TrunkType", kIntNetTrunkType_NetAdp); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertString(pCfg, "Trunk", pszTrunk); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertString(pCfg, "Network", szNetwork); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync# endif /* defined VBOX_WITH_NETFLT*/
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertString(pCfg, "Trunk", pszHifName); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertString(pCfg, "Network", szNetwork); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertInteger(pCfg, "TrunkType", kIntNetTrunkType_NetAdp); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertString(pCfg, "Trunk", pszHifName); RC_CHECK();
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = CFGMR3InsertString(pCfg, "Network", szNetwork); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync rc = CFGMR3InsertInteger(pCfg, "TrunkType", kIntNetTrunkType_NetFlt); RC_CHECK();
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync#if !defined(RT_OS_WINDOWS) && defined(VBOX_WITH_NETFLT)
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync hrc = virtualBox->GetExtraData(BstrFmt("HostOnly/%s/IPAddress", pszHifName), tmpAddr.asOutParam());
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync hrc = virtualBox->GetExtraData(BstrFmt("HostOnly/%s/IPNetMask", pszHifName), tmpMask.asOutParam());
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync hrc = hostInterface->EnableStaticIpConfig(tmpAddr, tmpMask);
af062818b47340eef15700d2f0211576ba3506eevboxsync /* Grab the IP number from the 'vboxnetX' instance number (see netif.h) */
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = hostInterface->EnableStaticIpConfig(getDefaultIPv4Address(Bstr(pszHifName)),
af062818b47340eef15700d2f0211576ba3506eevboxsync ComAssertComRC(hrc); /** @todo r=bird: Why this isn't fatal? (H()) */
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = virtualBox->GetExtraData(BstrFmt("HostOnly/%s/IPV6Address", pszHifName), tmpAddr.asOutParam());
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = virtualBox->GetExtraData(BstrFmt("HostOnly/%s/IPV6NetMask", pszHifName), tmpMask.asOutParam());
af062818b47340eef15700d2f0211576ba3506eevboxsync if (SUCCEEDED(hrc) && !tmpAddr.isEmpty() && !tmpMask.isEmpty())
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = hostInterface->EnableStaticIpConfigV6(tmpAddr, Utf8Str(tmpMask).toUInt32());
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync ComAssertComRC(hrc); /** @todo r=bird: Why this isn't fatal? (H()) */
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync * Attempt to attach the driver.
af062818b47340eef15700d2f0211576ba3506eevboxsync rc = PDMR3DriverAttach(pVM, pszDevice, uInstance, uLun, 0 /*fFlags*/, NULL /* ppBase */);
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync /** @todo pritesh: get the dhcp server name from the
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync * previous network configuration and then stop the server
114410893548b9522c46fdcbd8f63385eb8bfb68vboxsync * else it may conflict with the dhcp server running with
5112e32d7072e280613921c982a6672f2c859cf3vboxsync * the current attachment type
5112e32d7072e280613921c982a6672f2c859cf3vboxsync /* Stop the hostonly DHCP Server */
5112e32d7072e280613921c982a6672f2c859cf3vboxsync * Until we implement service reference counters DHCP Server will be stopped
5112e32d7072e280613921c982a6672f2c859cf3vboxsync * by DHCPServerRunner destructor.
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = virtualBox->FindDHCPServerByNetworkName(networkName.mutableRaw(), dhcpServer.asOutParam());
af062818b47340eef15700d2f0211576ba3506eevboxsync /* there is a DHCP server available for this network */
af062818b47340eef15700d2f0211576ba3506eevboxsync LogRel(("DHCP svr: COMGETTER(Enabled) failed, hrc (%Rhrc)", hrc));
af062818b47340eef15700d2f0211576ba3506eevboxsync hrc = dhcpServer->Start(networkName, trunkName, trunkType);
5112e32d7072e280613921c982a6672f2c859cf3vboxsync pThis->meAttachmentType[uInstance] = eAttachmentType;
af062818b47340eef15700d2f0211576ba3506eevboxsync * Set an array of guest properties
af062818b47340eef15700d2f0211576ba3506eevboxsyncstatic void configSetProperties(VMMDev * const pVMMDev, void *names,
af062818b47340eef15700d2f0211576ba3506eevboxsync parms[0].u.pointer.size = 0; /* We don't actually care. */
af062818b47340eef15700d2f0211576ba3506eevboxsync parms[1].u.pointer.size = 0; /* We don't actually care. */
af062818b47340eef15700d2f0211576ba3506eevboxsync parms[2].u.pointer.size = 0; /* We don't actually care. */
5112e32d7072e280613921c982a6672f2c859cf3vboxsync parms[3].u.pointer.size = 0; /* We don't actually care. */
af062818b47340eef15700d2f0211576ba3506eevboxsync pVMMDev->hgcmHostCall ("VBoxGuestPropSvc", guestProp::SET_PROPS_HOST, 4,
af062818b47340eef15700d2f0211576ba3506eevboxsync * Set a single guest property
af062818b47340eef15700d2f0211576ba3506eevboxsyncstatic void configSetProperty(VMMDev * const pVMMDev, const char *pszName,
af062818b47340eef15700d2f0211576ba3506eevboxsync pVMMDev->hgcmHostCall ("VBoxGuestPropSvc", guestProp::SET_PROP_HOST, 3,
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync * Set the global flags value by calling the service
af062818b47340eef15700d2f0211576ba3506eevboxsync * @returns the status returned by the call to the service
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync * @param pTable the service instance handle
af062818b47340eef15700d2f0211576ba3506eevboxsync * @param eFlags the flags to set
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsyncint configSetGlobalPropertyFlags(VMMDev * const pVMMDev,
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync int rc = pVMMDev->hgcmHostCall ("VBoxGuestPropSvc",
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync Log(("Failed to set the global flags \"%s\".\n", szFlags));
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync#endif /* VBOX_WITH_GUEST_PROPS */
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync * Set up the Guest Property service, populate it with properties read from
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync * the machine XML and set a couple of initial properties.
554f00fe75489f3f3ce7fbb6d126ce1d2c5c922cvboxsync/* static */ int Console::configGuestProperties(void *pvConsole)
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync ComObjPtr<Console> pConsole = static_cast <Console *> (pvConsole);
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync /* Load the service */
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync int rc = pConsole->mVMMDev->hgcmLoadService ("VBoxGuestPropSvc", "VBoxGuestPropSvc");
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync LogRel(("VBoxGuestPropSvc is not available. rc = %Rrc\n", rc));
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync /* That is not a fatal failure. */
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync * Initialize built-in properties that can be changed and saved.
a3133ef29cdf3656735d569fd64e54c9286effc0vboxsync * These are typically transient properties that the guest cannot
589fd26cedb2b4ebbed14f2964cad03cc8ebbca2vboxsync /* Sysprep execution by VBoxService. */
5112e32d7072e280613921c982a6672f2c859cf3vboxsync "TRANSIENT, RDONLYGUEST");
5112e32d7072e280613921c982a6672f2c859cf3vboxsync "TRANSIENT, RDONLYGUEST");
5112e32d7072e280613921c982a6672f2c859cf3vboxsync * Pull over the properties from the server.
5112e32d7072e280613921c982a6672f2c859cf3vboxsync hrc = pConsole->mControl->PullGuestProperties(ComSafeArrayAsOutParam(namesOut),
5112e32d7072e280613921c982a6672f2c859cf3vboxsync AssertMsgReturn(SUCCEEDED(hrc), ("hrc=%Rrc\n", hrc), VERR_GENERAL_FAILURE);
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;