ConsoleImpl2.cpp revision cc766b66f7a660b01aca8fddb36e84327c8f2e07
5b281ba489ca18f0380d7efc7a5108b606cce449vboxsync * VBox Console COM Class implementation
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * @remark We've split out the code that the 64-bit VC++ v8 compiler
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * finds problematic to optimize so we can disable optimizations
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * and later, perhaps, find a real solution for it.
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * Copyright (C) 2006-2007 Sun Microsystems, Inc.
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * available from http://www.virtualbox.org. This file is free software;
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * you can redistribute it and/or modify it under the terms of the GNU
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * General Public License (GPL) as published by the Free Software
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * additional information or have any questions.
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync/*******************************************************************************
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync* Header Files *
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync*******************************************************************************/
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync// generated header
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync# include <hgcm/HGCM.h> /** @todo it should be possible to register a service
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * extension using a VMMDev callback. */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync#endif /* VBOX_WITH_GUEST_PROPS */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync#if defined(RT_OS_SOLARIS) && defined(VBOX_WITH_NETFLT)
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync#if defined(RT_OS_LINUX) && defined(VBOX_WITH_NETFLT)
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * VC++ 8 / amd64 has some serious trouble with this function.
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * As a temporary measure, we'll drop global optimizations.
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * Construct the VM configuration tree (CFGM).
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * This is a callback for VMR3Create() call. It is called from CFGMR3Init()
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * in the emulation thread (EMT). Any per thread COM/XPCOM initialization
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * is done here.
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * @param pVM VM handle.
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * @param pvConsole Pointer to the VMPowerUpTask object.
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * @return VBox status code.
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * @note Locks the Console object for writing.
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncDECLCALLBACK(int) Console::configConstructor(PVM pVM, void *pvConsole)
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync /* Note: hardcoded assumption about number of slots; see rom bios */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync /* initialize COM */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync LogFlow (("Console::configConstructor(): CoInitializeEx()=%08X\n", hrc));
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync ComObjPtr <Console> pConsole = static_cast <Console *> (pvConsole);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync AssertComRCReturn (autoCaller.rc(), VERR_ACCESS_DENIED);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync /* lock the console because we widely use internal fields and methods */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync Bstr bstr; /* use this bstr when calling COM methods instead
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync of str as it manages memory! */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync#define STR_CONV() do { rc = RTUtf16ToUtf8(str, &psz); RC_CHECK(); } while (0)
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync#define STR_FREE() do { if (str) { SysFreeString(str); str = NULL; } if (psz) { RTStrFree(psz); psz = NULL; } } while (0)
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync#define RC_CHECK() do { if (RT_FAILURE(rc)) { AssertMsgFailed(("rc=%Rrc\n", rc)); STR_FREE(); return rc; } } while (0)
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync#define H() do { if (FAILED(hrc)) { AssertMsgFailed(("hrc=%#x\n", hrc)); STR_FREE(); return VERR_GENERAL_FAILURE; } } while (0)
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * Get necessary objects and frequently used parameters.
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync hrc = pMachine->COMGETTER(Parent)(virtualBox.asOutParam()); H();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync hrc = virtualBox->COMGETTER(Host)(host.asOutParam()); H();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync hrc = virtualBox->COMGETTER(SystemProperties)(systemProperties.asOutParam()); H();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync hrc = pMachine->COMGETTER(BIOSSettings)(biosSettings.asOutParam()); H();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync hrc = pMachine->COMGETTER(Id)(uuid.asOutParam()); H();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync hrc = pMachine->COMGETTER(MemorySize)(&cRamMBs); H();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * Get root node first.
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * This is the only node in the tree.
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * Set the root level values.
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertString(pRoot, "Name", psz); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertBytes(pRoot, "UUID", pUuid, sizeof(*pUuid)); RC_CHECK();
c5d2523548cc57504b829f53f1362b848a84542cvboxsync rc = CFGMR3InsertInteger(pRoot, "RamSize", cRamMBs * _1M); RC_CHECK();
c5d2523548cc57504b829f53f1362b848a84542cvboxsync rc = CFGMR3InsertInteger(pRoot, "NumCPUs", cCpus); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertInteger(pRoot, "TimerMillies", 10); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertInteger(pRoot, "RawR3Enabled", 1); /* boolean */ RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertInteger(pRoot, "RawR0Enabled", 1); /* boolean */ RC_CHECK();
c5d2523548cc57504b829f53f1362b848a84542cvboxsync /** @todo Config: RawR0, PATMEnabled and CASMEnabled needs attention later. */
c5d2523548cc57504b829f53f1362b848a84542cvboxsync rc = CFGMR3InsertInteger(pRoot, "PATMEnabled", 1); /* boolean */ RC_CHECK();
c5d2523548cc57504b829f53f1362b848a84542cvboxsync rc = CFGMR3InsertInteger(pRoot, "CSAMEnabled", 1); /* boolean */ RC_CHECK();
c5d2523548cc57504b829f53f1362b848a84542cvboxsync /* hardware virtualization extensions */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync hrc = pMachine->COMGETTER(HWVirtExEnabled)(&hwVirtExEnabled); H();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync /* check the default value */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync hrc = systemProperties->COMGETTER(HWVirtExEnabled)(&fHWVirtExEnabled); H();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync fHWVirtExEnabled = (hwVirtExEnabled == TSBool_True);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync#ifndef RT_OS_DARWIN /** @todo Implement HWVirtExt on darwin. See #1865. */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertNode(pRoot, "HWVirtExt", &pHWVirtExt); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertInteger(pHWVirtExt, "Enabled", 1); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync /* Nested paging (VT-x/AMD-V) */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync hrc = pMachine->COMGETTER(HWVirtExNestedPagingEnabled)(&fEnableNestedPaging); H();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertInteger(pRoot, "EnableNestedPaging", fEnableNestedPaging); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync /* VPID (VT-x) */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync hrc = pMachine->COMGETTER(HWVirtExVPIDEnabled)(&fEnableVPID); H();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertInteger(pRoot, "EnableVPID", fEnableVPID); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync /* Physical Address Extension (PAE) */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync hrc = pMachine->COMGETTER(PAEEnabled)(&fEnablePAE); H();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertInteger(pRoot, "EnablePAE", fEnablePAE); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync hrc = biosSettings->COMGETTER(IOAPICEnabled)(&fIOAPIC); H();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync hrc = biosSettings->COMGETTER(PXEDebugEnabled)(&fPXEDebug); H();
fa7c9928985ad8dc74ae6931809083c2af135250vboxsync * Virtual IDE controller type.
9d80662bfa36cc718a22f982d48148415ca95fb8vboxsync hrc = biosSettings->COMGETTER(IDEControllerType)(&controllerType); H();
fa7c9928985ad8dc74ae6931809083c2af135250vboxsync AssertMsgFailed(("Invalid IDE controller type '%d'", controllerType));
fa7c9928985ad8dc74ae6931809083c2af135250vboxsync return VMSetError(pVM, VERR_INVALID_PARAMETER, RT_SRC_POS,
fa7c9928985ad8dc74ae6931809083c2af135250vboxsync N_("Invalid IDE controller type '%d'"), controllerType);
fa7c9928985ad8dc74ae6931809083c2af135250vboxsync * PDM config.
fa7c9928985ad8dc74ae6931809083c2af135250vboxsync * Load drivers in VBoxC.[so|dll]
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertNode(pRoot, "PDM", &pPDM); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertNode(pPDM, "Drivers", &pDrivers); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertNode(pDrivers, "VBoxC", &pMod); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync // VBoxC is located in the components subdirectory
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = RTPathAppPrivateArch(szPathVBoxC, RTPATH_MAX - sizeof("/components/VBoxC")); AssertRC(rc);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertString(pMod, "Path", szPathVBoxC); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertString(pMod, "Path", "VBoxC"); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync PCFGMNODE pCfg = NULL; /* /Devices/Dev/.../Config/ */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync PCFGMNODE pLunL0 = NULL; /* /Devices/Dev/0/LUN#0/ */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync PCFGMNODE pLunL1 = NULL; /* /Devices/Dev/0/LUN#0/AttachedDriver/ */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync PCFGMNODE pLunL2 = NULL; /* /Devices/Dev/0/LUN#0/AttachedDriver/Config/ */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync PCFGMNODE pIdeInst = NULL; /* /Devices/piix3ide/0/ */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync PCFGMNODE pBiosCfg = NULL; /* /Devices/pcbios/0/Config/ */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertNode(pRoot, "Devices", &pDevices); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertNode(pDevices, "pcarch", &pDev); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertNode(pDevices, "pcbios", &pDev); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pBiosCfg); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertInteger(pBiosCfg, "RamSize", cRamMBs * _1M); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertInteger(pBiosCfg, "NumCPUs", cCpus); RC_CHECK();
fa7c9928985ad8dc74ae6931809083c2af135250vboxsync rc = CFGMR3InsertString(pBiosCfg, "HardDiskDevice", "piix3ide"); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertString(pBiosCfg, "FloppyDevice", "i82078"); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertInteger(pBiosCfg, "IOAPIC", fIOAPIC); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertInteger(pBiosCfg, "PXEDebug", fPXEDebug); RC_CHECK();
fa7c9928985ad8dc74ae6931809083c2af135250vboxsync rc = CFGMR3InsertBytes(pBiosCfg, "UUID", pUuid, sizeof(*pUuid)); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync for (ULONG pos = 1; pos <= SchemaDefs::MaxBootPosition; pos ++)
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync hrc = pMachine->GetBootOrder(pos, &bootDevice); H();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync szParamName[sizeof (szParamName) - 2] = ((char (pos - 1)) + '0');
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync AssertMsgFailed(("Invalid bootDevice=%d\n", bootDevice));
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync return VMSetError(pVM, VERR_INVALID_PARAMETER, RT_SRC_POS,
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertString(pBiosCfg, szParamName, pszBootDevice); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * The time offset
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync hrc = biosSettings->COMGETTER(TimeOffset)(&timeOffset); H();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertNode(pRoot, "TM", &pTMNode); RC_CHECK();
38d78a770c90320c1f6da7ae2f3fa58a28b37189vboxsync rc = CFGMR3InsertInteger(pTMNode, "UTCOffset", timeOffset * 1000000); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertNode(pDevices, "8237A", &pDev); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * PCI buses.
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertNode(pDevices, "pci", &pDev); /* piix3 */ RC_CHECK();
c5d2523548cc57504b829f53f1362b848a84542cvboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertInteger(pCfg, "IOAPIC", fIOAPIC); RC_CHECK();
c5d2523548cc57504b829f53f1362b848a84542cvboxsync#if 0 /* enable this to test PCI bridging */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertNode(pDevices, "pcibridge", &pDev); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 14); RC_CHECK();
fbb3513a43135c633f7f51544c4bdfce748929bfvboxsync rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK();
fbb3513a43135c633f7f51544c4bdfce748929bfvboxsync rc = CFGMR3InsertInteger(pInst, "PCIBusNo", 0);/* -> pci[0] */ RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertNode(pDev, "1", &pInst); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 1); RC_CHECK();
fbb3513a43135c633f7f51544c4bdfce748929bfvboxsync rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK();
fbb3513a43135c633f7f51544c4bdfce748929bfvboxsync rc = CFGMR3InsertInteger(pInst, "PCIBusNo", 1);/* ->pcibridge[0] */ RC_CHECK();
fbb3513a43135c633f7f51544c4bdfce748929bfvboxsync rc = CFGMR3InsertNode(pDev, "2", &pInst); RC_CHECK();
fbb3513a43135c633f7f51544c4bdfce748929bfvboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
fbb3513a43135c633f7f51544c4bdfce748929bfvboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 3); RC_CHECK();
fbb3513a43135c633f7f51544c4bdfce748929bfvboxsync rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK();
fbb3513a43135c633f7f51544c4bdfce748929bfvboxsync rc = CFGMR3InsertInteger(pInst, "PCIBusNo", 1);/* ->pcibridge[0] */ RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * PS/2 keyboard & mouse.
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertNode(pDevices, "pckbd", &pDev); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
c5d2523548cc57504b829f53f1362b848a84542cvboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "KeyboardQueue"); RC_CHECK();
c5d2523548cc57504b829f53f1362b848a84542cvboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertInteger(pCfg, "QueueSize", 64); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertString(pLunL1, "Driver", "MainKeyboard"); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertNode(pLunL1, "Config", &pCfg); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)pKeyboard); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertNode(pInst, "LUN#1", &pLunL0); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "MouseQueue"); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync rc = CFGMR3InsertInteger(pCfg, "QueueSize", 128); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertString(pLunL1, "Driver", "MainMouse"); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertNode(pLunL1, "Config", &pCfg); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)pMouse); RC_CHECK();
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * i82078 Floppy drive controller
if (fFdcEnabled)
if (floppyImage)
STR_CONV();
STR_FREE();
if (hostFloppyDrive)
STR_CONV();
STR_FREE();
if (fACPI)
#ifdef DEBUG
if (fIOAPIC)
int value;
switch (bootMenuMode)
value = 0;
unsigned cModes = 0;
STR_CONV();
STR_FREE();
cModes++;
if (pFramebuffer)
ulHeightReduction = 0;
if (sataController)
if (enabled)
{ "SataPrimaryMasterLUN", "SataPrimarySlaveLUN", "SataSecondaryMasterLUN", "SataSecondarySlaveLUN" };
int iLUN = 0;
switch (enmBus)
case StorageBus_IDE:
return VERR_GENERAL_FAILURE;
return VERR_GENERAL_FAILURE;
case StorageBus_SATA:
return VERR_GENERAL_FAILURE;
#if defined(VBOX_WITH_PDM_ASYNC_COMPLETION)
if (dvdDrive)
if (hostDvdDrive)
STR_CONV();
STR_FREE();
if (dvdImage)
STR_CONV();
STR_FREE();
#ifdef VBOX_WITH_E1000
if (!fEnabled)
switch (adapterType)
#ifdef VBOX_WITH_E1000
switch (adapterType)
rc = CFGMR3InsertInteger(pCfg, "papLeds", (uintptr_t)&pConsole->mapNetworkLeds[ulInstance]); RC_CHECK();
if (fSniffer)
STR_CONV();
STR_FREE();
switch (networkAttachment)
if (fSniffer)
STR_CONV();
STR_FREE();
STR_CONV();
STR_FREE();
if (str)
STR_CONV();
STR_FREE();
if (fSniffer)
# if defined(RT_OS_SOLARIS)
/* TAP setup application/script */
/* TAP terminate application/script */
/* "FileHandle" must NOT be inserted here, it is done in DrvTAP.cpp */
# ifdef VBOX_WITH_CROSSBOW
if (fSniffer)
# if defined(RT_OS_DARWIN)
if (!pszColon)
if (pszSpace)
if (pszColon)
# if defined(RT_OS_DARWIN)
/** @todo Come up with a better deal here. Problem is that IHostNetworkInterface is completely useless here. */
if (iSock >= 0)
# if defined(RT_OS_SOLARIS)
if (fSniffer)
# ifndef VBOX_WITH_NETFLT
switch (hrc)
#ifdef RT_OS_LINUX
case VERR_ACCESS_DENIED:
if (str)
STR_CONV();
if (fSniffer)
STR_FREE();
if (serialPort)
if (!fEnabled)
if (parallelPort)
if (!fEnabled)
if (audioAdapter)
if (enabled)
switch (audioController)
case AudioControllerType_AC97:
case AudioControllerType_SB16:
switch (audioDriver)
case AudioDriverType_Null:
#ifdef RT_OS_WINDOWS
#ifdef VBOX_WITH_WINMM
case AudioDriverType_WinMM:
#ifdef RT_OS_SOLARIS
case AudioDriverType_SolAudio:
#ifdef RT_OS_LINUX
case AudioDriverType_OSS:
# ifdef VBOX_WITH_ALSA
case AudioDriverType_ALSA:
# ifdef VBOX_WITH_PULSE
case AudioDriverType_Pulse:
#ifdef RT_OS_DARWIN
STR_CONV();
STR_FREE();
if (USBCtlPtr)
if (fEnabled)
#ifdef VBOX_WITH_EHCI
if (fEnabled)
// VBoxManage setextradata "myvm" "VBoxInternal/USB/USBProxy/GlobalConfig/Force11PacketSize" 1
switch (mode)
case ClipboardMode_Disabled:
pConsole->mVMMDev->hgcmHostCall ("VBoxSharedClipboard", VBOX_SHARED_CLIPBOARD_HOST_FN_SET_MODE, 1, &parm);
#ifdef VBOX_WITH_CROGL
if (fEnabled)
rc = pConsole->mVMMDev->hgcmHostCall("VBoxSharedCrOpenGL", SHCRGL_HOST_FN_SET_FRAMEBUFFER, 1, &parm);
#ifdef VBOX_WITH_GUEST_PROPS
bool fGlobalExtraData = true;
if (fGlobalExtraData)
if (fGlobalExtraData)
fGlobalExtraData = false;
if (pszCFGMValueName)
if (pNode)
if ( pszCFGMValue
&& *pszCFGMValue)
AssertLogRelMsgRC(rc, ("failed to insert CFGM value '%s' to key '%s'\n", pszCFGMValue, pszExtraDataKey));
#undef H
return rc;