提交 677ecdc0 编写于 作者: T Taowei 提交者: Michal Privoznik

vbox: Rewrite vboxDomainSnapshotCreateXML

The vboxDomainSnapshotCreateXML integrated the snapshot redefine
with this patch:
http://www.redhat.com/archives/libvir-list/2014-May/msg00589.html
This patch introduced vboxSnapshotRedefine in vboxUniformedAPI to
enable the features.

This patch replace all version specified APIs to the uniformed api,
then, moving the whole implementation to vbox_common.c. As there
is only API level changes, the behavior of the function doesn't
change.

Some old version's defects has brought to the new one. The already
known things are:
    *goto cleanup in a loop without releasing the pointers in the
    loop.
    *When function failed after machine unregister, no roll back
    to recovery it and the virtual machine would disappear.
上级 51d1a29d
此差异已折叠。
...@@ -247,6 +247,24 @@ enum MediumType ...@@ -247,6 +247,24 @@ enum MediumType
MediumType_Writethrough = 2, MediumType_Writethrough = 2,
}; };
enum CleanupMode
{
CleanupMode_UnregisterOnly = 1,
CleanupMode_DetachAllReturnNone = 2,
CleanupMode_DetachAllReturnHardDisksOnly = 3,
CleanupMode_Full = 4
};
enum MediumVariant
{
MediumVariant_Standard = 0,
MediumVariant_VmdkSplit2G = 0x01,
MediumVariant_VmdkStreamOptimized = 0x04,
MediumVariant_VmdkESX = 0x08,
MediumVariant_Fixed = 0x10000,
MediumVariant_Diff = 0x20000
};
/* Simplied definitions in vbox_CAPI_*.h */ /* Simplied definitions in vbox_CAPI_*.h */
typedef void const *PCVBOXXPCOM; typedef void const *PCVBOXXPCOM;
......
此差异已折叠。
...@@ -552,6 +552,11 @@ int vboxDomainUpdateDeviceFlags(virDomainPtr dom, const char *xml, ...@@ -552,6 +552,11 @@ int vboxDomainUpdateDeviceFlags(virDomainPtr dom, const char *xml,
int vboxDomainDetachDevice(virDomainPtr dom, const char *xml); int vboxDomainDetachDevice(virDomainPtr dom, const char *xml);
int vboxDomainDetachDeviceFlags(virDomainPtr dom, const char *xml, int vboxDomainDetachDeviceFlags(virDomainPtr dom, const char *xml,
unsigned int flags); unsigned int flags);
virDomainSnapshotPtr
vboxDomainSnapshotCreateXML(virDomainPtr dom,
const char *xmlDesc,
unsigned int flags);
/* Version specified functions for installing uniformed API */ /* Version specified functions for installing uniformed API */
void vbox22InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI); void vbox22InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册