ApplianceImpl.h revision 10d107ae26d5e0a2293a693fe270427c6d96ba7d
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync/* $Id$ */
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync/** @file
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * VirtualBox COM class implementation
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync */
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync/*
17b671c398282d40167af7a32adf2d51f2ad0ef0vboxsync * Copyright (C) 2006-2013 Oracle Corporation
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync *
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * available from http://www.virtualbox.org. This file is free software;
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * you can redistribute it and/or modify it under the terms of the GNU
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * General Public License (GPL) as published by the Free Software
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync */
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync#ifndef ____H_APPLIANCEIMPL
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync#define ____H_APPLIANCEIMPL
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
b8ae33177906f4130b85b7c861cae0e78ed4859bvboxsync/* VBox includes */
e96d318f28bf3515ea62273df31c0212313fa5abvboxsync#include <VBox/settings.h>
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync#include "VirtualSystemDescriptionWrap.h"
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync#include "ApplianceWrap.h"
1f1179353a81be311d4ab0204929ee92e337327fvboxsync#include "MediumFormatImpl.h"
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync/* Todo: This file needs massive cleanup. Split IAppliance in a public and
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync * private classes. */
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync#include <iprt/tar.h>
62c8fef246519d59ee7ad41dd71de75b96b3552bvboxsync#include "ovfreader.h"
37e4655312fa6433c756cfa05a4db6b72e0c4344vboxsync#include <set>
62c8fef246519d59ee7ad41dd71de75b96b3552bvboxsync
4651430e55b9df9726347e3e3968618e540fe729vboxsync/* VBox forward declarations */
4651430e55b9df9726347e3e3968618e540fe729vboxsyncclass Progress;
4651430e55b9df9726347e3e3968618e540fe729vboxsyncclass VirtualSystemDescription;
4651430e55b9df9726347e3e3968618e540fe729vboxsyncstruct VirtualSystemDescriptionEntry;
76f5d3db08b007661ae4af93200838d24683af52vboxsyncstruct LocationInfo;
8a99522dee886d4ed00c8cd18788e9e722febd71vboxsynctypedef struct VDINTERFACE *PVDINTERFACE;
8a99522dee886d4ed00c8cd18788e9e722febd71vboxsynctypedef struct VDINTERFACEIO *PVDINTERFACEIO;
454ac5c6ef4960887035ceea6b5247789d3272davboxsynctypedef struct SHASTORAGE *PSHASTORAGE;
4651430e55b9df9726347e3e3968618e540fe729vboxsync
ab72c8adeca8d8053cacd95ad7afe3328cb6f86avboxsynctypedef enum applianceIOName { applianceIOTar, applianceIOFile, applianceIOSha } APPLIANCEIONAME;
37e4655312fa6433c756cfa05a4db6b72e0c4344vboxsync
d5bf937d132098565e18a0d1fc408fb777c5e5b6vboxsyncnamespace ovf
d5bf937d132098565e18a0d1fc408fb777c5e5b6vboxsync{
d5bf937d132098565e18a0d1fc408fb777c5e5b6vboxsync struct HardDiskController;
21293ca6a2967f796ed30a6c8492911619476a48vboxsync struct VirtualSystem;
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync class OVFReader;
35d8d2372afb180daa0ba01af33a1922511d6b07vboxsync struct DiskImage;
62c8fef246519d59ee7ad41dd71de75b96b3552bvboxsync struct EnvelopeData;
d5bf937d132098565e18a0d1fc408fb777c5e5b6vboxsync}
d5bf937d132098565e18a0d1fc408fb777c5e5b6vboxsync
4651430e55b9df9726347e3e3968618e540fe729vboxsyncnamespace xml
4651430e55b9df9726347e3e3968618e540fe729vboxsync{
025f9c7729f643fb8780153dc0e6f1c76baddd69vboxsync class Document;
4651430e55b9df9726347e3e3968618e540fe729vboxsync class ElementNode;
4651430e55b9df9726347e3e3968618e540fe729vboxsync}
4651430e55b9df9726347e3e3968618e540fe729vboxsync
4651430e55b9df9726347e3e3968618e540fe729vboxsyncnamespace settings
4651430e55b9df9726347e3e3968618e540fe729vboxsync{
4651430e55b9df9726347e3e3968618e540fe729vboxsync class MachineConfigFile;
4651430e55b9df9726347e3e3968618e540fe729vboxsync}
4651430e55b9df9726347e3e3968618e540fe729vboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsyncclass ATL_NO_VTABLE Appliance :
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync public ApplianceWrap
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync{
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsyncpublic:
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync DECLARE_EMPTY_CTOR_DTOR(Appliance)
62c8fef246519d59ee7ad41dd71de75b96b3552bvboxsync
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT FinalConstruct();
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync void FinalRelease();
f2490dbf97c8247439446844458461b00e50beb0vboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
e52c9984c4f6b8ea141bc50a3bdaf31941d8cd7dvboxsync HRESULT init(VirtualBox *aVirtualBox);
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync void uninit();
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync /* public methods only for internal purposes */
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync static HRESULT i_setErrorStatic(HRESULT aResultCode,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync const Utf8Str &aText)
c2029891dc7fbce0f08a378d0335568cf9cbb4c5vboxsync {
c2029891dc7fbce0f08a378d0335568cf9cbb4c5vboxsync return setErrorInternal(aResultCode, getStaticClassIID(), getStaticComponentName(), aText, false, true);
c2029891dc7fbce0f08a378d0335568cf9cbb4c5vboxsync }
c2029891dc7fbce0f08a378d0335568cf9cbb4c5vboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync /* private instance data */
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsyncprivate:
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync // wrapped IAppliance properties
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT getPath(com::Utf8Str &aPath);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT getDisks(std::vector<com::Utf8Str> &aDisks);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT getVirtualSystemDescriptions(std::vector<ComPtr<IVirtualSystemDescription> > &aVirtualSystemDescriptions);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT getMachines(std::vector<com::Utf8Str> &aMachines);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync // wrapped IAppliance methods
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT read(const com::Utf8Str &aFile,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync ComPtr<IProgress> &aProgress);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT interpret();
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT importMachines(const std::vector<ImportOptions_T> &aOptions,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync ComPtr<IProgress> &aProgress);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT createVFSExplorer(const com::Utf8Str &aURI,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync ComPtr<IVFSExplorer> &aExplorer);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT write(const com::Utf8Str &aFormat,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync const std::vector<ExportOptions_T> &aOptions,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync const com::Utf8Str &aPath,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync ComPtr<IProgress> &aProgress);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT getWarnings(std::vector<com::Utf8Str> &aWarnings);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync
6a74d2edb239c0daeb51ccf267b4f66b7add5335vboxsync /** weak VirtualBox parent */
79207ebc7bef44216ecdbe520de76317c713ada6vboxsync VirtualBox* const mVirtualBox;
482a222498aae619afda0255a7edf4ebda97268cvboxsync
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync struct ImportStack;
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync struct TaskOVF;
d020036eb167a2f97f5010276fda5daa3f4773b3vboxsync struct Data; // opaque, defined in ApplianceImpl.cpp
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync Data *m;
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync enum SetUpProgressMode { ImportFile, ImportS3, WriteFile, WriteS3 };
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync
8b8dd147755c6df2f016d5df5fe6911f4532c19cvboxsync /** @name General stuff
8b8dd147755c6df2f016d5df5fe6911f4532c19cvboxsync * @{
8b8dd147755c6df2f016d5df5fe6911f4532c19cvboxsync */
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync bool i_isApplianceIdle();
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT i_searchUniqueVMName(Utf8Str& aName) const;
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT i_searchUniqueDiskImageFilePath(Utf8Str& aName) const;
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT i_setUpProgress(ComObjPtr<Progress> &pProgress,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync const Bstr &bstrDescription,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync SetUpProgressMode mode);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync void i_waitForAsyncProgress(ComObjPtr<Progress> &pProgressThis, ComPtr<IProgress> &pProgressAsync);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync void i_addWarning(const char* aWarning, ...);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync void i_disksWeight();
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync void i_parseBucket(Utf8Str &aPath, Utf8Str &aBucket);
b8ae33177906f4130b85b7c861cae0e78ed4859bvboxsync
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync static DECLCALLBACK(int) i_taskThreadImportOrExport(RTTHREAD aThread, void *pvUser);
b8ae33177906f4130b85b7c861cae0e78ed4859bvboxsync
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT i_initSetOfSupportedStandardsURI();
37e4655312fa6433c756cfa05a4db6b72e0c4344vboxsync
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync Utf8Str i_typeOfVirtualDiskFormatFromURI(Utf8Str type) const;
37e4655312fa6433c756cfa05a4db6b72e0c4344vboxsync
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync std::set<Utf8Str> i_URIFromTypeOfVirtualDiskFormat(Utf8Str type);
37e4655312fa6433c756cfa05a4db6b72e0c4344vboxsync
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT i_initApplianceIONameMap();
37e4655312fa6433c756cfa05a4db6b72e0c4344vboxsync
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync Utf8Str i_applianceIOName(APPLIANCEIONAME type) const;
37e4655312fa6433c756cfa05a4db6b72e0c4344vboxsync
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT i_findMediumFormatFromDiskImage(const ovf::DiskImage &di, ComObjPtr<MediumFormat>& mf);
8b8dd147755c6df2f016d5df5fe6911f4532c19cvboxsync /** @} */
1f1179353a81be311d4ab0204929ee92e337327fvboxsync
8b8dd147755c6df2f016d5df5fe6911f4532c19cvboxsync /** @name Read stuff
8b8dd147755c6df2f016d5df5fe6911f4532c19cvboxsync * @{
8b8dd147755c6df2f016d5df5fe6911f4532c19cvboxsync */
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT i_readImpl(const LocationInfo &aLocInfo, ComObjPtr<Progress> &aProgress);
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT i_readFS(TaskOVF *pTask);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT i_readFSOVF(TaskOVF *pTask);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT i_readFSOVA(TaskOVF *pTask);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT i_readFSImpl(TaskOVF *pTask, const RTCString &strFilename, PVDINTERFACEIO pCallbacks, PSHASTORAGE pStorage);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT i_readS3(TaskOVF *pTask);
8b8dd147755c6df2f016d5df5fe6911f4532c19cvboxsync /** @} */
b8ae33177906f4130b85b7c861cae0e78ed4859bvboxsync
8b8dd147755c6df2f016d5df5fe6911f4532c19cvboxsync /** @name Import stuff
8b8dd147755c6df2f016d5df5fe6911f4532c19cvboxsync * @}
8b8dd147755c6df2f016d5df5fe6911f4532c19cvboxsync */
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT i_importImpl(const LocationInfo &aLocInfo, ComObjPtr<Progress> &aProgress);
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT i_importFS(TaskOVF *pTask);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT i_importFSOVF(TaskOVF *pTask, AutoWriteLockBase& writeLock);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT i_importFSOVA(TaskOVF *pTask, AutoWriteLockBase& writeLock);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT i_importS3(TaskOVF *pTask);
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT i_readFileToBuf(const Utf8Str &strFile,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync void **ppvBuf,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync size_t *pcbSize,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync bool fCreateDigest,
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync PVDINTERFACEIO pCallbacks,
454ac5c6ef4960887035ceea6b5247789d3272davboxsync PSHASTORAGE pStorage);
10d107ae26d5e0a2293a693fe270427c6d96ba7dvboxsync HRESULT i_readTarFileToBuf(
10d107ae26d5e0a2293a693fe270427c6d96ba7dvboxsync#ifdef USE_RTTAR_FOR_READING
10d107ae26d5e0a2293a693fe270427c6d96ba7dvboxsync RTTAR tar,
10d107ae26d5e0a2293a693fe270427c6d96ba7dvboxsync#else
10d107ae26d5e0a2293a693fe270427c6d96ba7dvboxsync struct FSSRDONLYINTERFACEIO *pTarIo,
10d107ae26d5e0a2293a693fe270427c6d96ba7dvboxsync#endif
10d107ae26d5e0a2293a693fe270427c6d96ba7dvboxsync const Utf8Str &strFile,
10d107ae26d5e0a2293a693fe270427c6d96ba7dvboxsync void **ppvBuf,
10d107ae26d5e0a2293a693fe270427c6d96ba7dvboxsync size_t *pcbSize,
10d107ae26d5e0a2293a693fe270427c6d96ba7dvboxsync bool fCreateDigest,
10d107ae26d5e0a2293a693fe270427c6d96ba7dvboxsync PVDINTERFACEIO pCallbacks,
10d107ae26d5e0a2293a693fe270427c6d96ba7dvboxsync PSHASTORAGE pStorage);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT i_verifyManifestFile(const Utf8Str &strFile, ImportStack &stack, void *pvBuf, size_t cbSize);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync void i_convertDiskAttachmentValues(const ovf::HardDiskController &hdc,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync uint32_t ulAddressOnParent,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync Bstr &controllerType,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync int32_t &lControllerPort,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync int32_t &lDevice);
37e4655312fa6433c756cfa05a4db6b72e0c4344vboxsync
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync void i_importOneDiskImage(const ovf::DiskImage &di,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync Utf8Str *strTargetPath,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync ComObjPtr<Medium> &pTargetHD,
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync ImportStack &stack,
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync PVDINTERFACEIO pCallbacks,
454ac5c6ef4960887035ceea6b5247789d3272davboxsync PSHASTORAGE pStorage);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync void i_importMachineGeneric(const ovf::VirtualSystem &vsysThis,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync ComObjPtr<VirtualSystemDescription> &vsdescThis,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync ComPtr<IMachine> &pNewMachine,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync ImportStack &stack,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync PVDINTERFACEIO pCallbacks,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync PSHASTORAGE pStorage);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync void i_importVBoxMachine(ComObjPtr<VirtualSystemDescription> &vsdescThis,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync ComPtr<IMachine> &pNewMachine,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync ImportStack &stack,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync PVDINTERFACEIO pCallbacks,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync PSHASTORAGE pStorage);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync void i_importMachines(ImportStack &stack,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync PVDINTERFACEIO pCallbacks,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync PSHASTORAGE pStorage);
35d8d2372afb180daa0ba01af33a1922511d6b07vboxsync
8b8dd147755c6df2f016d5df5fe6911f4532c19cvboxsync HRESULT i_preCheckImageAvailability(PSHASTORAGE pSHAStorage,
8b8dd147755c6df2f016d5df5fe6911f4532c19cvboxsync RTCString &availableImage);
8b8dd147755c6df2f016d5df5fe6911f4532c19cvboxsync /** @} */
7a71f66d53a7dcdf19a7a357e99e560fda812dc3vboxsync
8b8dd147755c6df2f016d5df5fe6911f4532c19cvboxsync /** @name Write stuff
8b8dd147755c6df2f016d5df5fe6911f4532c19cvboxsync * @{
8b8dd147755c6df2f016d5df5fe6911f4532c19cvboxsync */
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT i_writeImpl(ovf::OVFVersion_T aFormat, const LocationInfo &aLocInfo, ComObjPtr<Progress> &aProgress);
d20e5d189feff7841cc3f40e5c9cca8c86b45eb5vboxsync
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT i_writeFS(TaskOVF *pTask);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT i_writeFSOVF(TaskOVF *pTask, AutoWriteLockBase& writeLock);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT i_writeFSOVA(TaskOVF *pTask, AutoWriteLockBase& writeLock);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT i_writeFSImpl(TaskOVF *pTask, AutoWriteLockBase& writeLock, PVDINTERFACEIO pCallbacks, PSHASTORAGE pStorage);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT i_writeS3(TaskOVF *pTask);
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync
f2490dbf97c8247439446844458461b00e50beb0vboxsync struct XMLStack;
62c8fef246519d59ee7ad41dd71de75b96b3552bvboxsync
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync void i_buildXML(AutoWriteLockBase& writeLock,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync xml::Document &doc,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync XMLStack &stack,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync const Utf8Str &strPath,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync ovf::OVFVersion_T enFormat);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync void i_buildXMLForOneVirtualSystem(AutoWriteLockBase& writeLock,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync xml::ElementNode &elmToAddVirtualSystemsTo,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync std::list<xml::ElementNode*> *pllElementsWithUuidAttributes,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync ComObjPtr<VirtualSystemDescription> &vsdescThis,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync ovf::OVFVersion_T enFormat,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync XMLStack &stack);
8b8dd147755c6df2f016d5df5fe6911f4532c19cvboxsync /** @} */
37e4655312fa6433c756cfa05a4db6b72e0c4344vboxsync
db85b6b8ce514217c1fb35d04b0854a65dc299f3vboxsync friend class Machine;
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync};
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
4b8518be25a866f7de85889a2d827d7a479e1411vboxsyncvoid i_parseURI(Utf8Str strUri, LocationInfo &locInfo);
76f5d3db08b007661ae4af93200838d24683af52vboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsyncstruct VirtualSystemDescriptionEntry
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync{
8b8dd147755c6df2f016d5df5fe6911f4532c19cvboxsync uint32_t ulIndex; ///< zero-based index of this entry within array
8b8dd147755c6df2f016d5df5fe6911f4532c19cvboxsync VirtualSystemDescriptionType_T type; ///< type of this entry
8b8dd147755c6df2f016d5df5fe6911f4532c19cvboxsync Utf8Str strRef; ///< reference number (hard disk controllers only)
8b8dd147755c6df2f016d5df5fe6911f4532c19cvboxsync Utf8Str strOvf; ///< original OVF value (type-dependent)
8b8dd147755c6df2f016d5df5fe6911f4532c19cvboxsync Utf8Str strVBoxSuggested; ///< configuration value (type-dependent); original value suggested by interpret()
8b8dd147755c6df2f016d5df5fe6911f4532c19cvboxsync Utf8Str strVBoxCurrent; ///< configuration value (type-dependent); current value, either from interpret() or setFinalValue()
8b8dd147755c6df2f016d5df5fe6911f4532c19cvboxsync Utf8Str strExtraConfigSuggested; ///< extra configuration key=value strings (type-dependent); original value suggested by interpret()
8b8dd147755c6df2f016d5df5fe6911f4532c19cvboxsync Utf8Str strExtraConfigCurrent; ///< extra configuration key=value strings (type-dependent); current value, either from interpret() or setFinalValue()
8b8dd147755c6df2f016d5df5fe6911f4532c19cvboxsync
8b8dd147755c6df2f016d5df5fe6911f4532c19cvboxsync uint32_t ulSizeMB; ///< hard disk images only: a copy of ovf::DiskImage::ulSuggestedSizeMB
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync};
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsyncclass ATL_NO_VTABLE VirtualSystemDescription :
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync public VirtualSystemDescriptionWrap
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync{
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync friend class Appliance;
c4d6c81bd0de216d0f42db2e477b1d788fbaefb4vboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsyncpublic:
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync DECLARE_EMPTY_CTOR_DTOR(VirtualSystemDescription)
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT FinalConstruct();
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync void FinalRelease();
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync HRESULT init();
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync void uninit();
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync /* public methods only for internal purposes */
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync void i_addEntry(VirtualSystemDescriptionType_T aType,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync const Utf8Str &strRef,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync const Utf8Str &aOvfValue,
1468b39c8bba83821c9a88039ead6315de21da51vboxsync const Utf8Str &aVBoxValue,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync uint32_t ulSizeMB = 0,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync const Utf8Str &strExtraConfig = "");
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync std::list<VirtualSystemDescriptionEntry*> i_findByType(VirtualSystemDescriptionType_T aType);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync const VirtualSystemDescriptionEntry* i_findControllerFromID(uint32_t id);
f9cac318205d74ee5b35dabcf2bd39118f6293d7vboxsync
1468b39c8bba83821c9a88039ead6315de21da51vboxsync void i_importVBoxMachineXML(const xml::ElementNode &elmMachine);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync const settings::MachineConfigFile* i_getMachineConfig() const;
89d62ba649bc933540aa6fecf95712eed480bcd2vboxsync
db85b6b8ce514217c1fb35d04b0854a65dc299f3vboxsync /* private instance data */
db85b6b8ce514217c1fb35d04b0854a65dc299f3vboxsyncprivate:
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync // wrapped IVirtualSystemDescription properties
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT getCount(ULONG *aCount);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync // wrapped IVirtualSystemDescription methods
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT getDescription(std::vector<VirtualSystemDescriptionType_T> &aTypes,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync std::vector<com::Utf8Str> &aRefs,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync std::vector<com::Utf8Str> &aOVFValues,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync std::vector<com::Utf8Str> &aVBoxValues,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync std::vector<com::Utf8Str> &aExtraConfigValues);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT getDescriptionByType(VirtualSystemDescriptionType_T aType,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync std::vector<VirtualSystemDescriptionType_T> &aTypes,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync std::vector<com::Utf8Str> &aRefs,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync std::vector<com::Utf8Str> &aOVFValues,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync std::vector<com::Utf8Str> &aVBoxValues,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync std::vector<com::Utf8Str> &aExtraConfigValues);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT getValuesByType(VirtualSystemDescriptionType_T aType,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync VirtualSystemDescriptionValueType_T aWhich,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync std::vector<com::Utf8Str> &aValues);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT setFinalValues(const std::vector<BOOL> &aEnabled,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync const std::vector<com::Utf8Str> &aVBoxValues,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync const std::vector<com::Utf8Str> &aExtraConfigValues);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync HRESULT addDescription(VirtualSystemDescriptionType_T aType,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync const com::Utf8Str &aVBoxValue,
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync const com::Utf8Str &aExtraConfigValue);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync void i_removeByType(VirtualSystemDescriptionType_T aType);
4b8518be25a866f7de85889a2d827d7a479e1411vboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync struct Data;
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync Data *m;
3221ae1f7bf53d9cccdd578099f55f782dba1447vboxsync
3221ae1f7bf53d9cccdd578099f55f782dba1447vboxsync friend class Machine;
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync};
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
1468b39c8bba83821c9a88039ead6315de21da51vboxsync#endif // !____H_APPLIANCEIMPL
5e3a885d489b1c99d79d576813f8f321bae46927vboxsync/* vi: set tabstop=4 shiftwidth=4 expandtab: */