VirtualBox

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

Last change on this file since 28087 was 27976, checked in by vboxsync, 15 years ago

*: scm cleans up whitespace and adds a new line at the end of ApplianceimplPrivate.h.

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

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