VMware server CreateSnapshot takes less arguments than ESX 3's

This commit is contained in:
Doug MacEachern 2007-06-14 04:43:37 +00:00
parent 37d9c1af0c
commit e710e27948
2 changed files with 35 additions and 5 deletions

View File

@ -612,7 +612,7 @@ JNIEXPORT void VMWARE_JNI(VM_suspend)
}
}
JNIEXPORT void VMWARE_JNI(VM_createSnapshot)
JNIEXPORT void VMWARE_JNI(VM_createNamedSnapshot)
(JNIEnv *env, jclass obj,
jstring jname, jstring jdescr,
jboolean quiesce, jboolean memory)
@ -631,6 +631,21 @@ JNIEXPORT void VMWARE_JNI(VM_createSnapshot)
JENV->ReleaseStringUTFChars(env, jdescr, descr);
}
/* VMware server version has no args */
typedef Bool (*VMControl_VMmakeSnapshot)(VMControlVM *);
JNIEXPORT void VMWARE_JNI(VM_createDefaultSnapshot)
(JNIEnv *env, jclass obj)
{
dVM(obj);
VMControl_VMmakeSnapshot makeSnapshot =
(VMControl_VMmakeSnapshot)VMControl_VMCreateSnapshot;
if (!makeSnapshot(vm)) {
vmware_throw_last_vm_error();
}
}
JNIEXPORT void VMWARE_JNI(VM_revertToSnapshot)
(JNIEnv *env, jclass obj)
{

View File

@ -305,11 +305,26 @@ public class VM extends VMwareObject {
resume(POWEROP_MODE_DEFAULT);
}
public native void createSnapshot(String name,
private native void createNamedSnapshot(String name,
String description,
boolean quiesce,
boolean memory) throws VMwareException;
private native void createDefaultSnapshot() throws VMwareException;
public void createSnapshot(String name,
String description,
boolean quiesce,
boolean memory) throws VMwareException {
if (isESX()) {
createNamedSnapshot(name, description, quiesce, memory);
}
else {
createDefaultSnapshot();
}
}
public native void revertToSnapshot() throws VMwareException;
public native void removeAllSnapshots() throws VMwareException;