settings.h revision 26ae7f0cac38c33d90eb69a15baef5fbdf7ca376
92304df70cde1a3a2f60358cab6f0c88702e0ea5vboxsync * Settings file data structures.
92304df70cde1a3a2f60358cab6f0c88702e0ea5vboxsync * These structures are created by the settings file loader and filled with values
c90e13620d230b7e730878150ad468aac188ba0cvboxsync * copied from the raw XML data. This was all new with VirtualBox 3.1 and allows us
c90e13620d230b7e730878150ad468aac188ba0cvboxsync * to finally make the XML reader version-independent and read VirtualBox XML files
92304df70cde1a3a2f60358cab6f0c88702e0ea5vboxsync * from earlier and even newer (future) versions without requiring complicated,
92304df70cde1a3a2f60358cab6f0c88702e0ea5vboxsync * tedious and error-prone XSLT conversions.
92304df70cde1a3a2f60358cab6f0c88702e0ea5vboxsync * It is this file that defines all structures that map VirtualBox global and
92304df70cde1a3a2f60358cab6f0c88702e0ea5vboxsync * machine settings to XML files. These structures are used by the rest of Main,
92304df70cde1a3a2f60358cab6f0c88702e0ea5vboxsync * even though this header file does not require anything else in Main.
92304df70cde1a3a2f60358cab6f0c88702e0ea5vboxsync * Note: Headers in Main code have been tweaked to only declare the structures
92304df70cde1a3a2f60358cab6f0c88702e0ea5vboxsync * defined here so that this header need only be included from code files that
92304df70cde1a3a2f60358cab6f0c88702e0ea5vboxsync * actually use these structures.
92304df70cde1a3a2f60358cab6f0c88702e0ea5vboxsync * Copyright (C) 2007-2010 Oracle Corporation
92304df70cde1a3a2f60358cab6f0c88702e0ea5vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
92304df70cde1a3a2f60358cab6f0c88702e0ea5vboxsync * available from http://www.virtualbox.org. This file is free software;
92304df70cde1a3a2f60358cab6f0c88702e0ea5vboxsync * you can redistribute it and/or modify it under the terms of the GNU
92304df70cde1a3a2f60358cab6f0c88702e0ea5vboxsync * General Public License (GPL) as published by the Free Software
92304df70cde1a3a2f60358cab6f0c88702e0ea5vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
92304df70cde1a3a2f60358cab6f0c88702e0ea5vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
92304df70cde1a3a2f60358cab6f0c88702e0ea5vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
92304df70cde1a3a2f60358cab6f0c88702e0ea5vboxsync * The contents of this file may alternatively be used under the terms
92304df70cde1a3a2f60358cab6f0c88702e0ea5vboxsync * of the Common Development and Distribution License Version 1.0
0760bbd185c492c09d7ef61fdceb498b279e771cvboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
0760bbd185c492c09d7ef61fdceb498b279e771cvboxsync * VirtualBox OSE distribution, in which case the provisions of the
92304df70cde1a3a2f60358cab6f0c88702e0ea5vboxsync * CDDL are applicable instead of those of the GPL.
92304df70cde1a3a2f60358cab6f0c88702e0ea5vboxsync * You may elect to license modified versions of this file under the
0760bbd185c492c09d7ef61fdceb498b279e771cvboxsync * terms and conditions of either the GPL or the CDDL or both.
92304df70cde1a3a2f60358cab6f0c88702e0ea5vboxsync////////////////////////////////////////////////////////////////////////////////
92304df70cde1a3a2f60358cab6f0c88702e0ea5vboxsync// Structures shared between Machine XML and VirtualBox.xml
92304df70cde1a3a2f60358cab6f0c88702e0ea5vboxsync////////////////////////////////////////////////////////////////////////////////
0760bbd185c492c09d7ef61fdceb498b279e771cvboxsync * USB device filter definition. This struct is used both in MainConfigFile
0760bbd185c492c09d7ef61fdceb498b279e771cvboxsync * (for global USB filters) and MachineConfigFile (for machine filters).
0760bbd185c492c09d7ef61fdceb498b279e771cvboxsync * NOTE: If you add any fields in here, you must update a) the constructor and b)
0760bbd185c492c09d7ef61fdceb498b279e771cvboxsync * the operator== which is used by MachineConfigFile::operator==(), or otherwise
0760bbd185c492c09d7ef61fdceb498b279e771cvboxsync * your settings might never get saved.
// ExtraDataItem (used by both VirtualBox.xml and machines XML)
struct USBDeviceFilter;
struct Medium;
struct Medium
* VirtualBox.xml file as well as machine XML files with settings version 1.11
struct MediaRegistry
bool fileExists();
~ConfigFileBase();
void createStubDocument();
bool fHostMode);
const Medium &m,
void clearDocument();
struct Data;
Data *m;
// VirtualBox.xml structures
struct Host
struct SystemProperties
struct MachineRegistryEntry
struct DHCPServer
bool fEnabled;
struct VRDPSettings
: fEnabled(true),
fAllowMultiConnection(false),
fReuseSingleConnection(false),
fVideoChannel(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),
ulBootPriority(0),
fHasDisabledNAT(false),
bool fEnabled;
bool fCableConnected;
bool fTraceEnabled;
bool fHasDisabledNAT;
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 IoSettings
IoSettings();
bool fIoCacheEnabled;
* 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),
lPort(0),
lDevice(0),
bool fPassThrough;
struct StorageController
ulInstance(0),
fUseHostIOCache(true),
bool fUseHostIOCache;
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, const NetworkAdapter &nic);
bool fSkipRemovableMedia,
void bumpSettingsVersionIfNeeded();