ApplianceImpl.h revision 2c1d8cd8efdd4c486ff681135035d24111b03af8
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * VirtualBox COM class implementation
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * Copyright (C) 2006-2009 Sun Microsystems, Inc.
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 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * additional information or have any questions.
b8ae33177906f4130b85b7c861cae0e78ed4859bvboxsync/* VBox includes */
b8ae33177906f4130b85b7c861cae0e78ed4859bvboxsync/* VBox forward declarations */
f32de6c198a491c28ace2b4c53f8d04a79fd6d69vboxsync public VirtualBoxSupportErrorInfoImpl<Appliance, IAppliance>,
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync // public initializer/uninitializer for internal purposes only
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync // for VirtualBoxSupportErrorInfoImpl
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync static const wchar_t *getComponentName() { return L"Appliance"; }
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync /* IAppliance properties */
f6dde23cd488aee26203b38ec67220270f5c4273vboxsync STDMETHOD(COMGETTER(Disks))(ComSafeArrayOut(BSTR, aDisks));
f6dde23cd488aee26203b38ec67220270f5c4273vboxsync STDMETHOD(COMGETTER(VirtualSystemDescriptions))(ComSafeArrayOut(IVirtualSystemDescription*, aVirtualSystemDescriptions));
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync /* IAppliance methods */
dc311b529996345ea65d51c87b60b6849642d894vboxsync /* Import methods */
b8ae33177906f4130b85b7c861cae0e78ed4859bvboxsync STDMETHOD(Read)(IN_BSTR path, IProgress **aProgress);
dc311b529996345ea65d51c87b60b6849642d894vboxsync /* Export methods */
dc311b529996345ea65d51c87b60b6849642d894vboxsync STDMETHOD(CreateVFSExplorer)(IN_BSTR aURI, IVFSExplorer **aExplorer);
0a3eb63419e41ef10cd135aeb66dcd6bd6f87cdcvboxsync STDMETHOD(Write)(IN_BSTR format, IN_BSTR path, IProgress **aProgress);
c4d6c81bd0de216d0f42db2e477b1d788fbaefb4vboxsync STDMETHOD(GetWarnings)(ComSafeArrayOut(BSTR, aWarnings));
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync /* public methods only for internal purposes */
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync /* private instance data */
482a222498aae619afda0255a7edf4ebda97268cvboxsync /** weak VirtualBox parent */
d020036eb167a2f97f5010276fda5daa3f4773b3vboxsync struct Data; // opaque, defined in ApplianceImpl.cpp
d91dc86210d602f51a4701762488a5e696c80a45vboxsync HRESULT searchUniqueDiskImageFilePath(Utf8Str& aName) const;
2c1d8cd8efdd4c486ff681135035d24111b03af8vboxsync HRESULT getDefaultHardDiskFolder(Utf8Str &str) const;
59d96bafa78f7257869e30b88f2f98142ef5928evboxsync void waitForAsyncProgress(ComObjPtr<Progress> &pProgressThis, ComPtr<IProgress> &pProgressAsync);
35d8d2372afb180daa0ba01af33a1922511d6b07vboxsync enum SetUpProgressMode { Regular, ImportS3, WriteS3 };
35d8d2372afb180daa0ba01af33a1922511d6b07vboxsync HRESULT setUpProgress(ComObjPtr<Progress> &pProgress,
b8ae33177906f4130b85b7c861cae0e78ed4859bvboxsync void parseURI(Utf8Str strUri, LocationInfo &locInfo) const;
b8ae33177906f4130b85b7c861cae0e78ed4859bvboxsync void parseBucket(Utf8Str &aPath, Utf8Str &aBucket) const;
b8ae33177906f4130b85b7c861cae0e78ed4859bvboxsync HRESULT readImpl(const LocationInfo &aLocInfo, ComObjPtr<Progress> &aProgress);
6b9316bfe743cc7d2ee00d925f4ab455bc224e86vboxsync static DECLCALLBACK(int) taskThreadImportOrExport(RTTHREAD aThread, void *pvUser);
d5bf937d132098565e18a0d1fc408fb777c5e5b6vboxsync void convertDiskAttachmentValues(const ovf::HardDiskController &hdc,
7a71f66d53a7dcdf19a7a357e99e560fda812dc3vboxsync HRESULT importImpl(const LocationInfo &aLocInfo, ComObjPtr<Progress> &aProgress);
35d8d2372afb180daa0ba01af33a1922511d6b07vboxsync HRESULT manifestVerify(const LocationInfo &locInfo, const ovf::OVFReader &reader);
6b9316bfe743cc7d2ee00d925f4ab455bc224e86vboxsync HRESULT importFS(const LocationInfo &locInfo, ComObjPtr<Progress> &aProgress);
21293ca6a2967f796ed30a6c8492911619476a48vboxsync void importMachineGeneric(const ovf::VirtualSystem &vsysThis,
2c1d8cd8efdd4c486ff681135035d24111b03af8vboxsync void importVBoxMachine(ComObjPtr<VirtualSystemDescription> &vsdescThis,
f2490dbf97c8247439446844458461b00e50beb0vboxsync HRESULT writeImpl(OVFFormat aFormat, const LocationInfo &aLocInfo, ComObjPtr<Progress> &aProgress);
f2490dbf97c8247439446844458461b00e50beb0vboxsync void buildXMLForOneVirtualSystem(xml::ElementNode &elmToAddVirtualSystemsTo,
6b9316bfe743cc7d2ee00d925f4ab455bc224e86vboxsync HRESULT writeFS(const LocationInfo &locInfo, const OVFFormat enFormat, ComObjPtr<Progress> &pProgress);
4831e82ecaa3c813398d2f343e9d38ee34a3acf4vboxsync uint32_t ulIndex; // zero-based index of this entry within array
4831e82ecaa3c813398d2f343e9d38ee34a3acf4vboxsync VirtualSystemDescriptionType_T type; // type of this entry
4831e82ecaa3c813398d2f343e9d38ee34a3acf4vboxsync Utf8Str strRef; // reference number (hard disk controllers only)
40becad9511726726c5959a8ad8b62fb3e1c020cvboxsync Utf8Str strOvf; // original OVF value (type-dependent)
40becad9511726726c5959a8ad8b62fb3e1c020cvboxsync Utf8Str strVbox; // configuration value (type-dependent)
4831e82ecaa3c813398d2f343e9d38ee34a3acf4vboxsync Utf8Str strExtraConfig; // extra configuration key=value strings (type-dependent)
2c1d8cd8efdd4c486ff681135035d24111b03af8vboxsync uint32_t ulSizeMB; // hard disk images only: a copy of ovf::DiskImage::ulSuggestedSizeMB
f32de6c198a491c28ace2b4c53f8d04a79fd6d69vboxsync public VirtualBoxSupportErrorInfoImpl<VirtualSystemDescription, IVirtualSystemDescription>,
f32de6c198a491c28ace2b4c53f8d04a79fd6d69vboxsync public VirtualBoxSupportTranslation<VirtualSystemDescription>,
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (VirtualSystemDescription)
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync // public initializer/uninitializer for internal purposes only
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync // for VirtualBoxSupportErrorInfoImpl
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync static const wchar_t *getComponentName() { return L"VirtualSystemDescription"; }
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync /* IVirtualSystemDescription properties */
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync /* IVirtualSystemDescription methods */
f6dde23cd488aee26203b38ec67220270f5c4273vboxsync STDMETHOD(GetDescription)(ComSafeArrayOut(VirtualSystemDescriptionType_T, aTypes),
d07e901177d22a8f66c66f155c423a524ac07776vboxsync STDMETHOD(GetDescriptionByType)(VirtualSystemDescriptionType_T aType,
d07e901177d22a8f66c66f155c423a524ac07776vboxsync ComSafeArrayOut(VirtualSystemDescriptionType_T, aTypes),
f48fe310f85f13db0140bef980de1f56c2007957vboxsync STDMETHOD(GetValuesByType)(VirtualSystemDescriptionType_T aType,
1b186b95b77faa977d3651bbfc13afb3f13e0225vboxsync STDMETHOD(SetFinalValues)(ComSafeArrayIn(BOOL, aEnabled),
d4f7483a46e1c44ae5fcc4195be291545ae720a4vboxsync STDMETHOD(AddDescription)(VirtualSystemDescriptionType_T aType,
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync /* public methods only for internal purposes */
f9cac318205d74ee5b35dabcf2bd39118f6293d7vboxsync void addEntry(VirtualSystemDescriptionType_T aType,
f9cac318205d74ee5b35dabcf2bd39118f6293d7vboxsync std::list<VirtualSystemDescriptionEntry*> findByType(VirtualSystemDescriptionType_T aType);
4831e82ecaa3c813398d2f343e9d38ee34a3acf4vboxsync const VirtualSystemDescriptionEntry* findControllerFromID(uint32_t id);
f7c0f913c4c22ee18059ff97055442566d0f14a1vboxsync void importVboxMachineXML(const xml::ElementNode &elmMachine);
f7c0f913c4c22ee18059ff97055442566d0f14a1vboxsync const settings::MachineConfigFile* getMachineConfig() const;
db85b6b8ce514217c1fb35d04b0854a65dc299f3vboxsync /* private instance data */
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync#endif // ____H_APPLIANCEIMPL
5e3a885d489b1c99d79d576813f8f321bae46927vboxsync/* vi: set tabstop=4 shiftwidth=4 expandtab: */