ConsoleImpl2.cpp revision 337640774b62333151a0c5cc6407afcb25d93a37
77b1a2d8b5dbe2c0b5200794914239fee3c8ee5dvboxsync * VBox Console COM Class implementation
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync * @remark We've split out the code that the 64-bit VC++ v8 compiler
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync * finds problematic to optimize so we can disable optimizations
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * and later, perhaps, find a real solution for it.
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync * 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
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * General Public License (GPL) as published by the Free Software
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync * additional information or have any questions.
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync/*******************************************************************************
662d52947eeb3fc8fca3b23991a5eee47077f896vboxsync* Header Files *
da957c069c2a3c582fe265ff88170ce4c42b499dvboxsync*******************************************************************************/
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync// generated header
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync#endif /* VBOX_WITH_GUEST_PROPS */
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync * VC++ 8 / amd64 has some serious trouble with this function.
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync * As a temporary measure, we'll drop global optimizations.
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync * Construct the VM configuration tree (CFGM).
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync * This is a callback for VMR3Create() call. It is called from CFGMR3Init()
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync * in the emulation thread (EMT). Any per thread COM/XPCOM initialization
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync * is done here.
0abd77741a608f6c41c8dfcd4781b8b84adf1044vboxsync * @param pVM VM handle.
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync * @param pvConsole Pointer to the VMPowerUpTask object.
9496f2d398b49813176939d7a339ae513d5175efvboxsync * @return VBox status code.
9496f2d398b49813176939d7a339ae513d5175efvboxsync * @note Locks the Console object for writing.
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsyncDECLCALLBACK(int) Console::configConstructor(PVM pVM, void *pvConsole)
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync /* Note: hardcoded assumption about number of slots; see rom bios */
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync /* initialize COM */
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync LogFlow (("Console::configConstructor(): CoInitializeEx()=%08X\n", hrc));
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync ComObjPtr <Console> pConsole = static_cast <Console *> (pvConsole);
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync AssertComRCReturn (autoCaller.rc(), VERR_ACCESS_DENIED);
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync /* lock the console because we widely use internal fields and methods */
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync#define STR_CONV() do { rc = RTUtf16ToUtf8(str, &psz); RC_CHECK(); } while (0)
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync#define STR_FREE() do { if (str) { SysFreeString(str); str = NULL; } if (psz) { RTStrFree(psz); psz = NULL; } } while (0)
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync#define RC_CHECK() do { if (VBOX_FAILURE(rc)) { AssertMsgFailed(("rc=%Vrc\n", rc)); STR_FREE(); return rc; } } while (0)
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync#define H() do { if (FAILED(hrc)) { AssertMsgFailed(("hrc=%#x\n", hrc)); STR_FREE(); return VERR_GENERAL_FAILURE; } } while (0)
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync * Get necessary objects and frequently used parameters.
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync hrc = pMachine->COMGETTER(Parent)(virtualBox.asOutParam()); H();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync hrc = virtualBox->COMGETTER(Host)(host.asOutParam()); H();
9496f2d398b49813176939d7a339ae513d5175efvboxsync hrc = virtualBox->COMGETTER(SystemProperties)(systemProperties.asOutParam()); H();
21029597fc4b76d0db0c9542daee201447281781vboxsync hrc = pMachine->COMGETTER(BIOSSettings)(biosSettings.asOutParam()); H();
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync hrc = pMachine->COMGETTER(Id)(uuid.asOutParam()); H();
9496f2d398b49813176939d7a339ae513d5175efvboxsync hrc = pMachine->COMGETTER(MemorySize)(&cRamMBs); H();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync /* @todo nike: Testing code, should use actual getter when ready */
9c149a2789022f5011e88fb62f02a1cc8068e88fvboxsync * Get root node first.
9496f2d398b49813176939d7a339ae513d5175efvboxsync * This is the only node in the tree.
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync * Set the root level values.
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertString(pRoot, "Name", psz); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertBytes(pRoot, "UUID", pUuid, sizeof(*pUuid)); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertInteger(pRoot, "RamSize", cRamMBs * _1M); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertInteger(pRoot, "NumCPUs", cCpus); RC_CHECK();
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync rc = CFGMR3InsertInteger(pRoot, "TimerMillies", 10); RC_CHECK();
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync rc = CFGMR3InsertInteger(pRoot, "RawR3Enabled", 1); /* boolean */ RC_CHECK();
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync rc = CFGMR3InsertInteger(pRoot, "RawR0Enabled", 1); /* boolean */ RC_CHECK();
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync /** @todo Config: RawR0, PATMEnabled and CASMEnabled needs attention later. */
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync rc = CFGMR3InsertInteger(pRoot, "PATMEnabled", 1); /* boolean */ RC_CHECK();
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync rc = CFGMR3InsertInteger(pRoot, "CSAMEnabled", 1); /* boolean */ RC_CHECK();
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync /* hardware virtualization extensions */
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync hrc = pMachine->COMGETTER(HWVirtExEnabled)(&hwVirtExEnabled); H();
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync /* check the default value */
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync hrc = systemProperties->COMGETTER(HWVirtExEnabled)(&fHWVirtExEnabled); H();
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync fHWVirtExEnabled = (hwVirtExEnabled == TSBool_True);
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync#ifndef RT_OS_DARWIN /** @todo Implement HWVirtExt on darwin. See #1865. */
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync rc = CFGMR3InsertNode(pRoot, "HWVirtExt", &pHWVirtExt); RC_CHECK();
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync rc = CFGMR3InsertInteger(pHWVirtExt, "Enabled", 1); RC_CHECK();
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync /* Nested paging (VT-x/AMD-V) */
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync hrc = pMachine->COMGETTER(HWVirtExNestedPagingEnabled)(&fEnableNestedPaging); H();
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync rc = CFGMR3InsertInteger(pRoot, "EnableNestedPaging", fEnableNestedPaging); RC_CHECK();
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync /* Physical Address Extension (PAE) */
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync hrc = pMachine->COMGETTER(PAEEnabled)(&fEnablePAE); H();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertInteger(pRoot, "EnablePAE", fEnablePAE); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync hrc = biosSettings->COMGETTER(IOAPICEnabled)(&fIOAPIC); H();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync hrc = biosSettings->COMGETTER(PXEDebugEnabled)(&fPXEDebug); H();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync * Virtual IDE controller type.
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync hrc = biosSettings->COMGETTER(IDEControllerType)(&controllerType); H();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync AssertMsgFailed(("Invalid IDE controller type '%d'", controllerType));
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync return VMSetError(pVM, VERR_INVALID_PARAMETER, RT_SRC_POS,
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync N_("Invalid IDE controller type '%d'"), controllerType);
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync * PDM config.
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync * Load drivers in VBoxC.[so|dll]
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertNode(pRoot, "PDM", &pPDM); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertNode(pPDM, "Drivers", &pDrivers); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertNode(pDrivers, "VBoxC", &pMod); RC_CHECK();
a9d49c8f2b28a72e6a4db86eee91e4569290157bvboxsync // VBoxC is located in the components subdirectory
a9d49c8f2b28a72e6a4db86eee91e4569290157bvboxsync rc = RTPathAppPrivateArch(szPathVBoxC, RTPATH_MAX - sizeof("/components/VBoxC")); AssertRC(rc);
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertString(pMod, "Path", szPathVBoxC); RC_CHECK();
9496f2d398b49813176939d7a339ae513d5175efvboxsync rc = CFGMR3InsertString(pMod, "Path", "VBoxC"); RC_CHECK();
9496f2d398b49813176939d7a339ae513d5175efvboxsync PCFGMNODE pCfg = NULL; /* /Devices/Dev/.../Config/ */
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync PCFGMNODE pLunL0 = NULL; /* /Devices/Dev/0/LUN#0/ */
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync PCFGMNODE pLunL1 = NULL; /* /Devices/Dev/0/LUN#0/AttachedDriver/ */
5d0d754550d06b7d59a935e59caaf814462d53ccvboxsync PCFGMNODE pLunL2 = NULL; /* /Devices/Dev/0/LUN#0/AttachedDriver/Config/ */
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync PCFGMNODE pIdeInst = NULL; /* /Devices/piix3ide/0/ */
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync PCFGMNODE pBiosCfg = NULL; /* /Devices/pcbios/0/Config/ */
5d0d754550d06b7d59a935e59caaf814462d53ccvboxsync PCFGMNODE pTimestamps = NULL; /* /GuestProps/Timestamps */
5d0d754550d06b7d59a935e59caaf814462d53ccvboxsync#endif /* VBOX_WITH_GUEST_PROPS defined */
5d0d754550d06b7d59a935e59caaf814462d53ccvboxsync rc = CFGMR3InsertNode(pRoot, "Devices", &pDevices); RC_CHECK();
5d0d754550d06b7d59a935e59caaf814462d53ccvboxsync rc = CFGMR3InsertNode(pDevices, "pcarch", &pDev); RC_CHECK();
5d0d754550d06b7d59a935e59caaf814462d53ccvboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
5d0d754550d06b7d59a935e59caaf814462d53ccvboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
5d0d754550d06b7d59a935e59caaf814462d53ccvboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertNode(pDevices, "pcbios", &pDev); RC_CHECK();
9496f2d398b49813176939d7a339ae513d5175efvboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
9496f2d398b49813176939d7a339ae513d5175efvboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertNode(pInst, "Config", &pBiosCfg); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertInteger(pBiosCfg, "RamSize", cRamMBs * _1M); RC_CHECK();
9496f2d398b49813176939d7a339ae513d5175efvboxsync rc = CFGMR3InsertInteger(pBiosCfg, "NumCPUs", cCpus); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertString(pBiosCfg, "HardDiskDevice", "piix3ide"); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertString(pBiosCfg, "FloppyDevice", "i82078"); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertInteger(pBiosCfg, "IOAPIC", fIOAPIC); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertInteger(pBiosCfg, "PXEDebug", fPXEDebug); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertBytes(pBiosCfg, "UUID", pUuid, sizeof(*pUuid)); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync for (ULONG pos = 1; pos <= SchemaDefs::MaxBootPosition; pos ++)
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync hrc = pMachine->GetBootOrder(pos, &bootDevice); H();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync szParamName[sizeof (szParamName) - 2] = ((char (pos - 1)) + '0');
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync AssertMsgFailed(("Invalid bootDevice=%d\n", bootDevice));
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync return VMSetError(pVM, VERR_INVALID_PARAMETER, RT_SRC_POS,
9496f2d398b49813176939d7a339ae513d5175efvboxsync rc = CFGMR3InsertString(pBiosCfg, szParamName, pszBootDevice); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync * The time offset
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync hrc = biosSettings->COMGETTER(TimeOffset)(&timeOffset); H();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertNode(pRoot, "TM", &pTMNode); RC_CHECK();
9496f2d398b49813176939d7a339ae513d5175efvboxsync rc = CFGMR3InsertInteger(pTMNode, "UTCOffset", timeOffset * 1000000); RC_CHECK();
5d0d754550d06b7d59a935e59caaf814462d53ccvboxsync rc = CFGMR3InsertNode(pDevices, "8237A", &pDev); RC_CHECK();
5d0d754550d06b7d59a935e59caaf814462d53ccvboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
5d0d754550d06b7d59a935e59caaf814462d53ccvboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
9496f2d398b49813176939d7a339ae513d5175efvboxsync rc = CFGMR3InsertNode(pDevices, "pci", &pDev); /* piix3 */ RC_CHECK();
9496f2d398b49813176939d7a339ae513d5175efvboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertInteger(pCfg, "IOAPIC", fIOAPIC); RC_CHECK();
ce03ea57fdcf3d48523b1de5b894feb75e1b34davboxsync * PS/2 keyboard & mouse.
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertNode(pDevices, "pckbd", &pDev); RC_CHECK();
9496f2d398b49813176939d7a339ae513d5175efvboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();
ce03ea57fdcf3d48523b1de5b894feb75e1b34davboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "KeyboardQueue"); RC_CHECK();
ce03ea57fdcf3d48523b1de5b894feb75e1b34davboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
ce03ea57fdcf3d48523b1de5b894feb75e1b34davboxsync rc = CFGMR3InsertInteger(pCfg, "QueueSize", 64); RC_CHECK();
ce03ea57fdcf3d48523b1de5b894feb75e1b34davboxsync rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); RC_CHECK();
ce03ea57fdcf3d48523b1de5b894feb75e1b34davboxsync rc = CFGMR3InsertString(pLunL1, "Driver", "MainKeyboard"); RC_CHECK();
ce03ea57fdcf3d48523b1de5b894feb75e1b34davboxsync rc = CFGMR3InsertNode(pLunL1, "Config", &pCfg); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)pKeyboard); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertNode(pInst, "LUN#1", &pLunL0); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "MouseQueue"); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
9496f2d398b49813176939d7a339ae513d5175efvboxsync rc = CFGMR3InsertInteger(pCfg, "QueueSize", 128); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertString(pLunL1, "Driver", "MainMouse"); RC_CHECK();
9496f2d398b49813176939d7a339ae513d5175efvboxsync rc = CFGMR3InsertNode(pLunL1, "Config", &pCfg); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)pMouse); RC_CHECK();
9496f2d398b49813176939d7a339ae513d5175efvboxsync * i82078 Floppy drive controller
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync hrc = pMachine->COMGETTER(FloppyDrive)(floppyDrive.asOutParam()); H();
9496f2d398b49813176939d7a339ae513d5175efvboxsync hrc = floppyDrive->COMGETTER(Enabled)(&fFdcEnabled); H();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertNode(pDevices, "i82078", &pDev); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
ce03ea57fdcf3d48523b1de5b894feb75e1b34davboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); RC_CHECK();
ce03ea57fdcf3d48523b1de5b894feb75e1b34davboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
ce03ea57fdcf3d48523b1de5b894feb75e1b34davboxsync rc = CFGMR3InsertInteger(pCfg, "IRQ", 6); RC_CHECK();
ce03ea57fdcf3d48523b1de5b894feb75e1b34davboxsync rc = CFGMR3InsertInteger(pCfg, "DMA", 2); RC_CHECK();
ce03ea57fdcf3d48523b1de5b894feb75e1b34davboxsync rc = CFGMR3InsertInteger(pCfg, "MemMapped", 0 ); RC_CHECK();
ce03ea57fdcf3d48523b1de5b894feb75e1b34davboxsync rc = CFGMR3InsertInteger(pCfg, "IOBase", 0x3f0); RC_CHECK();
ce03ea57fdcf3d48523b1de5b894feb75e1b34davboxsync /* Attach the status driver */
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertNode(pInst, "LUN#999", &pLunL0); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertInteger(pCfg, "papLeds", (uintptr_t)&pConsole->mapFDLeds[0]); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertInteger(pCfg, "First", 0); RC_CHECK();
9496f2d398b49813176939d7a339ae513d5175efvboxsync rc = CFGMR3InsertInteger(pCfg, "Last", 0); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync hrc = floppyDrive->GetImage(floppyImage.asOutParam()); H();
ce03ea57fdcf3d48523b1de5b894feb75e1b34davboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "Block"); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertString(pCfg, "Type", "Floppy 1.44"); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertInteger(pCfg, "Mountable", 1); RC_CHECK();
9496f2d398b49813176939d7a339ae513d5175efvboxsync rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); RC_CHECK();
ce03ea57fdcf3d48523b1de5b894feb75e1b34davboxsync rc = CFGMR3InsertString(pLunL1, "Driver", "RawImage"); RC_CHECK();
ce03ea57fdcf3d48523b1de5b894feb75e1b34davboxsync rc = CFGMR3InsertNode(pLunL1, "Config", &pCfg); RC_CHECK();
ce03ea57fdcf3d48523b1de5b894feb75e1b34davboxsync rc = CFGMR3InsertString(pCfg, "Path", psz); RC_CHECK();
9496f2d398b49813176939d7a339ae513d5175efvboxsync hrc = floppyDrive->GetHostDrive(hostFloppyDrive.asOutParam()); H();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync pConsole->meFloppyState = DriveState_HostDriveCaptured;
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "HostFloppy"); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertString(pCfg, "Path", psz); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "Block"); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertString(pCfg, "Type", "Floppy 1.44"); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertInteger(pCfg, "Mountable", 1); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync hrc = biosSettings->COMGETTER(ACPIEnabled)(&fACPI); H();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertNode(pDevices, "acpi", &pDev); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
9496f2d398b49813176939d7a339ae513d5175efvboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertInteger(pCfg, "RamSize", cRamMBs * _1M); RC_CHECK();
9496f2d398b49813176939d7a339ae513d5175efvboxsync rc = CFGMR3InsertInteger(pCfg, "NumCPUs", cCpus); RC_CHECK();
59d7f5939d42ad9d344fbad8401e00a900db92c5vboxsync rc = CFGMR3InsertInteger(pCfg, "IOAPIC", fIOAPIC); RC_CHECK();
59d7f5939d42ad9d344fbad8401e00a900db92c5vboxsync rc = CFGMR3InsertInteger(pCfg, "FdcEnabled", fFdcEnabled); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 7); RC_CHECK();
9c149a2789022f5011e88fb62f02a1cc8068e88fvboxsync rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK();
975ad9d9bc9c4dc96b41d9f67a65228b1b338e2avboxsync rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();
9c149a2789022f5011e88fb62f02a1cc8068e88fvboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "ACPIHost"); RC_CHECK();
975ad9d9bc9c4dc96b41d9f67a65228b1b338e2avboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
9c149a2789022f5011e88fb62f02a1cc8068e88fvboxsync * i8254 Programmable Interval Timer And Dummy Speaker
9c149a2789022f5011e88fb62f02a1cc8068e88fvboxsync rc = CFGMR3InsertNode(pDevices, "i8254", &pDev); RC_CHECK();
9c149a2789022f5011e88fb62f02a1cc8068e88fvboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
975ad9d9bc9c4dc96b41d9f67a65228b1b338e2avboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
975ad9d9bc9c4dc96b41d9f67a65228b1b338e2avboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
efff36b306e370346025647a158689021df2e1d1vboxsync * i8259 Programmable Interrupt Controller.
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertNode(pDevices, "i8259", &pDev); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync * Advanced Programmable Interrupt Controller.
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync * SMP: Each CPU has a LAPIC, but we have a single device representing all LAPICs states,
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync * thus only single insert
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertNode(pDevices, "apic", &pDev); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertInteger(pCfg, "IOAPIC", fIOAPIC); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertInteger(pCfg, "NumCPUs", cCpus); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync /* SMP: @todo: IOAPIC may be required for SMP configs */
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync * I/O Advanced Programmable Interrupt Controller.
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertNode(pDevices, "ioapic", &pDev); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync * RTC MC146818.
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertNode(pDevices, "mc146818", &pDev); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertNode(pDevices, "vga", &pDev); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 2); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync hrc = pMachine->COMGETTER(VRAMSize)(&cRamMBs); H();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertInteger(pCfg, "VRamSize", cRamMBs * _1M); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync * BIOS logo
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync hrc = biosSettings->COMGETTER(LogoFadeIn)(&fFadeIn); H();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertInteger(pCfg, "FadeIn", fFadeIn ? 1 : 0); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync hrc = biosSettings->COMGETTER(LogoFadeOut)(&fFadeOut); H();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertInteger(pCfg, "FadeOut", fFadeOut ? 1: 0); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync hrc = biosSettings->COMGETTER(LogoDisplayTime)(&logoDisplayTime); H();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertInteger(pCfg, "LogoTime", logoDisplayTime); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync hrc = biosSettings->COMGETTER(LogoImagePath)(logoImagePath.asOutParam()); H();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertString(pCfg, "LogoFile", logoImagePath ? Utf8Str(logoImagePath) : ""); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync * Boot menu
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync biosSettings->COMGETTER(BootMenuMode)(&bootMenuMode);
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertInteger(pCfg, "ShowBootMenu", value); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync /* Custom VESA mode list */
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync unsigned cModes = 0;
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync RTStrPrintf(szExtraDataKey, sizeof(szExtraDataKey), "CustomVideoMode%d", iMode);
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync hrc = pMachine->GetExtraData(Bstr(szExtraDataKey), &str); H();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertString(pCfg, szExtraDataKey, psz);
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertInteger(pCfg, "CustomVideoModes", cModes);
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync /* VESA height reduction */
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync IFramebuffer *pFramebuffer = pConsole->getDisplay()->getFramebuffer();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync hrc = pFramebuffer->COMGETTER(HeightReduction)(&ulHeightReduction); H();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync /* If framebuffer is not available, there is no height reduction. */
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertInteger(pCfg, "HeightReduction", ulHeightReduction); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync /* Attach the display. */
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "MainDisplay"); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)pDisplay); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync * IDE (update this when the main interface changes)
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertNode(pDevices, "piix3ide", &pDev); /* piix3 */ RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertNode(pDev, "0", &pIdeInst); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertInteger(pIdeInst, "Trusted", 1); /* boolean */ RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertInteger(pIdeInst, "PCIDeviceNo", 1); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertInteger(pIdeInst, "PCIFunctionNo", 1); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertNode(pIdeInst, "Config", &pCfg); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertInteger(pCfg, "PIIX4", fPIIX4); /* boolean */ RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync /* Attach the status driver */
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertNode(pIdeInst, "LUN#999", &pLunL0); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertInteger(pCfg, "papLeds", (uintptr_t)&pConsole->mapIDELeds[0]);RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertInteger(pCfg, "First", 0); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertInteger(pCfg, "Last", 3); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync * SATA controller
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync hrc = pMachine->COMGETTER(SATAController)(sataController.asOutParam());
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync hrc = sataController->COMGETTER(Enabled)(&enabled); H();
d571b6e3237f0ce89ea27f6fa4635d41c5ee3d88vboxsync rc = CFGMR3InsertNode(pDevices, "ahci", &pDev); RC_CHECK();
d571b6e3237f0ce89ea27f6fa4635d41c5ee3d88vboxsync rc = CFGMR3InsertNode(pDev, "0", &pSataInst); RC_CHECK();
d571b6e3237f0ce89ea27f6fa4635d41c5ee3d88vboxsync rc = CFGMR3InsertInteger(pSataInst, "Trusted", 1); RC_CHECK();
d571b6e3237f0ce89ea27f6fa4635d41c5ee3d88vboxsync rc = CFGMR3InsertInteger(pSataInst, "PCIDeviceNo", 13); RC_CHECK();
d571b6e3237f0ce89ea27f6fa4635d41c5ee3d88vboxsync rc = CFGMR3InsertInteger(pSataInst, "PCIFunctionNo", 0); RC_CHECK();
d571b6e3237f0ce89ea27f6fa4635d41c5ee3d88vboxsync rc = CFGMR3InsertNode(pSataInst, "Config", &pCfg); RC_CHECK();
d571b6e3237f0ce89ea27f6fa4635d41c5ee3d88vboxsync hrc = sataController->COMGETTER(PortCount)(&cPorts); H();
d571b6e3237f0ce89ea27f6fa4635d41c5ee3d88vboxsync rc = CFGMR3InsertInteger(pCfg, "PortCount", cPorts); RC_CHECK();
d571b6e3237f0ce89ea27f6fa4635d41c5ee3d88vboxsync /* Needed configuration values for the bios. */
d571b6e3237f0ce89ea27f6fa4635d41c5ee3d88vboxsync rc = CFGMR3InsertString(pBiosCfg, "SataHardDiskDevice", "ahci"); RC_CHECK();
d571b6e3237f0ce89ea27f6fa4635d41c5ee3d88vboxsync { "PrimaryMaster", "PrimarySlave", "SecondaryMaster", "SecondarySlave" };
d571b6e3237f0ce89ea27f6fa4635d41c5ee3d88vboxsync { "SataPrimaryMasterLUN", "SataPrimarySlaveLUN", "SataSecondaryMasterLUN", "SataSecondarySlaveLUN" };
d571b6e3237f0ce89ea27f6fa4635d41c5ee3d88vboxsync hrc = sataController->GetIDEEmulationPort(i, &lPortNumber); H();
d571b6e3237f0ce89ea27f6fa4635d41c5ee3d88vboxsync rc = CFGMR3InsertInteger(pCfg, s_apszConfig[i], lPortNumber); RC_CHECK();
d571b6e3237f0ce89ea27f6fa4635d41c5ee3d88vboxsync rc = CFGMR3InsertInteger(pBiosCfg, s_apszBiosConfig[i], lPortNumber); RC_CHECK();
d571b6e3237f0ce89ea27f6fa4635d41c5ee3d88vboxsync /* Attach the status driver */
d571b6e3237f0ce89ea27f6fa4635d41c5ee3d88vboxsync rc = CFGMR3InsertNode(pSataInst,"LUN#999", &pLunL0); RC_CHECK();
d571b6e3237f0ce89ea27f6fa4635d41c5ee3d88vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); RC_CHECK();
d571b6e3237f0ce89ea27f6fa4635d41c5ee3d88vboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
d571b6e3237f0ce89ea27f6fa4635d41c5ee3d88vboxsync AssertRelease(cPorts <= RT_ELEMENTS(pConsole->mapSATALeds));
d571b6e3237f0ce89ea27f6fa4635d41c5ee3d88vboxsync rc = CFGMR3InsertInteger(pCfg, "papLeds", (uintptr_t)&pConsole->mapSATALeds[0]); RC_CHECK();
d571b6e3237f0ce89ea27f6fa4635d41c5ee3d88vboxsync rc = CFGMR3InsertInteger(pCfg, "First", 0); RC_CHECK();
d571b6e3237f0ce89ea27f6fa4635d41c5ee3d88vboxsync rc = CFGMR3InsertInteger(pCfg, "Last", cPorts - 1); RC_CHECK();
d571b6e3237f0ce89ea27f6fa4635d41c5ee3d88vboxsync /* Attach the harddisks */
d571b6e3237f0ce89ea27f6fa4635d41c5ee3d88vboxsync hrc = pMachine->COMGETTER(HardDiskAttachments)(hdaColl.asOutParam()); H();
d571b6e3237f0ce89ea27f6fa4635d41c5ee3d88vboxsync hrc = hdaColl->Enumerate(hdaEnum.asOutParam()); H();
d571b6e3237f0ce89ea27f6fa4635d41c5ee3d88vboxsync hrc = hda->COMGETTER(HardDisk)(hardDisk.asOutParam()); H();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync AssertMsgFailed(("invalid controller channel number: %d\n", lChannel));
fe813b3594039ba864493438e78ee0e7132bc445vboxsync AssertMsgFailed(("invalid controller device number: %d\n", lDev));
ff88d4153cd65650577e8c2d1a5a3fdfa0404a80vboxsync AssertMsgFailed(("invalid disk controller type: %d\n", enmBus));
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync /* Can be NULL if SATA controller is not enabled and current hard disk is attached to SATA controller. */
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertNode(pHardDiskCtl, szLUN, &pLunL0); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "Block"); RC_CHECK();
548ca31b6b47c36bacce49bed3339cb8075b9681vboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
548ca31b6b47c36bacce49bed3339cb8075b9681vboxsync rc = CFGMR3InsertString(pCfg, "Type", "HardDisk"); RC_CHECK();
fe813b3594039ba864493438e78ee0e7132bc445vboxsync rc = CFGMR3InsertInteger(pCfg, "Mountable", 0); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync if (hddType == HardDiskStorageType_VirtualDiskImage)
548ca31b6b47c36bacce49bed3339cb8075b9681vboxsync rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertString(pLunL1, "Driver", "VBoxHDD"); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertNode(pLunL1, "Config", &pCfg); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertString(pCfg, "Path", psz); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync /* Create an inversed tree of parents. */
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync hrc = parentHardDisk->COMGETTER(Parent)(curHardDisk.asOutParam()); H();
548ca31b6b47c36bacce49bed3339cb8075b9681vboxsync rc = CFGMR3InsertNode(pParent, "Parent", &pCur); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertString(pCur, "Path", psz); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertInteger(pCur, "ReadOnly", 1); RC_CHECK();
8083a259c13e6e26e56ca2582edbad4a8cfac25avboxsync else if (hddType == HardDiskStorageType_ISCSIHardDisk)
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync AssertBreakStmt (!iSCSIDisk.isNull(), hrc = E_FAIL);
548ca31b6b47c36bacce49bed3339cb8075b9681vboxsync rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); RC_CHECK();
548ca31b6b47c36bacce49bed3339cb8075b9681vboxsync rc = CFGMR3InsertString(pLunL1, "Driver", "iSCSI"); RC_CHECK();
594521f7faf13f7a88f31e6cd76629bd67340229vboxsync rc = CFGMR3InsertNode(pLunL1, "Config", &pCfg); RC_CHECK();
fe813b3594039ba864493438e78ee0e7132bc445vboxsync /* Set up the iSCSI initiator driver configuration. */
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertString(pCfg, "TargetName", psz); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertInteger(pCfg, "LUN", lun); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertString(pCfg, "TargetAddress", pszTN); RC_CHECK();
8083a259c13e6e26e56ca2582edbad4a8cfac25avboxsync rc = CFGMR3InsertString(pCfg, "TargetAddress", psz); RC_CHECK();
fe813b3594039ba864493438e78ee0e7132bc445vboxsync rc = CFGMR3InsertString(pCfg, "InitiatorUsername", psz); RC_CHECK();
548ca31b6b47c36bacce49bed3339cb8075b9681vboxsync rc = CFGMR3InsertString(pCfg, "InitiatorSecret", psz); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync // @todo currently there is no target username config.
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync //rc = CFGMR3InsertString(pCfg, "TargetUsername", ""); RC_CHECK();
9496f2d398b49813176939d7a339ae513d5175efvboxsync // @todo currently there is no target password config.
9496f2d398b49813176939d7a339ae513d5175efvboxsync //rc = CFGMR3InsertString(pCfg, "TargetSecret", ""); RC_CHECK();
b7a5b3f9f9ecce32ddacf8404c625ce0451bbdc1vboxsync /* The iSCSI initiator needs an attached iSCSI transport driver. */
9496f2d398b49813176939d7a339ae513d5175efvboxsync rc = CFGMR3InsertNode(pLunL1, "AttachedDriver", &pLunL2); RC_CHECK();
9496f2d398b49813176939d7a339ae513d5175efvboxsync rc = CFGMR3InsertString(pLunL2, "Driver", "iSCSITCP"); RC_CHECK();
9496f2d398b49813176939d7a339ae513d5175efvboxsync /* Currently the transport driver has no config options. */
fe813b3594039ba864493438e78ee0e7132bc445vboxsync AssertBreakStmt (!vmdkDisk.isNull(), hrc = E_FAIL);
9496f2d398b49813176939d7a339ae513d5175efvboxsync rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); RC_CHECK();
9496f2d398b49813176939d7a339ae513d5175efvboxsync#if 1 /* Enable new VD container code (and new VMDK), as the bugs are fixed. */
9496f2d398b49813176939d7a339ae513d5175efvboxsync rc = CFGMR3InsertString(pLunL1, "Driver", "VD"); RC_CHECK();
9496f2d398b49813176939d7a339ae513d5175efvboxsync rc = CFGMR3InsertString(pLunL1, "Driver", "VmdkHDD"); RC_CHECK();
9496f2d398b49813176939d7a339ae513d5175efvboxsync rc = CFGMR3InsertNode(pLunL1, "Config", &pCfg); RC_CHECK();
548ca31b6b47c36bacce49bed3339cb8075b9681vboxsync rc = CFGMR3InsertString(pCfg, "Path", psz); RC_CHECK();
9496f2d398b49813176939d7a339ae513d5175efvboxsync rc = CFGMR3InsertString(pCfg, "Format", "VMDK"); RC_CHECK();
9496f2d398b49813176939d7a339ae513d5175efvboxsync * Create cfgm nodes for async transport driver because VMDK is currently the only
9496f2d398b49813176939d7a339ae513d5175efvboxsync * one which may support async I/O. This has to be made generic based on the capabiliy flags
9496f2d398b49813176939d7a339ae513d5175efvboxsync * when the new HardDisk interface is merged.
9496f2d398b49813176939d7a339ae513d5175efvboxsync rc = CFGMR3InsertNode(pLunL1, "AttachedDriver", &pLunL2); RC_CHECK();
5341459ca931b65de60b5af2a4cba6836b6b45cavboxsync rc = CFGMR3InsertString(pLunL2, "Driver", "TransportAsync"); RC_CHECK();
9496f2d398b49813176939d7a339ae513d5175efvboxsync /* The async transport driver has no config options yet. */
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync else if (hddType == HardDiskStorageType_CustomHardDisk)
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync AssertBreakStmt (!customHardDisk.isNull(), hrc = E_FAIL);
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); RC_CHECK();
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync rc = CFGMR3InsertString(pLunL1, "Driver", "VD"); RC_CHECK();
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync rc = CFGMR3InsertNode(pLunL1, "Config", &pCfg); RC_CHECK();
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync hrc = customHardDisk->COMGETTER(Location)(&str); H();
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync rc = CFGMR3InsertString(pCfg, "Path", psz); RC_CHECK();
a39ea3668b7019c23a68936259545f9b71bce1aavboxsync hrc = customHardDisk->COMGETTER(Format)(&str); H();
da3503c04ce76e653401396fe2795a9bc2427a1dvboxsync rc = CFGMR3InsertString(pCfg, "Format", psz); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertString(pLunL1, "Driver", "VD"); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertNode(pLunL1, "Config", &pCfg); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertString(pCfg, "Path", psz); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertString(pCfg, "Format", "VHD"); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync hrc = pMachine->COMGETTER(DVDDrive)(dvdDrive.asOutParam()); H();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync // ASSUME: DVD drive is always attached to LUN#2 (i.e. secondary IDE master)
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertNode(pIdeInst, "LUN#2", &pLunL0); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync hrc = dvdDrive->GetHostDrive(hostDvdDrive.asOutParam()); H();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync pConsole->meDVDState = DriveState_HostDriveCaptured;
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "HostDVD"); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertString(pCfg, "Path", psz); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync hrc = dvdDrive->COMGETTER(Passthrough)(&fPassthrough); H();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertInteger(pCfg, "Passthrough", !!fPassthrough); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "Block"); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertString(pCfg, "Type", "DVD"); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertInteger(pCfg, "Mountable", 1); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync hrc = dvdDrive->GetImage(dvdImage.asOutParam()); H();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertString(pLunL1, "Driver", "MediaISO"); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertNode(pLunL1, "Config", &pCfg); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertString(pCfg, "Path", psz); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync * Network adapters
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync PCFGMNODE pDevPCNet = NULL; /* PCNet-type devices */
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertNode(pDevices, "pcnet", &pDevPCNet); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync PCFGMNODE pDevE1000 = NULL; /* E1000-type devices */
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertNode(pDevices, "e1000", &pDevE1000); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync for (ULONG ulInstance = 0; ulInstance < SchemaDefs::NetworkAdapterCount; ulInstance++)
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync hrc = pMachine->GetNetworkAdapter(ulInstance, networkAdapter.asOutParam()); H();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync hrc = networkAdapter->COMGETTER(Enabled)(&fEnabled); H();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync * The virtual hardware type. Create appropriate device first.
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync hrc = networkAdapter->COMGETTER(AdapterType)(&adapterType); H();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync AssertMsgFailed(("Invalid network adapter type '%d' for slot '%d'",
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync return VMSetError(pVM, VERR_INVALID_PARAMETER, RT_SRC_POS,
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync N_("Invalid network adapter type '%d' for slot '%d'"),
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync RTStrPrintf(szInstance, sizeof(szInstance), "%lu", ulInstance);
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertNode(pDev, szInstance, &pInst); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync /* the first network card gets the PCI ID 3, the next 3 gets 8..10. */
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync const unsigned iPciDeviceNo = !ulInstance ? 3 : ulInstance - 1 + 8;
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", iPciDeviceNo); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync * The virtual hardware type. PCNet supports two types.
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertInteger(pCfg, "Am79C973", 0); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertInteger(pCfg, "Am79C973", 1); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertInteger(pCfg, "AdapterType", 0); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync rc = CFGMR3InsertInteger(pCfg, "AdapterType", 1); RC_CHECK();
cba6719bd64ec749967bbe931230452664109857vboxsync * Get the MAC address and convert it to binary representation
c28fa006ba669ad8f26ae31d00a338379c04ea1bvboxsync hrc = networkAdapter->COMGETTER(MACAddress)(macAddr.asOutParam()); H();
548ca31b6b47c36bacce49bed3339cb8075b9681vboxsync rc = CFGMR3InsertBytes(pCfg, "MAC", &Mac, sizeof(Mac)); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync * Check if the cable is supposed to be unplugged
548ca31b6b47c36bacce49bed3339cb8075b9681vboxsync hrc = networkAdapter->COMGETTER(CableConnected)(&fCableConnected); H();
548ca31b6b47c36bacce49bed3339cb8075b9681vboxsync rc = CFGMR3InsertInteger(pCfg, "CableConnected", fCableConnected ? 1 : 0); RC_CHECK();
548ca31b6b47c36bacce49bed3339cb8075b9681vboxsync * Line speed to report from custom drivers
548ca31b6b47c36bacce49bed3339cb8075b9681vboxsync hrc = networkAdapter->COMGETTER(LineSpeed)(&ulLineSpeed); H();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertInteger(pCfg, "LineSpeed", ulLineSpeed); RC_CHECK();
548ca31b6b47c36bacce49bed3339cb8075b9681vboxsync * Attach the status driver.
9496f2d398b49813176939d7a339ae513d5175efvboxsync rc = CFGMR3InsertNode(pInst, "LUN#999", &pLunL0); RC_CHECK();
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); RC_CHECK();
68a4ee3a31a0807abd03eae881c1bbaf4d42ee6dvboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
548ca31b6b47c36bacce49bed3339cb8075b9681vboxsync rc = CFGMR3InsertInteger(pCfg, "papLeds", (uintptr_t)&pConsole->mapNetworkLeds[ulInstance]); RC_CHECK();
caf54c14752060b187e3fca12a6f71f4b13126b8vboxsync * Enable the packet sniffer if requested.
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync hrc = networkAdapter->COMGETTER(TraceEnabled)(&fSniffer); H();
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync /* insert the sniffer filter driver. */
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();
548ca31b6b47c36bacce49bed3339cb8075b9681vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "NetSniffer"); RC_CHECK();
548ca31b6b47c36bacce49bed3339cb8075b9681vboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
975ad9d9bc9c4dc96b41d9f67a65228b1b338e2avboxsync hrc = networkAdapter->COMGETTER(TraceFile)(&str); H();
548ca31b6b47c36bacce49bed3339cb8075b9681vboxsync if (str) /* check convention for indicating default file. */
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync rc = CFGMR3InsertString(pCfg, "File", psz); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync hrc = networkAdapter->COMGETTER(AttachmentType)(&networkAttachment); H();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL0); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();
d9d5fbda1b8f7a6f7fae555db60d0e636fd03af8vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "NAT"); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
d9d5fbda1b8f7a6f7fae555db60d0e636fd03af8vboxsync /* (Port forwarding goes here.) */
27b178e99b06a68ef52353b15bc647674d2006bcvboxsync /* Configure TFTP prefix and boot filename. */
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync hrc = virtualBox->COMGETTER(HomeFolder)(&str); H();
d9d5fbda1b8f7a6f7fae555db60d0e636fd03af8vboxsync RTStrAPrintf(&pszTFTPPrefix, "%s%c%s", psz, RTPATH_DELIMITER, "TFTP");
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertString(pCfg, "TFTPPrefix", pszTFTPPrefix); RC_CHECK();
0ccdfa1953b2f57311fb9ec01a2baf5e1e366f5avboxsync rc = CFGMR3InsertString(pCfg, "BootFile", pszBootFile); RC_CHECK();
0ccdfa1953b2f57311fb9ec01a2baf5e1e366f5avboxsync hrc = networkAdapter->COMGETTER(NATNetwork)(&str); H();
0ccdfa1953b2f57311fb9ec01a2baf5e1e366f5avboxsync rc = CFGMR3InsertString(pCfg, "Network", psz); RC_CHECK();
f35c44bfc9e1036d0cb376fb144cdae416c7ef3avboxsync * Perform the attachment if required (don't return on error!)
0ccdfa1953b2f57311fb9ec01a2baf5e1e366f5avboxsync hrc = pConsole->attachToHostInterface(networkAdapter);
f35c44bfc9e1036d0cb376fb144cdae416c7ef3avboxsync rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL0); RC_CHECK();
f35c44bfc9e1036d0cb376fb144cdae416c7ef3avboxsync rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();
0ccdfa1953b2f57311fb9ec01a2baf5e1e366f5avboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "HostInterface"); RC_CHECK();
f35c44bfc9e1036d0cb376fb144cdae416c7ef3avboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
0ccdfa1953b2f57311fb9ec01a2baf5e1e366f5avboxsync /* Device name/number is required for Solaris as we need it for TAP PPA. */
27b178e99b06a68ef52353b15bc647674d2006bcvboxsync networkAdapter->COMGETTER(HostInterface)(tapDeviceName.asOutParam());
27b178e99b06a68ef52353b15bc647674d2006bcvboxsync rc = CFGMR3InsertString(pCfg, "Device", Utf8Str(tapDeviceName)); RC_CHECK();
27b178e99b06a68ef52353b15bc647674d2006bcvboxsync /* TAP setup application/script */
0ccdfa1953b2f57311fb9ec01a2baf5e1e366f5avboxsync networkAdapter->COMGETTER(TAPSetupApplication)(tapSetupApp.asOutParam());
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertString(pCfg, "TAPSetupApplication", Utf8Str(tapSetupApp)); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync /* TAP terminate application/script */
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync networkAdapter->COMGETTER(TAPTerminateApplication)(tapTerminateApp.asOutParam());
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertString(pCfg, "TAPTerminateApplication", Utf8Str(tapTerminateApp)); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync /* "FileHandle" must NOT be inserted here, it is done in DrvTAP.cpp */
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync /* Crossbow: needs the MAC address for setting up TAP. */
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertBytes(pCfg, "MAC", &Mac, sizeof(Mac)); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertInteger(pCfg, "FileHandle", pConsole->maTapFD[ulInstance]); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync#elif defined(VBOX_WITH_NETFLT) && !defined(RT_OS_WINDOWS) /** @todo merge in the windows stuff too */
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync * This is the new VBoxNetFlt+IntNet stuff.
d571b6e3237f0ce89ea27f6fa4635d41c5ee3d88vboxsync rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL0); RC_CHECK();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();
efff36b306e370346025647a158689021df2e1d1vboxsync hrc = networkAdapter->COMGETTER(HostInterface)(HifName.asOutParam()); H();
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync /* The name is on the form 'ifX: long name', chop it off at the colon. */
51fe8789a74f6c118894aaa12eb69ec155386dbdvboxsync char *pszColon = (char *)memchr(szTrunk, ':', sizeof(szTrunk));
a3369a746b56a8966dd78619f4d191c9662f400dvboxsync return VMSetError(pVM, VERR_INTERNAL_ERROR, RT_SRC_POS,
a3369a746b56a8966dd78619f4d191c9662f400dvboxsync N_("Malformed host interface networking name '%ls'"),
27b178e99b06a68ef52353b15bc647674d2006bcvboxsync /* The name is on the form format 'ifX - long name, chop it off at space. */
27b178e99b06a68ef52353b15bc647674d2006bcvboxsync char *pszSpace = (char *)memchr(szTrunk, ' ', sizeof(szTrunk));
27b178e99b06a68ef52353b15bc647674d2006bcvboxsync * Currently don't bother about malformed names here for the sake of people using
27b178e99b06a68ef52353b15bc647674d2006bcvboxsync * VBoxManage and setting only the NIC name from there. If there is a space we
27b178e99b06a68ef52353b15bc647674d2006bcvboxsync * chop it off and proceed, otherwise just use whatever we've got.
27b178e99b06a68ef52353b15bc647674d2006bcvboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "IntNet"); RC_CHECK();
27b178e99b06a68ef52353b15bc647674d2006bcvboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
27b178e99b06a68ef52353b15bc647674d2006bcvboxsync rc = CFGMR3InsertString(pCfg, "Trunk", pszTrunk); RC_CHECK();
27b178e99b06a68ef52353b15bc647674d2006bcvboxsync rc = CFGMR3InsertInteger(pCfg, "TrunkType", kIntNetTrunkType_NetFlt); RC_CHECK();
27b178e99b06a68ef52353b15bc647674d2006bcvboxsync RTStrPrintf(szNetwork, sizeof(szNetwork), "HostInterfaceNetworking-%s\n", pszHifName);
27b178e99b06a68ef52353b15bc647674d2006bcvboxsync rc = CFGMR3InsertString(pCfg, "Network", szNetwork); RC_CHECK();
a3369a746b56a8966dd78619f4d191c9662f400dvboxsync /** @todo Come up with a better deal here. Problem is that IHostNetworkInterface is completely useless here. */
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertInteger(pCfg, "SharedMacOnWire", true); RC_CHECK();
5d0d754550d06b7d59a935e59caaf814462d53ccvboxsync /** @todo PORTME: wireless detection */
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL0); RC_CHECK();
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync hrc = networkAdapter->COMGETTER(HostInterface)(hostInterfaceName.asOutParam()); H();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync hrc = host->COMGETTER(NetworkInterfaces)(coll.asOutParam()); H();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = coll->FindByName(hostInterfaceName, hostInterface.asOutParam());
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync AssertMsgFailed(("Cannot get GUID for host interface '%ls'\n", hostInterfaceName));
d9d5fbda1b8f7a6f7fae555db60d0e636fd03af8vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "HostInterface"); RC_CHECK();
d9d5fbda1b8f7a6f7fae555db60d0e636fd03af8vboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
d9d5fbda1b8f7a6f7fae555db60d0e636fd03af8vboxsync rc = CFGMR3InsertString(pCfg, "HostInterfaceName", Utf8Str(hostInterfaceName)); RC_CHECK();
d9d5fbda1b8f7a6f7fae555db60d0e636fd03af8vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "IntNet"); RC_CHECK();
670b83d458bceb92123155b5b47a39b9d24e3266vboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync rc = CFGMR3InsertString(pCfg, "Trunk", Utf8Str(hostInterfaceName)); RC_CHECK();
670b83d458bceb92123155b5b47a39b9d24e3266vboxsync rc = CFGMR3InsertInteger(pCfg, "TrunkType", kIntNetTrunkType_NetFlt); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync hrc = hostInterface->COMGETTER(Id)(hostIFGuid.asOutParam()); H();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync /* add curly brackets */
f35c44bfc9e1036d0cb376fb144cdae416c7ef3avboxsync strcpy(szDriverGUID + 1, hostIFGuid.toString().raw());
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertBytes(pCfg, "GUID", szDriverGUID, sizeof(szDriverGUID)); RC_CHECK();
9496f2d398b49813176939d7a339ae513d5175efvboxsync return VMSetError(pVM, VERR_HOSTIF_INIT_FAILED, RT_SRC_POS, N_(
d80c85a1bc7317da7d0cd1254fae6a20db039c8cvboxsync "Failed to open '/dev/net/tun' for read/write access. Please check the "
9496f2d398b49813176939d7a339ae513d5175efvboxsync "permissions of that node. Either run 'chmod 0666 /dev/net/tun' or "
9496f2d398b49813176939d7a339ae513d5175efvboxsync "change the group of that node and make yourself a member of that group. Make "
b7a5b3f9f9ecce32ddacf8404c625ce0451bbdc1vboxsync "sure that these changes are permanent, especially if you are "
6b223679d40f5e57e55e867e806a9f194e2cde12vboxsync "using udev"));
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync#endif /* RT_OS_LINUX */
548ca31b6b47c36bacce49bed3339cb8075b9681vboxsync AssertMsgFailed(("Could not attach to host interface! Bad!\n"));
6b223679d40f5e57e55e867e806a9f194e2cde12vboxsync return VMSetError(pVM, VERR_HOSTIF_INIT_FAILED, RT_SRC_POS, N_(
d1bffa158f98ff3c18f7d085e7372c9ea00e9a43vboxsync "Failed to initialize Host Interface Networking"));
6b223679d40f5e57e55e867e806a9f194e2cde12vboxsync hrc = networkAdapter->COMGETTER(InternalNetwork)(&str); H();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL0); RC_CHECK();
d9d5fbda1b8f7a6f7fae555db60d0e636fd03af8vboxsync rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();
d9d5fbda1b8f7a6f7fae555db60d0e636fd03af8vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "IntNet"); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertString(pCfg, "Network", psz); RC_CHECK();
1bf495e3eec00dd79cecb6b36ef2a97f422c3737vboxsync * Serial (UART) Ports
b7a5b3f9f9ecce32ddacf8404c625ce0451bbdc1vboxsync rc = CFGMR3InsertNode(pDevices, "serial", &pDev); RC_CHECK();
d9d5fbda1b8f7a6f7fae555db60d0e636fd03af8vboxsync for (ULONG ulInstance = 0; ulInstance < SchemaDefs::SerialPortCount; ulInstance++)
d9d5fbda1b8f7a6f7fae555db60d0e636fd03af8vboxsync hrc = pMachine->GetSerialPort (ulInstance, serialPort.asOutParam()); H();
d9d5fbda1b8f7a6f7fae555db60d0e636fd03af8vboxsync hrc = serialPort->COMGETTER(Enabled)(&fEnabled); H();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync RTStrPrintf(szInstance, sizeof(szInstance), "%lu", ulInstance);
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertNode(pDev, szInstance, &pInst); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK();
09127e6ed46502ff8a6a521713ee8ace53667683vboxsync hrc = serialPort->COMGETTER(HostMode)(&HostMode); H();
ad77e3ec3cde24263bc7537575f5cae442bee3b1vboxsync hrc = serialPort->COMGETTER(IOBase)(&ulIOBase); H();
ad77e3ec3cde24263bc7537575f5cae442bee3b1vboxsync hrc = serialPort->COMGETTER(Path)(path.asOutParam()); H();
ad77e3ec3cde24263bc7537575f5cae442bee3b1vboxsync hrc = serialPort->COMGETTER(Server)(&fServer); H();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertInteger(pCfg, "IRQ", ulIRQ); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertInteger(pCfg, "IOBase", ulIOBase); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "Char"); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pLunL1); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertString(pLunL1, "Driver", "NamedPipe"); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertNode(pLunL1, "Config", &pLunL2); RC_CHECK();
8083a259c13e6e26e56ca2582edbad4a8cfac25avboxsync rc = CFGMR3InsertString(pLunL2, "Location", Utf8Str(path)); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertInteger(pLunL2, "IsServer", fServer); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertString(pLunL0, "Driver", "Host Serial"); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertNode(pLunL0, "Config", &pLunL1); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync rc = CFGMR3InsertString(pLunL1, "DevicePath", Utf8Str(path)); RC_CHECK();
a0240ff4f7663045c848fdbc192ea3d4d9f70a11vboxsync * Parallel (LPT) Ports
cba6719bd64ec749967bbe931230452664109857vboxsync rc = CFGMR3InsertNode(pDevices, "parallel", &pDev); RC_CHECK();
cba6719bd64ec749967bbe931230452664109857vboxsync for (ULONG ulInstance = 0; ulInstance < SchemaDefs::ParallelPortCount; ulInstance++)
9496f2d398b49813176939d7a339ae513d5175efvboxsync hrc = pMachine->GetParallelPort (ulInstance, parallelPort.asOutParam()); H();
cba6719bd64ec749967bbe931230452664109857vboxsync hrc = parallelPort->COMGETTER(Enabled)(&fEnabled); H();
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_GUEST_PROPS
bool fGlobalExtraData = true;
if (fGlobalExtraData)
if (fGlobalExtraData)
fGlobalExtraData = false;
if (pszCFGMValueName)
if (pNode)
#undef H
return rc;