settings.h revision 051eba4436f9c682f7873390fb327e8eceb9e0ef
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * Settings file data structures.
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * These structures are created by the settings file loader and filled with values
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * copied from the raw XML data. This was all new with VirtualBox 3.1 and allows us
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * to finally make the XML reader version-independent and read VirtualBox XML files
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * from earlier and even newer (future) versions without requiring complicated,
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * tedious and error-prone XSLT conversions.
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * It is this file that defines all structures that map VirtualBox global and
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * machine settings to XML files. These structures are used by the rest of Main,
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * even though this header file does not require anything else in Main.
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * Note: Headers in Main code have been tweaked to only declare the structures
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * defined here so that this header need only be included from code files that
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * actually use these structures.
d10b594ea1bfbfb3dbd7132080ab860abe618cb4vboxsync * Copyright (C) 2007-2011 Oracle Corporation
d10b594ea1bfbfb3dbd7132080ab860abe618cb4vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
d10b594ea1bfbfb3dbd7132080ab860abe618cb4vboxsync * available from http://www.virtualbox.org. This file is free software;
d10b594ea1bfbfb3dbd7132080ab860abe618cb4vboxsync * you can redistribute it and/or modify it under the terms of the GNU
d10b594ea1bfbfb3dbd7132080ab860abe618cb4vboxsync * General Public License (GPL) as published by the Free Software
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * The contents of this file may alternatively be used under the terms
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * of the Common Development and Distribution License Version 1.0
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * VirtualBox OSE distribution, in which case the provisions of the
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * CDDL are applicable instead of those of the GPL.
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * You may elect to license modified versions of this file under the
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * terms and conditions of either the GPL or the CDDL or both.
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync////////////////////////////////////////////////////////////////////////////////
b67986b52286959154244a144c62c9f40091fbbbvboxsync// Structures shared between Machine XML and VirtualBox.xml
b67986b52286959154244a144c62c9f40091fbbbvboxsync////////////////////////////////////////////////////////////////////////////////
3b6727bcf40d710e50ad98533cc3f05adaae0226vboxsync * USB device filter definition. This struct is used both in MainConfigFile
3b6727bcf40d710e50ad98533cc3f05adaae0226vboxsync * (for global USB filters) and MachineConfigFile (for machine filters).
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * NOTE: If you add any fields in here, you must update a) the constructor and b)
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * the operator== which is used by MachineConfigFile::operator==(), or otherwise
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * your settings might never get saved.
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync USBDeviceFilterAction_T action; // only used with host USB filters
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync com::Utf8Str strRemote; // irrelevant for host USB objects
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync uint32_t ulMaskedInterfaces; // irrelevant for host USB objects
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsynctypedef std::map<com::Utf8Str, com::Utf8Str> StringsMap;
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync// ExtraDataItem (used by both VirtualBox.xml and machines XML)
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsynctypedef std::list<USBDeviceFilter> USBDeviceFiltersList;
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * NOTE: If you add any fields in here, you must update a) the constructor and b)
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * the operator== which is used by MachineConfigFile::operator==(), or otherwise
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * your settings might never get saved.
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync // the following are for hard disks only:
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync bool fAutoReset; // optional, only for diffs, default is false
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * A media registry. Starting with VirtualBox 3.3, this can appear in both the
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * VirtualBox.xml file as well as machine XML files with settings version 1.11
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * or higher, so these lists are now in ConfigFileBase.
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * NOTE: If you add any fields in here, you must update a) the constructor and b)
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * the operator== which is used by MachineConfigFile::operator==(), or otherwise
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * your settings might never get saved.
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * Common base class for both MainConfigFile and MachineConfigFile
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * which contains some common logic for both.
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync /* Note: this copy constructor doesn't create a full copy of other, cause
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync * the file based stuff (xml doc) could not be copied. */
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync void readExtraData(const xml::ElementNode &elmExtraData,
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync void readUSBDeviceFilters(const xml::ElementNode &elmDeviceFilters,
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync typedef enum {Error, HardDisk, DVDImage, FloppyImage} MediaType;
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync void readMedium(MediaType t, const xml::ElementNode &elmMedium, MediaList &llMedia);
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync void readMediaRegistry(const xml::ElementNode &elmMediaRegistry, MediaRegistry &mr);
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync void buildExtraData(xml::ElementNode &elmParent, const StringsMap &me);
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync void buildUSBDeviceFilters(xml::ElementNode &elmParent,
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync void buildMediaRegistry(xml::ElementNode &elmParent,
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync////////////////////////////////////////////////////////////////////////////////
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsync////////////////////////////////////////////////////////////////////////////////
241541868b26b18d777209f5e6c2c0c6ad9d02eevboxsynctypedef std::list<MachineRegistryEntry> MachinesRegistry;
bool fEnabled;
struct VRDESettings
: fEnabled(true),
fAllowMultiConnection(false),
fReuseSingleConnection(false)
bool fEnabled;
bool fAllowMultiConnection,
struct BIOSSettings
: fACPIEnabled(true),
fIOAPICEnabled(false),
fLogoFadeIn(true),
fLogoFadeOut(true),
fPXEDebugEnabled(false),
llTimeOffset(0)
bool fACPIEnabled,
bool fPXEDebugEnabled;
struct USBController
: fEnabled(false),
fEnabledEHCI(false)
bool fEnabled;
bool fEnabledEHCI;
struct NATRule
u16HostPort(0),
u16GuestPort(0){}
struct NAT
u32SockRcv(0),
u32SockSnd(0),
u32TcpRcv(0),
u32TcpSnd(0),
fDnsProxy(false),
fDnsUseHostResolver(false),
fAliasLog(false),
fAliasProxyOnly(false),
fAliasUseSamePorts(false)
bool fDnsPassDomain;
bool fDnsProxy;
bool fDnsUseHostResolver;
bool fAliasLog;
bool fAliasProxyOnly;
bool fAliasUseSamePorts;
struct NetworkAdapter
: ulSlot(0),
fEnabled(false),
fCableConnected(false),
ulLineSpeed(0),
fTraceEnabled(false),
bool fEnabled;
bool fCableConnected;
bool fTraceEnabled;
struct SerialPort
: ulSlot(0),
fEnabled(false),
fServer(false)
bool fEnabled;
bool fServer;
struct ParallelPort
: ulSlot(0),
fEnabled(false),
bool fEnabled;
struct AudioAdapter
: fEnabled(true),
return (this == &a)
bool fEnabled;
struct SharedFolder
: fWritable(false)
, fAutoMount(false)
bool fWritable;
bool fAutoMount;
struct GuestProperty
: timestamp(0)
struct CpuIdLeaf
ulEax(0),
ulEbx(0),
ulEcx(0),
ulEdx(0)
return ( (this == &c)
struct Cpu
Cpu()
struct BandwidthGroup
: cMaxMbPerSec(0),
struct IoSettings
IoSettings();
bool fIoCacheEnabled;
struct HostPciDeviceAttachment
: uHostAddress(0),
* Representation of Machine hardware; this is used in the MachineConfigFile.hardwareMachine
struct Hardware
Hardware();
bool fHardwareVirt,
fPAE;
bool fAccelerate3D,
bool fPageFusionEnabled;
struct AttachedDevice
fPassThrough(false),
fTempEject(false),
fNonRotational(false),
lPort(0),
lDevice(0)
bool fPassThrough;
bool fTempEject;
bool fNonRotational;
struct StorageController
ulInstance(0),
fUseHostIOCache(true),
fBootable(true),
bool fUseHostIOCache;
bool fBootable;
struct Storage
struct Snapshot;
struct Snapshot
struct MachineUserData
: fNameSync(true),
fTeleporterEnabled(false),
uTeleporterPort(0),
fRTCUseUTC(false)
bool fNameSync;
bool fTeleporterEnabled;
bool fRTCUseUTC;
bool canHaveOwnMediaRegistry() const;
void readStorageControllerAttributes(const xml::ElementNode &elmStorageController, StorageController &sctl);
void buildNetworkXML(NetworkAttachmentType_T mode, xml::ElementNode &elmParent, bool fEnabled, const NetworkAdapter &nic);
bool fSkipRemovableMedia,
void bumpSettingsVersionIfNeeded();