VirtualBox

source: vbox/trunk/src/VBox/Main/include/ApplianceImplPrivate.h@ 28973

Last change on this file since 28973 was 28800, checked in by vboxsync, 15 years ago

Automated rebranding to Oracle copyright/license strings via filemuncher

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.4 KB
Line 
1/** @file
2 *
3 * VirtualBox Appliance private data definitions
4 */
5
6/*
7 * Copyright (C) 2006-2010 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef ____H_APPLIANCEIMPLPRIVATE
19#define ____H_APPLIANCEIMPLPRIVATE
20
21class VirtualSystemDescription;
22
23#include "ovfreader.h"
24
25////////////////////////////////////////////////////////////////////////////////
26//
27// Appliance data definition
28//
29////////////////////////////////////////////////////////////////////////////////
30
31/* Describe a location for the import/export. The location could be a file on a
32 * local hard disk or a remote target based on the supported inet protocols. */
33struct Appliance::LocationInfo
34{
35 LocationInfo()
36 : storageType(VFSType_File) {}
37 VFSType_T storageType; /* Which type of storage should be handled */
38 Utf8Str strPath; /* File path for the import/export */
39 Utf8Str strHostname; /* Hostname on remote storage locations (could be empty) */
40 Utf8Str strUsername; /* Username on remote storage locations (could be empty) */
41 Utf8Str strPassword; /* Password on remote storage locations (could be empty) */
42};
43
44// opaque private instance data of Appliance class
45struct Appliance::Data
46{
47 enum ApplianceState { ApplianceIdle, ApplianceImporting, ApplianceExporting };
48
49 Data()
50 : state(ApplianceIdle),
51 pReader(NULL)
52 {
53 }
54
55 ~Data()
56 {
57 if (pReader)
58 {
59 delete pReader;
60 pReader = NULL;
61 }
62 }
63
64 ApplianceState state;
65
66 LocationInfo locInfo; // location info for the currently processed OVF
67
68 ovf::OVFReader *pReader;
69
70 bool fBusyWriting; // state protection; while this is true nobody else can call methods
71
72 std::list< ComObjPtr<VirtualSystemDescription> >
73 virtualSystemDescriptions;
74
75 std::list<Utf8Str> llWarnings;
76
77 ULONG ulWeightPerOperation;
78 ULONG ulTotalDisksMB;
79 ULONG cDisks;
80 Utf8Str strOVFSHA1Digest;
81};
82
83struct Appliance::XMLStack
84{
85 std::map<Utf8Str, const VirtualSystemDescriptionEntry*> mapDisks;
86 std::map<Utf8Str, bool> mapNetworks;
87};
88
89struct Appliance::TaskOVF
90{
91 enum TaskType
92 {
93 Read,
94 Import,
95 Write
96 };
97
98 TaskOVF(Appliance *aThat,
99 TaskType aType,
100 LocationInfo aLocInfo,
101 ComObjPtr<Progress> &aProgress)
102 : pAppliance(aThat),
103 taskType(aType),
104 locInfo(aLocInfo),
105 pProgress(aProgress),
106 enFormat(unspecified),
107 rc(S_OK)
108 {}
109
110 static int updateProgress(unsigned uPercent, void *pvUser);
111
112 int startThread();
113
114 Appliance *pAppliance;
115 TaskType taskType;
116 const LocationInfo locInfo;
117 ComObjPtr<Progress> pProgress;
118
119 OVFFormat enFormat;
120
121 HRESULT rc;
122};
123
124struct MyHardDiskAttachment
125{
126 Bstr bstrUuid;
127 ComPtr<IMachine> pMachine;
128 Bstr controllerType;
129 int32_t lChannel;
130 int32_t lDevice;
131};
132
133////////////////////////////////////////////////////////////////////////////////
134//
135// VirtualSystemDescription data definition
136//
137////////////////////////////////////////////////////////////////////////////////
138
139struct VirtualSystemDescription::Data
140{
141 std::list<VirtualSystemDescriptionEntry>
142 llDescriptions; // item descriptions
143
144 ComPtr<Machine> pMachine; // VirtualBox machine this description was exported from (export only)
145
146 settings::MachineConfigFile
147 *pConfig; // machine config created from <vbox:Machine> element if found (import only)
148};
149
150////////////////////////////////////////////////////////////////////////////////
151//
152// Internal helpers
153//
154////////////////////////////////////////////////////////////////////////////////
155
156void convertCIMOSType2VBoxOSType(Utf8Str &strType, ovf::CIMOSType_T c, const Utf8Str &cStr);
157
158ovf::CIMOSType_T convertVBoxOSType2CIMOSType(const char *pcszVbox);
159
160#endif // ____H_APPLIANCEIMPLPRIVATE
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