ApplianceImplPrivate.h revision ceec11f70ccba5b30ce0a34c66116a09155aeb6e
/** @file
*
* VirtualBox Appliance private data definitions
*/
/*
* Copyright (C) 2006-2012 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#ifndef ____H_APPLIANCEIMPLPRIVATE
#define ____H_APPLIANCEIMPLPRIVATE
#include "ovfreader.h"
#include <map>
////////////////////////////////////////////////////////////////////////////////
//
// Appliance data definition
//
////////////////////////////////////////////////////////////////////////////////
* local hard disk or a remote target based on the supported inet protocols. */
struct LocationInfo
{
: storageType(VFSType_File) {}
};
// opaque private instance data of Appliance class
{
Data()
, fManifest(true)
, fSha256(false)
, ulTotalDisksMB(0)
, cDisks(0)
{
}
~Data()
{
if (pReader)
{
}
}
bool fManifest; // Create a manifest file on export
bool fSha256; // true = SHA256 (OVF 2.0), false = SHA1 (OVF 1.0)
Utf8Str strOVFSHADigest;//SHA digest of OVf file. It is stored here after reading OVF file (before import)
};
{
};
{
enum TaskType
{
Read,
};
: pAppliance(aThat),
{}
int startThread();
const LocationInfo locInfo;
};
struct MyHardDiskAttachment
{
};
/**
* Used by Appliance::importMachineGeneric() to store
* input parameters and rollback information.
*/
struct Appliance::ImportStack
{
// input pointers
// input parameters from VirtualSystemDescriptions
bool fForceHWVirt; // if true, we force enabling hardware virtualization
bool fForceIOAPIC; // if true, we force enabling the IOAPIC
#ifdef VBOX_WITH_USB
bool fUSBEnabled;
#endif
// representation of the audio adapter (should always be "0" for AC97 presently)
// session (not initially created)
bool fSessionOpen; // true if the pSession is currently open and needs closing
// and will be cleaned up on errors
cCPUs(1),
fForceHWVirt(false),
fForceIOAPIC(false),
ulMemorySizeMB(0),
fSessionOpen(false)
{
// disk images have to be on the same place as the OVF file. So
// strip the filename out of the full file path
}
};
////////////////////////////////////////////////////////////////////////////////
//
// VirtualSystemDescription data definition
//
////////////////////////////////////////////////////////////////////////////////
struct VirtualSystemDescription::Data
{
llDescriptions; // item descriptions
*pConfig; // machine config created from <vbox:Machine> element if found (import only)
};
////////////////////////////////////////////////////////////////////////////////
//
// Internal helpers
//
////////////////////////////////////////////////////////////////////////////////
typedef struct SHASTORAGE
{
bool fCreateDigest;
bool fSha256; /* false = SHA1 (OVF 1.x), true = SHA256 (OVF 2.0) */
} SHASTORAGE, *PSHASTORAGE;
int ShaReadBuf(const char *pcszFilename, void **ppvBuf, size_t *pcbSize, PVDINTERFACEIO pIfIo, void *pvUser);
int ShaWriteBuf(const char *pcszFilename, void *pvBuf, size_t cbSize, PVDINTERFACEIO pIfIo, void *pvUser);
int decompressImageAndSave(const char *pcszFullFilenameIn, const char *pcszFullFilenameOut, PVDINTERFACEIO pIfIo, void *pvUser);
#endif // !____H_APPLIANCEIMPLPRIVATE