VirtualBox

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

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

Main,FE/VBoxManage: Add the necessary Main API bits to control the trusted platform module settings as well as implementing support in VBoxManage, bugref:10075

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Revision Author Id
File size: 46.2 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_CLOUD_NET
439/**
440 * Cloud Networking settings.
441 */
442struct CloudNetwork
443{
444 CloudNetwork();
445
446 com::Utf8Str strNetworkName;
447 com::Utf8Str strProviderShortName;
448 com::Utf8Str strProfileName;
449 com::Utf8Str strNetworkId;
450 bool fEnabled;
451};
452
453typedef std::list<CloudNetwork> CloudNetworksList;
454#endif /* VBOX_WITH_CLOUD_NET */
455
456
457class MainConfigFile : public ConfigFileBase
458{
459public:
460 MainConfigFile(const com::Utf8Str *pstrFilename);
461
462 void readMachineRegistry(const xml::ElementNode &elmMachineRegistry);
463 void readNATNetworks(const xml::ElementNode &elmNATNetworks);
464#ifdef VBOX_WITH_CLOUD_NET
465 void readCloudNetworks(const xml::ElementNode &elmCloudNetworks);
466#endif /* VBOX_WITH_CLOUD_NET */
467
468 void write(const com::Utf8Str strFilename);
469
470 Host host;
471 SystemProperties systemProperties;
472 MediaRegistry mediaRegistry;
473 MachinesRegistry llMachines;
474 DHCPServersList llDhcpServers;
475 NATNetworksList llNATNetworks;
476#ifdef VBOX_WITH_CLOUD_NET
477 CloudNetworksList llCloudNetworks;
478#endif /* VBOX_WITH_CLOUD_NET */
479 StringsMap mapExtraDataItems;
480
481private:
482 void bumpSettingsVersionIfNeeded();
483 void buildUSBDeviceSources(xml::ElementNode &elmParent, const USBDeviceSourcesList &ll);
484 void readUSBDeviceSources(const xml::ElementNode &elmDeviceSources, USBDeviceSourcesList &ll);
485 void buildDHCPServers(xml::ElementNode &elmDHCPServers, DHCPServersList const &ll);
486 void buildDHCPOptions(xml::ElementNode &elmOptions, DHCPConfig const &rConfig, bool fIgnoreSubnetMask);
487 void readDHCPServers(const xml::ElementNode &elmDHCPServers);
488 void readDHCPOptions(DHCPConfig &rConfig, const xml::ElementNode &elmOptions, bool fIgnoreSubnetMask);
489 bool convertGuiProxySettings(const com::Utf8Str &strUIProxySettings);
490};
491
492////////////////////////////////////////////////////////////////////////////////
493//
494// Machine XML structures
495//
496////////////////////////////////////////////////////////////////////////////////
497
498/**
499 * NOTE: If you add any fields in here, you must update a) the constructor and b)
500 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
501 * your settings might never get saved.
502 */
503struct VRDESettings
504{
505 VRDESettings();
506
507 bool areDefaultSettings(SettingsVersion_T sv) const;
508
509 bool operator==(const VRDESettings& v) const;
510
511 bool fEnabled;
512 AuthType_T authType;
513 uint32_t ulAuthTimeout;
514 com::Utf8Str strAuthLibrary;
515 bool fAllowMultiConnection,
516 fReuseSingleConnection;
517 com::Utf8Str strVrdeExtPack;
518 StringsMap mapProperties;
519};
520
521/**
522 * NOTE: If you add any fields in here, you must update a) the constructor and b)
523 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
524 * your settings might never get saved.
525 */
526struct BIOSSettings
527{
528 BIOSSettings();
529
530 bool areDefaultSettings() const;
531
532 bool operator==(const BIOSSettings &d) const;
533
534 bool fACPIEnabled,
535 fIOAPICEnabled,
536 fLogoFadeIn,
537 fLogoFadeOut,
538 fPXEDebugEnabled,
539 fSmbiosUuidLittleEndian;
540 uint32_t ulLogoDisplayTime;
541 BIOSBootMenuMode_T biosBootMenuMode;
542 APICMode_T apicMode; // requires settings version 1.16 (VirtualBox 5.1)
543 int64_t llTimeOffset;
544 com::Utf8Str strLogoImagePath;
545 com::Utf8Str strNVRAMPath;
546};
547
548/**
549 * NOTE: If you add any fields in here, you must update a) the constructor and b)
550 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
551 * your settings might never get saved.
552 */
553struct TpmSettings
554{
555 TpmSettings();
556
557 bool areDefaultSettings() const;
558
559 bool operator==(const TpmSettings &d) const;
560
561 TpmType_T tpmType;
562 com::Utf8Str strLocation;
563};
564
565/** List for keeping a recording feature list. */
566typedef std::map<RecordingFeature_T, bool> RecordingFeatureMap;
567
568struct RecordingScreenSettings
569{
570 RecordingScreenSettings();
571
572 virtual ~RecordingScreenSettings();
573
574 void applyDefaults(void);
575
576 bool areDefaultSettings(void) const;
577
578 bool isFeatureEnabled(RecordingFeature_T enmFeature) const;
579
580 bool operator==(const RecordingScreenSettings &d) const;
581
582 /** Whether to record this screen or not. */
583 bool fEnabled; // requires settings version 1.14 (VirtualBox 4.3)
584 /** Destination to record to. */
585 RecordingDestination_T enmDest; /** @todo Implement with next settings version bump. */
586 /** Which features are enable or not. */
587 RecordingFeatureMap featureMap; /** @todo Implement with next settings version bump. */
588 /** Maximum time (in s) to record. If set to 0, no time limit is set. */
589 uint32_t ulMaxTimeS; // requires settings version 1.14 (VirtualBox 4.3)
590 /** Options string for hidden / advanced / experimental features. */
591 com::Utf8Str strOptions; // new since VirtualBox 5.2.
592
593 /**
594 * Structure holding settings for audio recording.
595 */
596 struct Audio
597 {
598 Audio()
599 : enmAudioCodec(RecordingAudioCodec_Opus)
600 , uHz(22050)
601 , cBits(16)
602 , cChannels(2) { }
603
604 /** The audio codec type to use. */
605 RecordingAudioCodec_T enmAudioCodec; /** @todo Implement with next settings version bump. */
606 /** Hz rate. */
607 uint16_t uHz; /** @todo Implement with next settings version bump. */
608 /** Bits per sample. */
609 uint8_t cBits; /** @todo Implement with next settings version bump. */
610 /** Number of audio channels. */
611 uint8_t cChannels; /** @todo Implement with next settings version bump. */
612 } Audio;
613
614 /**
615 * Structure holding settings for video recording.
616 */
617 struct Video
618 {
619 Video()
620 : enmCodec(RecordingVideoCodec_VP8)
621 , ulWidth(1024)
622 , ulHeight(768)
623 , ulRate(512)
624 , ulFPS(25) { }
625
626 /** The codec to use. */
627 RecordingVideoCodec_T enmCodec; /** @todo Implement with next settings version bump. */
628 /** Target frame width in pixels (X). */
629 uint32_t ulWidth; // requires settings version 1.14 (VirtualBox 4.3)
630 /** Target frame height in pixels (Y). */
631 uint32_t ulHeight; // requires settings version 1.14 (VirtualBox 4.3)
632 /** Encoding rate. */
633 uint32_t ulRate; // requires settings version 1.14 (VirtualBox 4.3)
634 /** Frames per second (FPS). */
635 uint32_t ulFPS; // requires settings version 1.14 (VirtualBox 4.3)
636 } Video;
637
638 /**
639 * Structure holding settings if the destination is a file.
640 */
641 struct File
642 {
643 File()
644 : ulMaxSizeMB(0) { }
645
646 /** Maximum size (in MB) the file is allowed to have.
647 * When reaching the limit, recording will stop. */
648 uint32_t ulMaxSizeMB; // requires settings version 1.14 (VirtualBox 4.3)
649 /** Absolute file name path to use for recording. */
650 com::Utf8Str strName; // requires settings version 1.14 (VirtualBox 4.3)
651 } File;
652};
653
654/** Map for keeping settings per virtual screen.
655 * The key specifies the screen ID. */
656typedef std::map<uint32_t, RecordingScreenSettings> RecordingScreenMap;
657
658/**
659 * NOTE: If you add any fields in here, you must update a) the constructor and b)
660 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
661 * your settings might never get saved.
662 */
663struct RecordingSettings
664{
665 RecordingSettings();
666
667 void applyDefaults(void);
668
669 bool areDefaultSettings(void) const;
670
671 bool operator==(const RecordingSettings &d) const;
672
673 /** Whether recording as a whole is enabled or disabled. */
674 bool fEnabled; // requires settings version 1.14 (VirtualBox 4.3)
675 /** Map of handled recording screen settings.
676 * The key specifies the screen ID. */
677 RecordingScreenMap mapScreens;
678};
679
680/**
681 * NOTE: If you add any fields in here, you must update a) the constructor and b)
682 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
683 * your settings might never get saved.
684 */
685struct GraphicsAdapter
686{
687 GraphicsAdapter();
688
689 bool areDefaultSettings() const;
690
691 bool operator==(const GraphicsAdapter &g) const;
692
693 GraphicsControllerType_T graphicsControllerType;
694 uint32_t ulVRAMSizeMB;
695 uint32_t cMonitors;
696 bool fAccelerate3D,
697 fAccelerate2DVideo; // requires settings version 1.8 (VirtualBox 3.1)
698};
699
700/**
701 * NOTE: If you add any fields in here, you must update a) the constructor and b)
702 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
703 * your settings might never get saved.
704 */
705struct USBController
706{
707 USBController();
708
709 bool operator==(const USBController &u) const;
710
711 com::Utf8Str strName;
712 USBControllerType_T enmType;
713};
714
715typedef std::list<USBController> USBControllerList;
716
717struct USB
718{
719 USB();
720
721 bool operator==(const USB &u) const;
722
723 /** List of USB controllers present. */
724 USBControllerList llUSBControllers;
725 /** List of USB device filters. */
726 USBDeviceFiltersList llDeviceFilters;
727};
728
729struct NAT
730{
731 NAT();
732
733 bool areDNSDefaultSettings() const;
734 bool areAliasDefaultSettings() const;
735 bool areTFTPDefaultSettings() const;
736 bool areDefaultSettings() const;
737
738 bool operator==(const NAT &n) const;
739
740 com::Utf8Str strNetwork;
741 com::Utf8Str strBindIP;
742 uint32_t u32Mtu;
743 uint32_t u32SockRcv;
744 uint32_t u32SockSnd;
745 uint32_t u32TcpRcv;
746 uint32_t u32TcpSnd;
747 com::Utf8Str strTFTPPrefix;
748 com::Utf8Str strTFTPBootFile;
749 com::Utf8Str strTFTPNextServer;
750 bool fDNSPassDomain;
751 bool fDNSProxy;
752 bool fDNSUseHostResolver;
753 bool fAliasLog;
754 bool fAliasProxyOnly;
755 bool fAliasUseSamePorts;
756 NATRulesMap mapRules;
757};
758
759/**
760 * NOTE: If you add any fields in here, you must update a) the constructor and b)
761 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
762 * your settings might never get saved.
763 */
764struct NetworkAdapter
765{
766 NetworkAdapter();
767
768 bool areGenericDriverDefaultSettings() const;
769 bool areDefaultSettings(SettingsVersion_T sv) const;
770 bool areDisabledDefaultSettings() const;
771
772 bool operator==(const NetworkAdapter &n) const;
773
774 uint32_t ulSlot;
775
776 NetworkAdapterType_T type;
777 bool fEnabled;
778 com::Utf8Str strMACAddress;
779 bool fCableConnected;
780 uint32_t ulLineSpeed;
781 NetworkAdapterPromiscModePolicy_T enmPromiscModePolicy;
782 bool fTraceEnabled;
783 com::Utf8Str strTraceFile;
784
785 NetworkAttachmentType_T mode;
786 NAT nat;
787 com::Utf8Str strBridgedName;
788 com::Utf8Str strHostOnlyName;
789 com::Utf8Str strInternalNetworkName;
790 com::Utf8Str strGenericDriver;
791 StringsMap genericProperties;
792 com::Utf8Str strNATNetworkName;
793#ifdef VBOX_WITH_CLOUD_NET
794 com::Utf8Str strCloudNetworkName;
795#endif /* VBOX_WITH_CLOUD_NET */
796 uint32_t ulBootPriority;
797 com::Utf8Str strBandwidthGroup; // requires settings version 1.13 (VirtualBox 4.2)
798};
799
800typedef std::list<NetworkAdapter> NetworkAdaptersList;
801
802/**
803 * NOTE: If you add any fields in here, you must update a) the constructor and b)
804 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
805 * your settings might never get saved.
806 */
807struct SerialPort
808{
809 SerialPort();
810
811 bool operator==(const SerialPort &n) const;
812
813 uint32_t ulSlot;
814
815 bool fEnabled;
816 uint32_t ulIOBase;
817 uint32_t ulIRQ;
818 PortMode_T portMode;
819 com::Utf8Str strPath;
820 bool fServer;
821 UartType_T uartType;
822};
823
824typedef std::list<SerialPort> SerialPortsList;
825
826/**
827 * NOTE: If you add any fields in here, you must update a) the constructor and b)
828 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
829 * your settings might never get saved.
830 */
831struct ParallelPort
832{
833 ParallelPort();
834
835 bool operator==(const ParallelPort &d) const;
836
837 uint32_t ulSlot;
838
839 bool fEnabled;
840 uint32_t ulIOBase;
841 uint32_t ulIRQ;
842 com::Utf8Str strPath;
843};
844
845typedef std::list<ParallelPort> ParallelPortsList;
846
847/**
848 * NOTE: If you add any fields in here, you must update a) the constructor and b)
849 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
850 * your settings might never get saved.
851 */
852struct AudioAdapter
853{
854 AudioAdapter();
855
856 bool areDefaultSettings(SettingsVersion_T sv) const;
857
858 bool operator==(const AudioAdapter &a) const;
859
860 bool fEnabled;
861 bool fEnabledIn;
862 bool fEnabledOut;
863 AudioControllerType_T controllerType;
864 AudioCodecType_T codecType;
865 AudioDriverType_T driverType;
866 settings::StringsMap properties;
867};
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 SharedFolder
875{
876 SharedFolder();
877
878 bool operator==(const SharedFolder &a) const;
879
880 com::Utf8Str strName,
881 strHostPath;
882 bool fWritable;
883 bool fAutoMount;
884 com::Utf8Str strAutoMountPoint;
885};
886
887typedef std::list<SharedFolder> SharedFoldersList;
888
889/**
890 * NOTE: If you add any fields in here, you must update a) the constructor and b)
891 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
892 * your settings might never get saved.
893 */
894struct GuestProperty
895{
896 GuestProperty();
897
898 bool operator==(const GuestProperty &g) const;
899
900 com::Utf8Str strName,
901 strValue;
902 uint64_t timestamp;
903 com::Utf8Str strFlags;
904};
905
906typedef std::list<GuestProperty> GuestPropertiesList;
907
908typedef std::map<uint32_t, DeviceType_T> BootOrderMap;
909
910/**
911 * NOTE: If you add any fields in here, you must update a) the constructor and b)
912 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
913 * your settings might never get saved.
914 */
915struct CpuIdLeaf
916{
917 CpuIdLeaf();
918
919 bool operator==(const CpuIdLeaf &c) const;
920
921 uint32_t idx;
922 uint32_t idxSub;
923 uint32_t uEax;
924 uint32_t uEbx;
925 uint32_t uEcx;
926 uint32_t uEdx;
927};
928
929typedef std::list<CpuIdLeaf> CpuIdLeafsList;
930
931/**
932 * NOTE: If you add any fields in here, you must update a) the constructor and b)
933 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
934 * your settings might never get saved.
935 */
936struct Cpu
937{
938 Cpu();
939
940 bool operator==(const Cpu &c) const;
941
942 uint32_t ulId;
943};
944
945typedef std::list<Cpu> CpuList;
946
947/**
948 * NOTE: If you add any fields in here, you must update a) the constructor and b)
949 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
950 * your settings might never get saved.
951 */
952struct BandwidthGroup
953{
954 BandwidthGroup();
955
956 bool operator==(const BandwidthGroup &i) const;
957
958 com::Utf8Str strName;
959 uint64_t cMaxBytesPerSec;
960 BandwidthGroupType_T enmType;
961};
962
963typedef std::list<BandwidthGroup> BandwidthGroupList;
964
965/**
966 * NOTE: If you add any fields in here, you must update a) the constructor and b)
967 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
968 * your settings might never get saved.
969 */
970struct IOSettings
971{
972 IOSettings();
973
974 bool areIOCacheDefaultSettings() const;
975 bool areDefaultSettings() const;
976
977 bool operator==(const IOSettings &i) const;
978
979 bool fIOCacheEnabled;
980 uint32_t ulIOCacheSize;
981 BandwidthGroupList llBandwidthGroups;
982};
983
984/**
985 * NOTE: If you add any fields in here, you must update a) the constructor and b)
986 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
987 * your settings might never get saved.
988 */
989struct HostPCIDeviceAttachment
990{
991 HostPCIDeviceAttachment();
992
993 bool operator==(const HostPCIDeviceAttachment &a) const;
994
995 com::Utf8Str strDeviceName;
996 uint32_t uHostAddress;
997 uint32_t uGuestAddress;
998};
999
1000typedef std::list<HostPCIDeviceAttachment> HostPCIDeviceAttachmentList;
1001
1002/**
1003 * A device attached to a storage controller. This can either be a
1004 * hard disk or a DVD drive or a floppy drive and also specifies
1005 * which medium is "in" the drive; as a result, this is a combination
1006 * of the Main IMedium and IMediumAttachment interfaces.
1007 *
1008 * NOTE: If you add any fields in here, you must update a) the constructor and b)
1009 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
1010 * your settings might never get saved.
1011 */
1012struct AttachedDevice
1013{
1014 AttachedDevice();
1015
1016 bool operator==(const AttachedDevice &a) const;
1017
1018 DeviceType_T deviceType; // only HardDisk, DVD or Floppy are allowed
1019
1020 // DVDs can be in pass-through mode:
1021 bool fPassThrough;
1022
1023 // Whether guest-triggered eject of DVDs will keep the medium in the
1024 // VM config or not:
1025 bool fTempEject;
1026
1027 // Whether the medium is non-rotational:
1028 bool fNonRotational;
1029
1030 // Whether the medium supports discarding unused blocks:
1031 bool fDiscard;
1032
1033 // Whether the medium is hot-pluggable:
1034 bool fHotPluggable;
1035
1036 int32_t lPort;
1037 int32_t lDevice;
1038
1039 // if an image file is attached to the device (ISO, RAW, or hard disk image such as VDI),
1040 // this is its UUID; it depends on deviceType which media registry this then needs to
1041 // be looked up in. If no image file (only permitted for DVDs and floppies), then the UUID is NULL
1042 com::Guid uuid;
1043
1044 // for DVDs and floppies, the attachment can also be a host device:
1045 com::Utf8Str strHostDriveSrc; // if != NULL, value of <HostDrive>/@src
1046
1047 // Bandwidth group the device is attached to.
1048 com::Utf8Str strBwGroup;
1049};
1050
1051typedef std::list<AttachedDevice> AttachedDevicesList;
1052
1053/**
1054 * NOTE: If you add any fields in here, you must update a) the constructor and b)
1055 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
1056 * your settings might never get saved.
1057 */
1058struct StorageController
1059{
1060 StorageController();
1061
1062 bool operator==(const StorageController &s) const;
1063
1064 com::Utf8Str strName;
1065 StorageBus_T storageBus; // _SATA, _SCSI, _IDE, _SAS
1066 StorageControllerType_T controllerType;
1067 uint32_t ulPortCount;
1068 uint32_t ulInstance;
1069 bool fUseHostIOCache;
1070 bool fBootable;
1071
1072 // only for when controllerType == StorageControllerType_IntelAhci:
1073 int32_t lIDE0MasterEmulationPort,
1074 lIDE0SlaveEmulationPort,
1075 lIDE1MasterEmulationPort,
1076 lIDE1SlaveEmulationPort;
1077
1078 AttachedDevicesList llAttachedDevices;
1079};
1080
1081typedef std::list<StorageController> StorageControllersList;
1082
1083/**
1084 * We wrap the storage controllers list into an extra struct so we can
1085 * use an undefined struct without needing std::list<> in all the headers.
1086 *
1087 * NOTE: If you add any fields in here, you must update a) the constructor and b)
1088 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
1089 * your settings might never get saved.
1090 */
1091struct Storage
1092{
1093 bool operator==(const Storage &s) const;
1094
1095 StorageControllersList llStorageControllers;
1096};
1097
1098/**
1099 * Representation of Machine hardware; this is used in the MachineConfigFile.hardwareMachine
1100 * field.
1101 *
1102 * NOTE: If you add any fields in here, you must update a) the constructor and b)
1103 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
1104 * your settings might never get saved.
1105 */
1106struct Hardware
1107{
1108 Hardware();
1109
1110 bool areParavirtDefaultSettings(SettingsVersion_T sv) const;
1111 bool areBootOrderDefaultSettings() const;
1112 bool areDisplayDefaultSettings() const;
1113 bool areAllNetworkAdaptersDefaultSettings(SettingsVersion_T sv) const;
1114
1115 bool operator==(const Hardware&) const;
1116
1117 com::Utf8Str strVersion; // hardware version, optional
1118 com::Guid uuid; // hardware uuid, optional (null).
1119
1120 bool fHardwareVirt,
1121 fNestedPaging,
1122 fLargePages,
1123 fVPID,
1124 fUnrestrictedExecution,
1125 fHardwareVirtForce,
1126 fUseNativeApi,
1127 fSyntheticCpu,
1128 fTripleFaultReset,
1129 fPAE,
1130 fAPIC, // requires settings version 1.16 (VirtualBox 5.1)
1131 fX2APIC; // requires settings version 1.16 (VirtualBox 5.1)
1132 bool fIBPBOnVMExit; //< added out of cycle, after 1.16 was out.
1133 bool fIBPBOnVMEntry; //< added out of cycle, after 1.16 was out.
1134 bool fSpecCtrl; //< added out of cycle, after 1.16 was out.
1135 bool fSpecCtrlByHost; //< added out of cycle, after 1.16 was out.
1136 bool fL1DFlushOnSched ; //< added out of cycle, after 1.16 was out.
1137 bool fL1DFlushOnVMEntry ; //< added out of cycle, after 1.16 was out.
1138 bool fMDSClearOnSched; //< added out of cycle, after 1.16 was out.
1139 bool fMDSClearOnVMEntry; //< added out of cycle, after 1.16 was out.
1140 bool fNestedHWVirt; //< requires settings version 1.17 (VirtualBox 6.0)
1141 bool fVirtVmsaveVmload; //< requires settings version 1.18 (VirtualBox 6.1)
1142 typedef enum LongModeType { LongMode_Enabled, LongMode_Disabled, LongMode_Legacy } LongModeType;
1143 LongModeType enmLongMode;
1144 uint32_t cCPUs;
1145 bool fCpuHotPlug; // requires settings version 1.10 (VirtualBox 3.2)
1146 CpuList llCpus; // requires settings version 1.10 (VirtualBox 3.2)
1147 bool fHPETEnabled; // requires settings version 1.10 (VirtualBox 3.2)
1148 uint32_t ulCpuExecutionCap; // requires settings version 1.11 (VirtualBox 3.3)
1149 uint32_t uCpuIdPortabilityLevel; // requires settings version 1.15 (VirtualBox 5.0)
1150 com::Utf8Str strCpuProfile; // requires settings version 1.16 (VirtualBox 5.1)
1151
1152 CpuIdLeafsList llCpuIdLeafs;
1153
1154 uint32_t ulMemorySizeMB;
1155
1156 BootOrderMap mapBootOrder; // item 0 has highest priority
1157
1158 FirmwareType_T firmwareType; // requires settings version 1.9 (VirtualBox 3.1)
1159
1160 PointingHIDType_T pointingHIDType; // requires settings version 1.10 (VirtualBox 3.2)
1161 KeyboardHIDType_T keyboardHIDType; // requires settings version 1.10 (VirtualBox 3.2)
1162
1163 ChipsetType_T chipsetType; // requires settings version 1.11 (VirtualBox 4.0)
1164 IommuType_T iommuType; // requires settings version 1.19 (VirtualBox 6.2)
1165 ParavirtProvider_T paravirtProvider; // requires settings version 1.15 (VirtualBox 4.4)
1166 com::Utf8Str strParavirtDebug; // requires settings version 1.16 (VirtualBox 5.1)
1167
1168 bool fEmulatedUSBCardReader; // 1.12 (VirtualBox 4.1)
1169
1170 VRDESettings vrdeSettings;
1171
1172 BIOSSettings biosSettings;
1173 RecordingSettings recordingSettings;
1174 GraphicsAdapter graphicsAdapter;
1175 USB usbSettings;
1176 TpmSettings tpmSettings; // requires settings version 1.19 (VirtualBox 6.2)
1177 NetworkAdaptersList llNetworkAdapters;
1178 SerialPortsList llSerialPorts;
1179 ParallelPortsList llParallelPorts;
1180 AudioAdapter audioAdapter;
1181 Storage storage;
1182
1183 // technically these two have no business in the hardware section, but for some
1184 // clever reason <Hardware> is where they are in the XML....
1185 SharedFoldersList llSharedFolders;
1186
1187 ClipboardMode_T clipboardMode;
1188 bool fClipboardFileTransfersEnabled;
1189
1190 DnDMode_T dndMode;
1191
1192 uint32_t ulMemoryBalloonSize;
1193 bool fPageFusionEnabled;
1194
1195 GuestPropertiesList llGuestProperties;
1196
1197 IOSettings ioSettings; // requires settings version 1.10 (VirtualBox 3.2)
1198 HostPCIDeviceAttachmentList pciAttachments; // requires settings version 1.12 (VirtualBox 4.1)
1199
1200 com::Utf8Str strDefaultFrontend; // requires settings version 1.14 (VirtualBox 4.3)
1201};
1202
1203/**
1204 * Settings that has to do with debugging.
1205 */
1206struct Debugging
1207{
1208 Debugging();
1209
1210 bool areDefaultSettings() const;
1211
1212 bool operator==(const Debugging &rOther) const;
1213
1214 bool fTracingEnabled;
1215 bool fAllowTracingToAccessVM;
1216 com::Utf8Str strTracingConfig;
1217};
1218
1219/**
1220 * Settings that has to do with autostart.
1221 */
1222struct Autostart
1223{
1224 Autostart();
1225
1226 bool areDefaultSettings() const;
1227
1228 bool operator==(const Autostart &rOther) const;
1229
1230 bool fAutostartEnabled;
1231 uint32_t uAutostartDelay;
1232 AutostopType_T enmAutostopType;
1233};
1234
1235struct Snapshot;
1236typedef std::list<Snapshot> SnapshotsList;
1237
1238/**
1239 * NOTE: If you add any fields in here, you must update a) the constructor and b)
1240 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
1241 * your settings might never get saved.
1242 */
1243struct Snapshot
1244{
1245 Snapshot();
1246
1247 bool operator==(const Snapshot &s) const;
1248
1249 com::Guid uuid;
1250 com::Utf8Str strName,
1251 strDescription; // optional
1252 RTTIMESPEC timestamp;
1253
1254 com::Utf8Str strStateFile; // for online snapshots only
1255
1256 Hardware hardware;
1257
1258 Debugging debugging;
1259 Autostart autostart;
1260
1261 SnapshotsList llChildSnapshots;
1262
1263 static const struct Snapshot Empty;
1264};
1265
1266/**
1267 * NOTE: If you add any fields in here, you must update a) the constructor and b)
1268 * the operator== which is used by MachineConfigFile::operator==(), or otherwise
1269 * your settings might never get saved.
1270 */
1271struct MachineUserData
1272{
1273 MachineUserData();
1274
1275 bool operator==(const MachineUserData &c) const;
1276
1277 com::Utf8Str strName;
1278 bool fDirectoryIncludesUUID;
1279 bool fNameSync;
1280 com::Utf8Str strDescription;
1281 StringsList llGroups;
1282 com::Utf8Str strOsType;
1283 com::Utf8Str strSnapshotFolder;
1284 bool fTeleporterEnabled;
1285 uint32_t uTeleporterPort;
1286 com::Utf8Str strTeleporterAddress;
1287 com::Utf8Str strTeleporterPassword;
1288 bool fRTCUseUTC;
1289 IconBlob ovIcon;
1290 VMProcPriority_T enmVMPriority;
1291};
1292
1293
1294/**
1295 * MachineConfigFile represents an XML machine configuration. All the machine settings
1296 * that go out to the XML (or are read from it) are in here.
1297 *
1298 * NOTE: If you add any fields in here, you must update a) the constructor and b)
1299 * the operator== which is used by Machine::saveSettings(), or otherwise your settings
1300 * might never get saved.
1301 */
1302class MachineConfigFile : public ConfigFileBase
1303{
1304public:
1305 com::Guid uuid;
1306
1307 MachineUserData machineUserData;
1308
1309 com::Utf8Str strStateFile;
1310 bool fCurrentStateModified; // optional, default is true
1311 RTTIMESPEC timeLastStateChange; // optional, defaults to now
1312 bool fAborted; // optional, default is false
1313
1314 com::Guid uuidCurrentSnapshot;
1315
1316 Hardware hardwareMachine;
1317 MediaRegistry mediaRegistry;
1318 Debugging debugging;
1319 Autostart autostart;
1320
1321 StringsMap mapExtraDataItems;
1322
1323 SnapshotsList llFirstSnapshot; // first snapshot or empty list if there's none
1324
1325 MachineConfigFile(const com::Utf8Str *pstrFilename);
1326
1327 bool operator==(const MachineConfigFile &m) const;
1328
1329 bool canHaveOwnMediaRegistry() const;
1330
1331 void importMachineXML(const xml::ElementNode &elmMachine);
1332
1333 void write(const com::Utf8Str &strFilename);
1334
1335 enum
1336 {
1337 BuildMachineXML_IncludeSnapshots = 0x01,
1338 BuildMachineXML_WriteVBoxVersionAttribute = 0x02,
1339 BuildMachineXML_SkipRemovableMedia = 0x04,
1340 BuildMachineXML_MediaRegistry = 0x08,
1341 BuildMachineXML_SuppressSavedState = 0x10
1342 };
1343 void buildMachineXML(xml::ElementNode &elmMachine,
1344 uint32_t fl,
1345 std::list<xml::ElementNode*> *pllElementsWithUuidAttributes);
1346
1347 static bool isAudioDriverAllowedOnThisHost(AudioDriverType_T drv);
1348 static AudioDriverType_T getHostDefaultAudioDriver();
1349
1350private:
1351 void readNetworkAdapters(const xml::ElementNode &elmHardware, NetworkAdaptersList &ll);
1352 void readAttachedNetworkMode(const xml::ElementNode &pelmMode, bool fEnabled, NetworkAdapter &nic);
1353 void readCpuIdTree(const xml::ElementNode &elmCpuid, CpuIdLeafsList &ll);
1354 void readCpuTree(const xml::ElementNode &elmCpu, CpuList &ll);
1355 void readSerialPorts(const xml::ElementNode &elmUART, SerialPortsList &ll);
1356 void readParallelPorts(const xml::ElementNode &elmLPT, ParallelPortsList &ll);
1357 void readAudioAdapter(const xml::ElementNode &elmAudioAdapter, AudioAdapter &aa);
1358 void readGuestProperties(const xml::ElementNode &elmGuestProperties, Hardware &hw);
1359 void readStorageControllerAttributes(const xml::ElementNode &elmStorageController, StorageController &sctl);
1360 void readHardware(const xml::ElementNode &elmHardware, Hardware &hw);
1361 void readHardDiskAttachments_pre1_7(const xml::ElementNode &elmHardDiskAttachments, Storage &strg);
1362 void readStorageControllers(const xml::ElementNode &elmStorageControllers, Storage &strg);
1363 void readDVDAndFloppies_pre1_9(const xml::ElementNode &elmHardware, Storage &strg);
1364 void readTeleporter(const xml::ElementNode *pElmTeleporter, MachineUserData *pUserData);
1365 void readDebugging(const xml::ElementNode *pElmDbg, Debugging *pDbg);
1366 void readAutostart(const xml::ElementNode *pElmAutostart, Autostart *pAutostart);
1367 void readGroups(const xml::ElementNode *elmGroups, StringsList *pllGroups);
1368 bool readSnapshot(const com::Guid &curSnapshotUuid, uint32_t depth, const xml::ElementNode &elmSnapshot, Snapshot &snap);
1369 void convertOldOSType_pre1_5(com::Utf8Str &str);
1370 void readMachine(const xml::ElementNode &elmMachine);
1371
1372 void buildHardwareXML(xml::ElementNode &elmParent, const Hardware &hw, uint32_t fl, std::list<xml::ElementNode*> *pllElementsWithUuidAttributes);
1373 void buildNetworkXML(NetworkAttachmentType_T mode, bool fEnabled, xml::ElementNode &elmParent, const NetworkAdapter &nic);
1374 void buildStorageControllersXML(xml::ElementNode &elmParent,
1375 const Storage &st,
1376 bool fSkipRemovableMedia,
1377 std::list<xml::ElementNode*> *pllElementsWithUuidAttributes);
1378 void buildDebuggingXML(xml::ElementNode *pElmParent, const Debugging *pDbg);
1379 void buildAutostartXML(xml::ElementNode *pElmParent, const Autostart *pAutostart);
1380 void buildGroupsXML(xml::ElementNode *pElmParent, const StringsList *pllGroups);
1381 void buildSnapshotXML(uint32_t depth, xml::ElementNode &elmParent, const Snapshot &snap);
1382
1383 void bumpSettingsVersionIfNeeded();
1384};
1385
1386} // namespace settings
1387
1388
1389#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