VirtualBox

source: vbox/trunk/include/VBox/settings.h@ 91991

Last change on this file since 91991 was 91416, checked in by vboxsync, 3 years ago

Devices: bugref:9932 DrvVMNet and host-only network initial implementation

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Revision Author Id
File size: 47.3 KB
Line 
1/** @file
2 * Settings file data structures.
3 *
4 * These structures are created by the settings file loader and filled with values
5 * copied from the raw XML data. This was all new with VirtualBox 3.1 and allows us
6 * to finally make the XML reader version-independent and read VirtualBox XML files
7 * from earlier and even newer (future) versions without requiring complicated,
8 * tedious and error-prone XSLT conversions.
9 *
10 * It is this file that defines all structures that map VirtualBox global and
11 * machine settings to XML files. These structures are used by the rest of Main,
12 * even though this header file does not require anything else in Main.
13 *
14 * Note: Headers in Main code have been tweaked to only declare the structures
15 * defined here so that this header need only be included from code files that
16 * actually use these structures.
17 */
18
19/*
20 * Copyright (C) 2007-2020 Oracle Corporation
21 *
22 * This file is part of VirtualBox Open Source Edition (OSE), as
23 * available from http://www.virtualbox.org. This file is free software;
24 * you can redistribute it and/or modify it under the terms of the GNU
25 * General Public License (GPL) as published by the Free Software
26 * Foundation, in version 2 as it comes in the "COPYING" file of the
27 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
28 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
29 *
30 * The contents of this file may alternatively be used under the terms
31 * of the Common Development and Distribution License Version 1.0
32 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
33 * VirtualBox OSE distribution, in which case the provisions of the
34 * CDDL are applicable instead of those of the GPL.
35 *
36 * You may elect to license modified versions of this file under the
37 * terms and conditions of either the GPL or the CDDL or both.
38 */
39
40#ifndef VBOX_INCLUDED_settings_h
41#define VBOX_INCLUDED_settings_h
42#ifndef RT_WITHOUT_PRAGMA_ONCE
43# pragma once
44#endif
45
46#include <iprt/time.h>
47
48#include "VBox/com/VirtualBox.h"
49
50#include <VBox/com/Guid.h>
51#include <VBox/com/string.h>
52
53#include <list>
54#include <map>
55#include <vector>
56
57/**
58 * Maximum depth of a medium tree, to prevent stack overflows.
59 * XPCOM has a relatively low stack size for its workers, and we have
60 * to avoid crashes due to exceeding the limit both on reading and
61 * writing config files.
62 */
63#define SETTINGS_MEDIUM_DEPTH_MAX 300
64
65/**
66 * Maximum depth of the snapshot tree, to prevent stack overflows.
67 * XPCOM has a relatively low stack size for its workers, and we have
68 * to avoid crashes due to exceeding the limit both on reading and
69 * writing config files. The bottleneck is reading config files with
70 * deep snapshot nesting, as libxml2 needs quite some stack space,
71 * so with the current stack size the margin isn't big.
72 */
73#define SETTINGS_SNAPSHOT_DEPTH_MAX 250
74
75namespace xml
76{
77 class ElementNode;
78}
79
80namespace settings
81{
82
83class ConfigFileError;
84
85////////////////////////////////////////////////////////////////////////////////
86//
87// Structures shared between Machine XML and VirtualBox.xml
88//
89////////////////////////////////////////////////////////////////////////////////
90
91typedef std::map<com::Utf8Str, com::Utf8Str> StringsMap;
92typedef std::list<com::Utf8Str> StringsList;
93
94/**
95 * USB device filter definition. This struct is used both in MainConfigFile
96 * (for global USB filters) and MachineConfigFile (for machine filters).
97 *
98 * NOTE: If you add any fields in here, you must update a) the constructor and b)
99 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
100 * your settings might never get saved.
101 */
102struct USBDeviceFilter
103{
104 USBDeviceFilter();
105
106 bool operator==(const USBDeviceFilter&u) const;
107
108 com::Utf8Str strName;
109 bool fActive;
110 com::Utf8Str strVendorId,
111 strProductId,
112 strRevision,
113 strManufacturer,
114 strProduct,
115 strSerialNumber,
116 strPort;
117 USBDeviceFilterAction_T action; // only used with host USB filters
118 com::Utf8Str strRemote; // irrelevant for host USB objects
119 uint32_t ulMaskedInterfaces; // irrelevant for host USB objects
120};
121
122typedef std::list<USBDeviceFilter> USBDeviceFiltersList;
123
124struct Medium;
125typedef std::list<Medium> MediaList;
126
127/**
128 * NOTE: If you add any fields in here, you must update a) the constructor and b)
129 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
130 * your settings might never get saved.
131 */
132struct Medium
133{
134 Medium();
135
136 bool operator==(const Medium &m) const;
137
138 com::Guid uuid;
139 com::Utf8Str strLocation;
140 com::Utf8Str strDescription;
141
142 // the following are for hard disks only:
143 com::Utf8Str strFormat;
144 bool fAutoReset; // optional, only for diffs, default is false
145 StringsMap properties;
146 MediumType_T hdType;
147
148 MediaList llChildren; // only used with hard disks
149
150 static const struct Medium Empty;
151};
152
153/**
154 * A media registry. Starting with VirtualBox 3.3, this can appear in both the
155 * VirtualBox.xml file as well as machine XML files with settings version 1.11
156 * or higher, so these lists are now in ConfigFileBase.
157 *
158 * NOTE: If you add any fields in here, you must update a) the constructor and b)
159 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
160 * your settings might never get saved.
161 */
162struct MediaRegistry
163{
164 bool operator==(const MediaRegistry &m) const;
165
166 MediaList llHardDisks,
167 llDvdImages,
168 llFloppyImages;
169};
170
171/**
172 * NOTE: If you add any fields in here, you must update a) the constructor and b)
173 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
174 * your settings might never get saved.
175 */
176struct NATRule
177{
178 NATRule();
179
180 bool operator==(const NATRule &r) const;
181
182 com::Utf8Str strName;
183 NATProtocol_T proto;
184 uint16_t u16HostPort;
185 com::Utf8Str strHostIP;
186 uint16_t u16GuestPort;
187 com::Utf8Str strGuestIP;
188};
189typedef std::map<com::Utf8Str, NATRule> NATRulesMap;
190
191struct NATHostLoopbackOffset
192{
193 NATHostLoopbackOffset();
194
195 bool operator==(const NATHostLoopbackOffset &o) const;
196
197 bool operator==(const com::Utf8Str& strAddr)
198 {
199 return strLoopbackHostAddress == strAddr;
200 }
201
202 bool operator==(uint32_t off)
203 {
204 return u32Offset == off;
205 }
206
207 /** Note: 128/8 is only acceptable */
208 com::Utf8Str strLoopbackHostAddress;
209 uint32_t u32Offset;
210};
211
212typedef std::list<NATHostLoopbackOffset> NATLoopbackOffsetList;
213
214typedef std::vector<uint8_t> IconBlob;
215
216/**
217 * Common base class for both MainConfigFile and MachineConfigFile
218 * which contains some common logic for both.
219 */
220class ConfigFileBase
221{
222public:
223 bool fileExists();
224
225 void copyBaseFrom(const ConfigFileBase &b);
226
227protected:
228 ConfigFileBase(const com::Utf8Str *pstrFilename);
229 /* Note: this copy constructor doesn't create a full copy of other, cause
230 * the file based stuff (xml doc) could not be copied. */
231 ConfigFileBase(const ConfigFileBase &other);
232
233 ~ConfigFileBase();
234
235 typedef enum {Error, HardDisk, DVDImage, FloppyImage} MediaType;
236
237 static const char *stringifyMediaType(MediaType t);
238 SettingsVersion_T parseVersion(const com::Utf8Str &strVersion,
239 const xml::ElementNode *pElm);
240 void parseUUID(com::Guid &guid,
241 const com::Utf8Str &strUUID,
242 const xml::ElementNode *pElm) const;
243 void parseTimestamp(RTTIMESPEC &timestamp,
244 const com::Utf8Str &str,
245 const xml::ElementNode *pElm) const;
246 void parseBase64(IconBlob &binary,
247 const com::Utf8Str &str,
248 const xml::ElementNode *pElm) const;
249 com::Utf8Str stringifyTimestamp(const RTTIMESPEC &tm) const;
250 void toBase64(com::Utf8Str &str,
251 const IconBlob &binary) const;
252
253 void readExtraData(const xml::ElementNode &elmExtraData,
254 StringsMap &map);
255 void readUSBDeviceFilters(const xml::ElementNode &elmDeviceFilters,
256 USBDeviceFiltersList &ll);
257 void readMediumOne(MediaType t, const xml::ElementNode &elmMedium, Medium &med);
258 void readMedium(MediaType t, uint32_t depth, const xml::ElementNode &elmMedium, Medium &med);
259 void readMediaRegistry(const xml::ElementNode &elmMediaRegistry, MediaRegistry &mr);
260 void readNATForwardRulesMap(const xml::ElementNode &elmParent, NATRulesMap &mapRules);
261 void readNATLoopbacks(const xml::ElementNode &elmParent, NATLoopbackOffsetList &llLoopBacks);
262
263 void setVersionAttribute(xml::ElementNode &elm);
264 void specialBackupIfFirstBump();
265 void createStubDocument();
266
267 void buildExtraData(xml::ElementNode &elmParent, const StringsMap &me);
268 void buildUSBDeviceFilters(xml::ElementNode &elmParent,
269 const USBDeviceFiltersList &ll,
270 bool fHostMode);
271 void buildMedium(MediaType t,
272 uint32_t depth,
273 xml::ElementNode &elmMedium,
274 const Medium &mdm);
275 void buildMediaRegistry(xml::ElementNode &elmParent,
276 const MediaRegistry &mr);
277 void buildNATForwardRulesMap(xml::ElementNode &elmParent, const NATRulesMap &mapRules);
278 void buildNATLoopbacks(xml::ElementNode &elmParent, const NATLoopbackOffsetList &natLoopbackList);
279 void clearDocument();
280
281 struct Data;
282 Data *m;
283
284 friend class ConfigFileError;
285};
286
287////////////////////////////////////////////////////////////////////////////////
288//
289// VirtualBox.xml structures
290//
291////////////////////////////////////////////////////////////////////////////////
292
293struct USBDeviceSource
294{
295 com::Utf8Str strName;
296 com::Utf8Str strBackend;
297 com::Utf8Str strAddress;
298 StringsMap properties;
299};
300
301typedef std::list<USBDeviceSource> USBDeviceSourcesList;
302
303struct Host
304{
305 USBDeviceFiltersList llUSBDeviceFilters;
306 USBDeviceSourcesList llUSBDeviceSources;
307};
308
309struct SystemProperties
310{
311 SystemProperties();
312
313 com::Utf8Str strDefaultMachineFolder;
314 com::Utf8Str strDefaultHardDiskFolder;
315 com::Utf8Str strDefaultHardDiskFormat;
316 com::Utf8Str strVRDEAuthLibrary;
317 com::Utf8Str strWebServiceAuthLibrary;
318 com::Utf8Str strDefaultVRDEExtPack;
319 com::Utf8Str strAutostartDatabasePath;
320 com::Utf8Str strDefaultAdditionsISO;
321 com::Utf8Str strDefaultFrontend;
322 com::Utf8Str strLoggingLevel;
323 com::Utf8Str strProxyUrl;
324 uint32_t uProxyMode; /**< ProxyMode_T */
325 uint32_t uLogHistoryCount;
326 bool fExclusiveHwVirt;
327 bool fVBoxUpdateEnabled;
328 uint32_t uVBoxUpdateCount;
329 uint32_t uVBoxUpdateFrequency;
330 uint32_t uVBoxUpdateTarget; /**< VBoxUpdateTarget_T */
331 com::Utf8Str strVBoxUpdateLastCheckDate;
332 com::Utf8Str strLanguageId;
333};
334
335struct MachineRegistryEntry
336{
337 com::Guid uuid;
338 com::Utf8Str strSettingsFile;
339};
340
341typedef std::list<MachineRegistryEntry> MachinesRegistry;
342
343struct DhcpOptValue
344{
345 DhcpOptValue();
346 DhcpOptValue(const com::Utf8Str &aText, DHCPOptionEncoding_T aEncoding = DHCPOptionEncoding_Normal);
347
348 com::Utf8Str strValue;
349 DHCPOptionEncoding_T enmEncoding;
350};
351
352typedef std::map<DHCPOption_T, DhcpOptValue> DhcpOptionMap;
353typedef DhcpOptionMap::value_type DhcpOptValuePair;
354typedef DhcpOptionMap::iterator DhcpOptIterator;
355typedef DhcpOptionMap::const_iterator DhcpOptConstIterator;
356
357struct DHCPGroupCondition
358{
359 DHCPGroupCondition();
360
361 bool fInclusive;
362 DHCPGroupConditionType_T enmType;
363 com::Utf8Str strValue;
364};
365typedef std::vector<DHCPGroupCondition> DHCPGroupConditionVec;
366
367
368struct DHCPConfig
369{
370 DHCPConfig();
371
372 DhcpOptionMap mapOptions;
373 uint32_t secMinLeaseTime;
374 uint32_t secDefaultLeaseTime;
375 uint32_t secMaxLeaseTime;
376 com::Utf8Str strForcedOptions;
377 com::Utf8Str strSuppressedOptions;
378};
379
380struct DHCPGroupConfig : DHCPConfig
381{
382 DHCPGroupConfig();
383
384 com::Utf8Str strName;
385 DHCPGroupConditionVec vecConditions;
386};
387typedef std::vector<DHCPGroupConfig> DHCPGroupConfigVec;
388
389struct DHCPIndividualConfig : DHCPConfig
390{
391 DHCPIndividualConfig();
392
393 com::Utf8Str strMACAddress;
394 com::Utf8Str strVMName;
395 uint32_t uSlot;
396 com::Utf8Str strFixedAddress;
397};
398typedef std::map<com::Utf8Str, DHCPIndividualConfig> DHCPIndividualConfigMap;
399
400struct DHCPServer
401{
402 DHCPServer();
403
404 com::Utf8Str strNetworkName;
405 com::Utf8Str strIPAddress;
406 com::Utf8Str strIPLower;
407 com::Utf8Str strIPUpper;
408 bool fEnabled;
409 DHCPConfig globalConfig;
410 DHCPGroupConfigVec vecGroupConfigs;
411 DHCPIndividualConfigMap mapIndividualConfigs;
412};
413typedef std::list<DHCPServer> DHCPServersList;
414
415
416/**
417 * NAT Networking settings (NAT service).
418 */
419struct NATNetwork
420{
421 NATNetwork();
422
423 com::Utf8Str strNetworkName;
424 com::Utf8Str strIPv4NetworkCidr;
425 com::Utf8Str strIPv6Prefix;
426 bool fEnabled;
427 bool fIPv6Enabled;
428 bool fAdvertiseDefaultIPv6Route;
429 bool fNeedDhcpServer;
430 uint32_t u32HostLoopback6Offset;
431 NATLoopbackOffsetList llHostLoopbackOffsetList;
432 NATRulesMap mapPortForwardRules4;
433 NATRulesMap mapPortForwardRules6;
434};
435
436typedef std::list<NATNetwork> NATNetworksList;
437
438#ifdef VBOX_WITH_VMNET
439/**
440 * HostOnly Networking settings.
441 */
442struct HostOnlyNetwork
443{
444 HostOnlyNetwork();
445
446 com::Guid uuid;
447 com::Utf8Str strNetworkName;
448 com::Utf8Str strNetworkMask;
449 com::Utf8Str strIPLower;
450 com::Utf8Str strIPUpper;
451 bool fEnabled;
452};
453
454typedef std::list<HostOnlyNetwork> HostOnlyNetworksList;
455#endif /* VBOX_WITH_VMNET */
456
457#ifdef VBOX_WITH_CLOUD_NET
458/**
459 * Cloud Networking settings.
460 */
461struct CloudNetwork
462{
463 CloudNetwork();
464
465 com::Utf8Str strNetworkName;
466 com::Utf8Str strProviderShortName;
467 com::Utf8Str strProfileName;
468 com::Utf8Str strNetworkId;
469 bool fEnabled;
470};
471
472typedef std::list<CloudNetwork> CloudNetworksList;
473#endif /* VBOX_WITH_CLOUD_NET */
474
475
476class MainConfigFile : public ConfigFileBase
477{
478public:
479 MainConfigFile(const com::Utf8Str *pstrFilename);
480
481 void readMachineRegistry(const xml::ElementNode &elmMachineRegistry);
482 void readNATNetworks(const xml::ElementNode &elmNATNetworks);
483#ifdef VBOX_WITH_VMNET
484 void readHostOnlyNetworks(const xml::ElementNode &elmHostOnlyNetworks);
485#endif /* VBOX_WITH_VMNET */
486#ifdef VBOX_WITH_CLOUD_NET
487 void readCloudNetworks(const xml::ElementNode &elmCloudNetworks);
488#endif /* VBOX_WITH_CLOUD_NET */
489
490 void write(const com::Utf8Str strFilename);
491
492 Host host;
493 SystemProperties systemProperties;
494 MediaRegistry mediaRegistry;
495 MachinesRegistry llMachines;
496 DHCPServersList llDhcpServers;
497 NATNetworksList llNATNetworks;
498#ifdef VBOX_WITH_VMNET
499 HostOnlyNetworksList llHostOnlyNetworks;
500#endif /* VBOX_WITH_VMNET */
501#ifdef VBOX_WITH_CLOUD_NET
502 CloudNetworksList llCloudNetworks;
503#endif /* VBOX_WITH_CLOUD_NET */
504 StringsMap mapExtraDataItems;
505
506private:
507 void bumpSettingsVersionIfNeeded();
508 void buildUSBDeviceSources(xml::ElementNode &elmParent, const USBDeviceSourcesList &ll);
509 void readUSBDeviceSources(const xml::ElementNode &elmDeviceSources, USBDeviceSourcesList &ll);
510 void buildDHCPServers(xml::ElementNode &elmDHCPServers, DHCPServersList const &ll);
511 void buildDHCPOptions(xml::ElementNode &elmOptions, DHCPConfig const &rConfig, bool fIgnoreSubnetMask);
512 void readDHCPServers(const xml::ElementNode &elmDHCPServers);
513 void readDHCPOptions(DHCPConfig &rConfig, const xml::ElementNode &elmOptions, bool fIgnoreSubnetMask);
514 bool convertGuiProxySettings(const com::Utf8Str &strUIProxySettings);
515};
516
517////////////////////////////////////////////////////////////////////////////////
518//
519// Machine XML structures
520//
521////////////////////////////////////////////////////////////////////////////////
522
523/**
524 * NOTE: If you add any fields in here, you must update a) the constructor and b)
525 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
526 * your settings might never get saved.
527 */
528struct VRDESettings
529{
530 VRDESettings();
531
532 bool areDefaultSettings(SettingsVersion_T sv) const;
533
534 bool operator==(const VRDESettings& v) const;
535
536 bool fEnabled;
537 AuthType_T authType;
538 uint32_t ulAuthTimeout;
539 com::Utf8Str strAuthLibrary;
540 bool fAllowMultiConnection,
541 fReuseSingleConnection;
542 com::Utf8Str strVrdeExtPack;
543 StringsMap mapProperties;
544};
545
546/**
547 * NOTE: If you add any fields in here, you must update a) the constructor and b)
548 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
549 * your settings might never get saved.
550 */
551struct BIOSSettings
552{
553 BIOSSettings();
554
555 bool areDefaultSettings() const;
556
557 bool operator==(const BIOSSettings &d) const;
558
559 bool fACPIEnabled,
560 fIOAPICEnabled,
561 fLogoFadeIn,
562 fLogoFadeOut,
563 fPXEDebugEnabled,
564 fSmbiosUuidLittleEndian;
565 uint32_t ulLogoDisplayTime;
566 BIOSBootMenuMode_T biosBootMenuMode;
567 APICMode_T apicMode; // requires settings version 1.16 (VirtualBox 5.1)
568 int64_t llTimeOffset;
569 com::Utf8Str strLogoImagePath;
570};
571
572/**
573 * NOTE: If you add any fields in here, you must update a) the constructor and b)
574 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
575 * your settings might never get saved.
576 */
577struct TpmSettings
578{
579 TpmSettings();
580
581 bool areDefaultSettings() const;
582
583 bool operator==(const TpmSettings &d) const;
584
585 TpmType_T tpmType;
586 com::Utf8Str strLocation;
587};
588
589/**
590 * NOTE: If you add any fields in here, you must update a) the constructor and b)
591 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
592 * your settings might never get saved.
593 */
594struct NvramSettings
595{
596 NvramSettings();
597
598 bool areDefaultSettings() const;
599
600 bool operator==(const NvramSettings &d) const;
601
602 com::Utf8Str strNvramPath;
603};
604
605/** List for keeping a recording feature list. */
606typedef std::map<RecordingFeature_T, bool> RecordingFeatureMap;
607
608struct RecordingScreenSettings
609{
610 RecordingScreenSettings();
611
612 virtual ~RecordingScreenSettings();
613
614 void applyDefaults(void);
615
616 bool areDefaultSettings(void) const;
617
618 bool isFeatureEnabled(RecordingFeature_T enmFeature) const;
619
620 bool operator==(const RecordingScreenSettings &d) const;
621
622 /** Whether to record this screen or not. */
623 bool fEnabled; // requires settings version 1.14 (VirtualBox 4.3)
624 /** Destination to record to. */
625 RecordingDestination_T enmDest; /** @todo Implement with next settings version bump. */
626 /** Which features are enable or not. */
627 RecordingFeatureMap featureMap; /** @todo Implement with next settings version bump. */
628 /** Maximum time (in s) to record. If set to 0, no time limit is set. */
629 uint32_t ulMaxTimeS; // requires settings version 1.14 (VirtualBox 4.3)
630 /** Options string for hidden / advanced / experimental features. */
631 com::Utf8Str strOptions; // new since VirtualBox 5.2.
632
633 /**
634 * Structure holding settings for audio recording.
635 */
636 struct Audio
637 {
638 Audio()
639 : enmAudioCodec(RecordingAudioCodec_Opus)
640 , uHz(22050)
641 , cBits(16)
642 , cChannels(2) { }
643
644 /** The audio codec type to use. */
645 RecordingAudioCodec_T enmAudioCodec; /** @todo Implement with next settings version bump. */
646 /** Hz rate. */
647 uint16_t uHz; /** @todo Implement with next settings version bump. */
648 /** Bits per sample. */
649 uint8_t cBits; /** @todo Implement with next settings version bump. */
650 /** Number of audio channels. */
651 uint8_t cChannels; /** @todo Implement with next settings version bump. */
652 } Audio;
653
654 /**
655 * Structure holding settings for video recording.
656 */
657 struct Video
658 {
659 Video()
660 : enmCodec(RecordingVideoCodec_VP8)
661 , ulWidth(1024)
662 , ulHeight(768)
663 , ulRate(512)
664 , ulFPS(25) { }
665
666 /** The codec to use. */
667 RecordingVideoCodec_T enmCodec; /** @todo Implement with next settings version bump. */
668 /** Target frame width in pixels (X). */
669 uint32_t ulWidth; // requires settings version 1.14 (VirtualBox 4.3)
670 /** Target frame height in pixels (Y). */
671 uint32_t ulHeight; // requires settings version 1.14 (VirtualBox 4.3)
672 /** Encoding rate. */
673 uint32_t ulRate; // requires settings version 1.14 (VirtualBox 4.3)
674 /** Frames per second (FPS). */
675 uint32_t ulFPS; // requires settings version 1.14 (VirtualBox 4.3)
676 } Video;
677
678 /**
679 * Structure holding settings if the destination is a file.
680 */
681 struct File
682 {
683 File()
684 : ulMaxSizeMB(0) { }
685
686 /** Maximum size (in MB) the file is allowed to have.
687 * When reaching the limit, recording will stop. */
688 uint32_t ulMaxSizeMB; // requires settings version 1.14 (VirtualBox 4.3)
689 /** Absolute file name path to use for recording. */
690 com::Utf8Str strName; // requires settings version 1.14 (VirtualBox 4.3)
691 } File;
692};
693
694/** Map for keeping settings per virtual screen.
695 * The key specifies the screen ID. */
696typedef std::map<uint32_t, RecordingScreenSettings> RecordingScreenMap;
697
698/**
699 * NOTE: If you add any fields in here, you must update a) the constructor and b)
700 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
701 * your settings might never get saved.
702 */
703struct RecordingSettings
704{
705 RecordingSettings();
706
707 void applyDefaults(void);
708
709 bool areDefaultSettings(void) const;
710
711 bool operator==(const RecordingSettings &d) const;
712
713 /** Whether recording as a whole is enabled or disabled. */
714 bool fEnabled; // requires settings version 1.14 (VirtualBox 4.3)
715 /** Map of handled recording screen settings.
716 * The key specifies the screen ID. */
717 RecordingScreenMap mapScreens;
718};
719
720/**
721 * NOTE: If you add any fields in here, you must update a) the constructor and b)
722 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
723 * your settings might never get saved.
724 */
725struct GraphicsAdapter
726{
727 GraphicsAdapter();
728
729 bool areDefaultSettings() const;
730
731 bool operator==(const GraphicsAdapter &g) const;
732
733 GraphicsControllerType_T graphicsControllerType;
734 uint32_t ulVRAMSizeMB;
735 uint32_t cMonitors;
736 bool fAccelerate3D,
737 fAccelerate2DVideo; // requires settings version 1.8 (VirtualBox 3.1)
738};
739
740/**
741 * NOTE: If you add any fields in here, you must update a) the constructor and b)
742 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
743 * your settings might never get saved.
744 */
745struct USBController
746{
747 USBController();
748
749 bool operator==(const USBController &u) const;
750
751 com::Utf8Str strName;
752 USBControllerType_T enmType;
753};
754
755typedef std::list<USBController> USBControllerList;
756
757struct USB
758{
759 USB();
760
761 bool operator==(const USB &u) const;
762
763 /** List of USB controllers present. */
764 USBControllerList llUSBControllers;
765 /** List of USB device filters. */
766 USBDeviceFiltersList llDeviceFilters;
767};
768
769struct NAT
770{
771 NAT();
772
773 bool areDNSDefaultSettings() const;
774 bool areAliasDefaultSettings() const;
775 bool areTFTPDefaultSettings() const;
776 bool areDefaultSettings() const;
777
778 bool operator==(const NAT &n) const;
779
780 com::Utf8Str strNetwork;
781 com::Utf8Str strBindIP;
782 uint32_t u32Mtu;
783 uint32_t u32SockRcv;
784 uint32_t u32SockSnd;
785 uint32_t u32TcpRcv;
786 uint32_t u32TcpSnd;
787 com::Utf8Str strTFTPPrefix;
788 com::Utf8Str strTFTPBootFile;
789 com::Utf8Str strTFTPNextServer;
790 bool fDNSPassDomain;
791 bool fDNSProxy;
792 bool fDNSUseHostResolver;
793 bool fAliasLog;
794 bool fAliasProxyOnly;
795 bool fAliasUseSamePorts;
796 NATRulesMap mapRules;
797};
798
799/**
800 * NOTE: If you add any fields in here, you must update a) the constructor and b)
801 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
802 * your settings might never get saved.
803 */
804struct NetworkAdapter
805{
806 NetworkAdapter();
807
808 bool areGenericDriverDefaultSettings() const;
809 bool areDefaultSettings(SettingsVersion_T sv) const;
810 bool areDisabledDefaultSettings() const;
811
812 bool operator==(const NetworkAdapter &n) const;
813
814 uint32_t ulSlot;
815
816 NetworkAdapterType_T type;
817 bool fEnabled;
818 com::Utf8Str strMACAddress;
819 bool fCableConnected;
820 uint32_t ulLineSpeed;
821 NetworkAdapterPromiscModePolicy_T enmPromiscModePolicy;
822 bool fTraceEnabled;
823 com::Utf8Str strTraceFile;
824
825 NetworkAttachmentType_T mode;
826 NAT nat;
827 com::Utf8Str strBridgedName;
828 com::Utf8Str strHostOnlyName;
829#ifdef VBOX_WITH_VMNET
830 com::Utf8Str strHostOnlyNetworkName;
831#endif /* VBOX_WITH_VMNET */
832 com::Utf8Str strInternalNetworkName;
833 com::Utf8Str strGenericDriver;
834 StringsMap genericProperties;
835 com::Utf8Str strNATNetworkName;
836#ifdef VBOX_WITH_CLOUD_NET
837 com::Utf8Str strCloudNetworkName;
838#endif /* VBOX_WITH_CLOUD_NET */
839 uint32_t ulBootPriority;
840 com::Utf8Str strBandwidthGroup; // requires settings version 1.13 (VirtualBox 4.2)
841};
842
843typedef std::list<NetworkAdapter> NetworkAdaptersList;
844
845/**
846 * NOTE: If you add any fields in here, you must update a) the constructor and b)
847 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
848 * your settings might never get saved.
849 */
850struct SerialPort
851{
852 SerialPort();
853
854 bool operator==(const SerialPort &n) const;
855
856 uint32_t ulSlot;
857
858 bool fEnabled;
859 uint32_t ulIOBase;
860 uint32_t ulIRQ;
861 PortMode_T portMode;
862 com::Utf8Str strPath;
863 bool fServer;
864 UartType_T uartType;
865};
866
867typedef std::list<SerialPort> SerialPortsList;
868
869/**
870 * NOTE: If you add any fields in here, you must update a) the constructor and b)
871 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
872 * your settings might never get saved.
873 */
874struct ParallelPort
875{
876 ParallelPort();
877
878 bool operator==(const ParallelPort &d) const;
879
880 uint32_t ulSlot;
881
882 bool fEnabled;
883 uint32_t ulIOBase;
884 uint32_t ulIRQ;
885 com::Utf8Str strPath;
886};
887
888typedef std::list<ParallelPort> ParallelPortsList;
889
890/**
891 * NOTE: If you add any fields in here, you must update a) the constructor and b)
892 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
893 * your settings might never get saved.
894 */
895struct AudioAdapter
896{
897 AudioAdapter();
898
899 bool areDefaultSettings(SettingsVersion_T sv) const;
900
901 bool operator==(const AudioAdapter &a) const;
902
903 bool fEnabled;
904 bool fEnabledIn;
905 bool fEnabledOut;
906 AudioControllerType_T controllerType;
907 AudioCodecType_T codecType;
908 AudioDriverType_T driverType;
909 settings::StringsMap properties;
910};
911
912/**
913 * NOTE: If you add any fields in here, you must update a) the constructor and b)
914 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
915 * your settings might never get saved.
916 */
917struct SharedFolder
918{
919 SharedFolder();
920
921 bool operator==(const SharedFolder &a) const;
922
923 com::Utf8Str strName,
924 strHostPath;
925 bool fWritable;
926 bool fAutoMount;
927 com::Utf8Str strAutoMountPoint;
928};
929
930typedef std::list<SharedFolder> SharedFoldersList;
931
932/**
933 * NOTE: If you add any fields in here, you must update a) the constructor and b)
934 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
935 * your settings might never get saved.
936 */
937struct GuestProperty
938{
939 GuestProperty();
940
941 bool operator==(const GuestProperty &g) const;
942
943 com::Utf8Str strName,
944 strValue;
945 uint64_t timestamp;
946 com::Utf8Str strFlags;
947};
948
949typedef std::list<GuestProperty> GuestPropertiesList;
950
951typedef std::map<uint32_t, DeviceType_T> BootOrderMap;
952
953/**
954 * NOTE: If you add any fields in here, you must update a) the constructor and b)
955 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
956 * your settings might never get saved.
957 */
958struct CpuIdLeaf
959{
960 CpuIdLeaf();
961
962 bool operator==(const CpuIdLeaf &c) const;
963
964 uint32_t idx;
965 uint32_t idxSub;
966 uint32_t uEax;
967 uint32_t uEbx;
968 uint32_t uEcx;
969 uint32_t uEdx;
970};
971
972typedef std::list<CpuIdLeaf> CpuIdLeafsList;
973
974/**
975 * NOTE: If you add any fields in here, you must update a) the constructor and b)
976 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
977 * your settings might never get saved.
978 */
979struct Cpu
980{
981 Cpu();
982
983 bool operator==(const Cpu &c) const;
984
985 uint32_t ulId;
986};
987
988typedef std::list<Cpu> CpuList;
989
990/**
991 * NOTE: If you add any fields in here, you must update a) the constructor and b)
992 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
993 * your settings might never get saved.
994 */
995struct BandwidthGroup
996{
997 BandwidthGroup();
998
999 bool operator==(const BandwidthGroup &i) const;
1000
1001 com::Utf8Str strName;
1002 uint64_t cMaxBytesPerSec;
1003 BandwidthGroupType_T enmType;
1004};
1005
1006typedef std::list<BandwidthGroup> BandwidthGroupList;
1007
1008/**
1009 * NOTE: If you add any fields in here, you must update a) the constructor and b)
1010 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
1011 * your settings might never get saved.
1012 */
1013struct IOSettings
1014{
1015 IOSettings();
1016
1017 bool areIOCacheDefaultSettings() const;
1018 bool areDefaultSettings() const;
1019
1020 bool operator==(const IOSettings &i) const;
1021
1022 bool fIOCacheEnabled;
1023 uint32_t ulIOCacheSize;
1024 BandwidthGroupList llBandwidthGroups;
1025};
1026
1027/**
1028 * NOTE: If you add any fields in here, you must update a) the constructor and b)
1029 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
1030 * your settings might never get saved.
1031 */
1032struct HostPCIDeviceAttachment
1033{
1034 HostPCIDeviceAttachment();
1035
1036 bool operator==(const HostPCIDeviceAttachment &a) const;
1037
1038 com::Utf8Str strDeviceName;
1039 uint32_t uHostAddress;
1040 uint32_t uGuestAddress;
1041};
1042
1043typedef std::list<HostPCIDeviceAttachment> HostPCIDeviceAttachmentList;
1044
1045/**
1046 * A device attached to a storage controller. This can either be a
1047 * hard disk or a DVD drive or a floppy drive and also specifies
1048 * which medium is "in" the drive; as a result, this is a combination
1049 * of the Main IMedium and IMediumAttachment interfaces.
1050 *
1051 * NOTE: If you add any fields in here, you must update a) the constructor and b)
1052 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
1053 * your settings might never get saved.
1054 */
1055struct AttachedDevice
1056{
1057 AttachedDevice();
1058
1059 bool operator==(const AttachedDevice &a) const;
1060
1061 DeviceType_T deviceType; // only HardDisk, DVD or Floppy are allowed
1062
1063 // DVDs can be in pass-through mode:
1064 bool fPassThrough;
1065
1066 // Whether guest-triggered eject of DVDs will keep the medium in the
1067 // VM config or not:
1068 bool fTempEject;
1069
1070 // Whether the medium is non-rotational:
1071 bool fNonRotational;
1072
1073 // Whether the medium supports discarding unused blocks:
1074 bool fDiscard;
1075
1076 // Whether the medium is hot-pluggable:
1077 bool fHotPluggable;
1078
1079 int32_t lPort;
1080 int32_t lDevice;
1081
1082 // if an image file is attached to the device (ISO, RAW, or hard disk image such as VDI),
1083 // this is its UUID; it depends on deviceType which media registry this then needs to
1084 // be looked up in. If no image file (only permitted for DVDs and floppies), then the UUID is NULL
1085 com::Guid uuid;
1086
1087 // for DVDs and floppies, the attachment can also be a host device:
1088 com::Utf8Str strHostDriveSrc; // if != NULL, value of <HostDrive>/@src
1089
1090 // Bandwidth group the device is attached to.
1091 com::Utf8Str strBwGroup;
1092};
1093
1094typedef std::list<AttachedDevice> AttachedDevicesList;
1095
1096/**
1097 * NOTE: If you add any fields in here, you must update a) the constructor and b)
1098 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
1099 * your settings might never get saved.
1100 */
1101struct StorageController
1102{
1103 StorageController();
1104
1105 bool operator==(const StorageController &s) const;
1106
1107 com::Utf8Str strName;
1108 StorageBus_T storageBus; // _SATA, _SCSI, _IDE, _SAS
1109 StorageControllerType_T controllerType;
1110 uint32_t ulPortCount;
1111 uint32_t ulInstance;
1112 bool fUseHostIOCache;
1113 bool fBootable;
1114
1115 // only for when controllerType == StorageControllerType_IntelAhci:
1116 int32_t lIDE0MasterEmulationPort,
1117 lIDE0SlaveEmulationPort,
1118 lIDE1MasterEmulationPort,
1119 lIDE1SlaveEmulationPort;
1120
1121 AttachedDevicesList llAttachedDevices;
1122};
1123
1124typedef std::list<StorageController> StorageControllersList;
1125
1126/**
1127 * We wrap the storage controllers list into an extra struct so we can
1128 * use an undefined struct without needing std::list<> in all the headers.
1129 *
1130 * NOTE: If you add any fields in here, you must update a) the constructor and b)
1131 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
1132 * your settings might never get saved.
1133 */
1134struct Storage
1135{
1136 bool operator==(const Storage &s) const;
1137
1138 StorageControllersList llStorageControllers;
1139};
1140
1141/**
1142 * Representation of Machine hardware; this is used in the MachineConfigFile.hardwareMachine
1143 * field.
1144 *
1145 * NOTE: If you add any fields in here, you must update a) the constructor and b)
1146 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
1147 * your settings might never get saved.
1148 */
1149struct Hardware
1150{
1151 Hardware();
1152
1153 bool areParavirtDefaultSettings(SettingsVersion_T sv) const;
1154 bool areBootOrderDefaultSettings() const;
1155 bool areDisplayDefaultSettings() const;
1156 bool areAllNetworkAdaptersDefaultSettings(SettingsVersion_T sv) const;
1157
1158 bool operator==(const Hardware&) const;
1159
1160 com::Utf8Str strVersion; // hardware version, optional
1161 com::Guid uuid; // hardware uuid, optional (null).
1162
1163 bool fHardwareVirt,
1164 fNestedPaging,
1165 fLargePages,
1166 fVPID,
1167 fUnrestrictedExecution,
1168 fHardwareVirtForce,
1169 fUseNativeApi,
1170 fSyntheticCpu,
1171 fTripleFaultReset,
1172 fPAE,
1173 fAPIC, // requires settings version 1.16 (VirtualBox 5.1)
1174 fX2APIC; // requires settings version 1.16 (VirtualBox 5.1)
1175 bool fIBPBOnVMExit; //< added out of cycle, after 1.16 was out.
1176 bool fIBPBOnVMEntry; //< added out of cycle, after 1.16 was out.
1177 bool fSpecCtrl; //< added out of cycle, after 1.16 was out.
1178 bool fSpecCtrlByHost; //< added out of cycle, after 1.16 was out.
1179 bool fL1DFlushOnSched ; //< added out of cycle, after 1.16 was out.
1180 bool fL1DFlushOnVMEntry ; //< added out of cycle, after 1.16 was out.
1181 bool fMDSClearOnSched; //< added out of cycle, after 1.16 was out.
1182 bool fMDSClearOnVMEntry; //< added out of cycle, after 1.16 was out.
1183 bool fNestedHWVirt; //< requires settings version 1.17 (VirtualBox 6.0)
1184 bool fVirtVmsaveVmload; //< requires settings version 1.18 (VirtualBox 6.1)
1185 typedef enum LongModeType { LongMode_Enabled, LongMode_Disabled, LongMode_Legacy } LongModeType;
1186 LongModeType enmLongMode;
1187 uint32_t cCPUs;
1188 bool fCpuHotPlug; // requires settings version 1.10 (VirtualBox 3.2)
1189 CpuList llCpus; // requires settings version 1.10 (VirtualBox 3.2)
1190 bool fHPETEnabled; // requires settings version 1.10 (VirtualBox 3.2)
1191 uint32_t ulCpuExecutionCap; // requires settings version 1.11 (VirtualBox 3.3)
1192 uint32_t uCpuIdPortabilityLevel; // requires settings version 1.15 (VirtualBox 5.0)
1193 com::Utf8Str strCpuProfile; // requires settings version 1.16 (VirtualBox 5.1)
1194
1195 CpuIdLeafsList llCpuIdLeafs;
1196
1197 uint32_t ulMemorySizeMB;
1198
1199 BootOrderMap mapBootOrder; // item 0 has highest priority
1200
1201 FirmwareType_T firmwareType; // requires settings version 1.9 (VirtualBox 3.1)
1202
1203 PointingHIDType_T pointingHIDType; // requires settings version 1.10 (VirtualBox 3.2)
1204 KeyboardHIDType_T keyboardHIDType; // requires settings version 1.10 (VirtualBox 3.2)
1205
1206 ChipsetType_T chipsetType; // requires settings version 1.11 (VirtualBox 4.0)
1207 IommuType_T iommuType; // requires settings version 1.19 (VirtualBox 6.2)
1208 ParavirtProvider_T paravirtProvider; // requires settings version 1.15 (VirtualBox 4.4)
1209 com::Utf8Str strParavirtDebug; // requires settings version 1.16 (VirtualBox 5.1)
1210
1211 bool fEmulatedUSBCardReader; // 1.12 (VirtualBox 4.1)
1212
1213 VRDESettings vrdeSettings;
1214
1215 BIOSSettings biosSettings;
1216 NvramSettings nvramSettings;
1217 RecordingSettings recordingSettings;
1218 GraphicsAdapter graphicsAdapter;
1219 USB usbSettings;
1220 TpmSettings tpmSettings; // requires settings version 1.19 (VirtualBox 6.2)
1221 NetworkAdaptersList llNetworkAdapters;
1222 SerialPortsList llSerialPorts;
1223 ParallelPortsList llParallelPorts;
1224 AudioAdapter audioAdapter;
1225 Storage storage;
1226
1227 // technically these two have no business in the hardware section, but for some
1228 // clever reason <Hardware> is where they are in the XML....
1229 SharedFoldersList llSharedFolders;
1230
1231 ClipboardMode_T clipboardMode;
1232 bool fClipboardFileTransfersEnabled;
1233
1234 DnDMode_T dndMode;
1235
1236 uint32_t ulMemoryBalloonSize;
1237 bool fPageFusionEnabled;
1238
1239 GuestPropertiesList llGuestProperties;
1240
1241 IOSettings ioSettings; // requires settings version 1.10 (VirtualBox 3.2)
1242 HostPCIDeviceAttachmentList pciAttachments; // requires settings version 1.12 (VirtualBox 4.1)
1243
1244 com::Utf8Str strDefaultFrontend; // requires settings version 1.14 (VirtualBox 4.3)
1245};
1246
1247/**
1248 * Settings that has to do with debugging.
1249 */
1250struct Debugging
1251{
1252 Debugging();
1253
1254 bool areDefaultSettings() const;
1255
1256 bool operator==(const Debugging &rOther) const;
1257
1258 bool fTracingEnabled;
1259 bool fAllowTracingToAccessVM;
1260 com::Utf8Str strTracingConfig;
1261};
1262
1263/**
1264 * Settings that has to do with autostart.
1265 */
1266struct Autostart
1267{
1268 Autostart();
1269
1270 bool areDefaultSettings() const;
1271
1272 bool operator==(const Autostart &rOther) const;
1273
1274 bool fAutostartEnabled;
1275 uint32_t uAutostartDelay;
1276 AutostopType_T enmAutostopType;
1277};
1278
1279struct Snapshot;
1280typedef std::list<Snapshot> SnapshotsList;
1281
1282/**
1283 * NOTE: If you add any fields in here, you must update a) the constructor and b)
1284 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
1285 * your settings might never get saved.
1286 */
1287struct Snapshot
1288{
1289 Snapshot();
1290
1291 bool operator==(const Snapshot &s) const;
1292
1293 com::Guid uuid;
1294 com::Utf8Str strName,
1295 strDescription; // optional
1296 RTTIMESPEC timestamp;
1297
1298 com::Utf8Str strStateFile; // for online snapshots only
1299
1300 Hardware hardware;
1301
1302 Debugging debugging;
1303 Autostart autostart;
1304
1305 SnapshotsList llChildSnapshots;
1306
1307 static const struct Snapshot Empty;
1308};
1309
1310/**
1311 * NOTE: If you add any fields in here, you must update a) the constructor and b)
1312 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
1313 * your settings might never get saved.
1314 */
1315struct MachineUserData
1316{
1317 MachineUserData();
1318
1319 bool operator==(const MachineUserData &c) const;
1320
1321 com::Utf8Str strName;
1322 bool fDirectoryIncludesUUID;
1323 bool fNameSync;
1324 com::Utf8Str strDescription;
1325 StringsList llGroups;
1326 com::Utf8Str strOsType;
1327 com::Utf8Str strSnapshotFolder;
1328 bool fTeleporterEnabled;
1329 uint32_t uTeleporterPort;
1330 com::Utf8Str strTeleporterAddress;
1331 com::Utf8Str strTeleporterPassword;
1332 bool fRTCUseUTC;
1333 IconBlob ovIcon;
1334 VMProcPriority_T enmVMPriority;
1335};
1336
1337
1338/**
1339 * MachineConfigFile represents an XML machine configuration. All the machine settings
1340 * that go out to the XML (or are read from it) are in here.
1341 *
1342 * NOTE: If you add any fields in here, you must update a) the constructor and b)
1343 * the operator== which is used by Machine::saveSettings(), or otherwise your settings
1344 * might never get saved.
1345 */
1346class MachineConfigFile : public ConfigFileBase
1347{
1348public:
1349 com::Guid uuid;
1350
1351 MachineUserData machineUserData;
1352
1353 com::Utf8Str strStateFile;
1354 bool fCurrentStateModified; // optional, default is true
1355 RTTIMESPEC timeLastStateChange; // optional, defaults to now
1356 bool fAborted; // optional, default is false
1357
1358 com::Guid uuidCurrentSnapshot;
1359
1360 Hardware hardwareMachine;
1361 MediaRegistry mediaRegistry;
1362 Debugging debugging;
1363 Autostart autostart;
1364
1365 StringsMap mapExtraDataItems;
1366
1367 SnapshotsList llFirstSnapshot; // first snapshot or empty list if there's none
1368
1369 MachineConfigFile(const com::Utf8Str *pstrFilename);
1370
1371 bool operator==(const MachineConfigFile &m) const;
1372
1373 bool canHaveOwnMediaRegistry() const;
1374
1375 void importMachineXML(const xml::ElementNode &elmMachine);
1376
1377 void write(const com::Utf8Str &strFilename);
1378
1379 enum
1380 {
1381 BuildMachineXML_IncludeSnapshots = 0x01,
1382 BuildMachineXML_WriteVBoxVersionAttribute = 0x02,
1383 BuildMachineXML_SkipRemovableMedia = 0x04,
1384 BuildMachineXML_MediaRegistry = 0x08,
1385 BuildMachineXML_SuppressSavedState = 0x10
1386 };
1387 void buildMachineXML(xml::ElementNode &elmMachine,
1388 uint32_t fl,
1389 std::list<xml::ElementNode*> *pllElementsWithUuidAttributes);
1390
1391 static bool isAudioDriverAllowedOnThisHost(AudioDriverType_T drv);
1392 static AudioDriverType_T getHostDefaultAudioDriver();
1393
1394private:
1395 void readNetworkAdapters(const xml::ElementNode &elmHardware, NetworkAdaptersList &ll);
1396 void readAttachedNetworkMode(const xml::ElementNode &pelmMode, bool fEnabled, NetworkAdapter &nic);
1397 void readCpuIdTree(const xml::ElementNode &elmCpuid, CpuIdLeafsList &ll);
1398 void readCpuTree(const xml::ElementNode &elmCpu, CpuList &ll);
1399 void readSerialPorts(const xml::ElementNode &elmUART, SerialPortsList &ll);
1400 void readParallelPorts(const xml::ElementNode &elmLPT, ParallelPortsList &ll);
1401 void readAudioAdapter(const xml::ElementNode &elmAudioAdapter, AudioAdapter &aa);
1402 void readGuestProperties(const xml::ElementNode &elmGuestProperties, Hardware &hw);
1403 void readStorageControllerAttributes(const xml::ElementNode &elmStorageController, StorageController &sctl);
1404 void readHardware(const xml::ElementNode &elmHardware, Hardware &hw);
1405 void readHardDiskAttachments_pre1_7(const xml::ElementNode &elmHardDiskAttachments, Storage &strg);
1406 void readStorageControllers(const xml::ElementNode &elmStorageControllers, Storage &strg);
1407 void readDVDAndFloppies_pre1_9(const xml::ElementNode &elmHardware, Storage &strg);
1408 void readTeleporter(const xml::ElementNode *pElmTeleporter, MachineUserData *pUserData);
1409 void readDebugging(const xml::ElementNode *pElmDbg, Debugging *pDbg);
1410 void readAutostart(const xml::ElementNode *pElmAutostart, Autostart *pAutostart);
1411 void readGroups(const xml::ElementNode *elmGroups, StringsList *pllGroups);
1412 bool readSnapshot(const com::Guid &curSnapshotUuid, uint32_t depth, const xml::ElementNode &elmSnapshot, Snapshot &snap);
1413 void convertOldOSType_pre1_5(com::Utf8Str &str);
1414 void readMachine(const xml::ElementNode &elmMachine);
1415
1416 void buildHardwareXML(xml::ElementNode &elmParent, const Hardware &hw, uint32_t fl, std::list<xml::ElementNode*> *pllElementsWithUuidAttributes);
1417 void buildNetworkXML(NetworkAttachmentType_T mode, bool fEnabled, xml::ElementNode &elmParent, const NetworkAdapter &nic);
1418 void buildStorageControllersXML(xml::ElementNode &elmParent,
1419 const Storage &st,
1420 bool fSkipRemovableMedia,
1421 std::list<xml::ElementNode*> *pllElementsWithUuidAttributes);
1422 void buildDebuggingXML(xml::ElementNode *pElmParent, const Debugging *pDbg);
1423 void buildAutostartXML(xml::ElementNode *pElmParent, const Autostart *pAutostart);
1424 void buildGroupsXML(xml::ElementNode *pElmParent, const StringsList *pllGroups);
1425 void buildSnapshotXML(uint32_t depth, xml::ElementNode &elmParent, const Snapshot &snap);
1426
1427 void bumpSettingsVersionIfNeeded();
1428};
1429
1430} // namespace settings
1431
1432
1433#endif /* !VBOX_INCLUDED_settings_h */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette