Add Java wrapper for VMware vmcontrol API
This commit is contained in:
1 parent
3676a936de
commit
894f7e52ad
11 files changed
+1858
-1
No files matched your search
@@ -0,0 +1,748 @@
|
||||
/*
|
||||
* Copyright (C) [2004, 2005, 2006], Hyperic, Inc.
|
||||
* This file is part of SIGAR.
|
||||
*
|
||||
* SIGAR is free software; you can redistribute it and/or modify
|
||||
* it under the terms version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation. This program is distributed
|
||||
* in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
|
||||
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
* USA.
|
||||
*/
|
||||
|
||||
#if defined(WIN32) || defined(__linux__)
|
||||
|
||||
#include <jni.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "vmcontrol_wrapper.h"
|
||||
|
||||
#define JENV (*env)
|
||||
|
||||
#define VMWARE_PACKAGE "org/hyperic/sigar/vmware/"
|
||||
|
||||
#define VMWARE_JNI(m) JNICALL Java_org_hyperic_sigar_vmware_##m
|
||||
|
||||
#define VMWARE_FIND_CLASS(name) \
|
||||
JENV->FindClass(env, VMWARE_PACKAGE name)
|
||||
|
||||
#define VMWARE_CLASS_SIG(name) \
|
||||
"L" VMWARE_PACKAGE name ";"
|
||||
|
||||
#define VMWARE_EX_SERVER 1
|
||||
#define VMWARE_EX_VM 2
|
||||
|
||||
static void vmware_throw_last_error(JNIEnv *env, void *ptr, int type)
|
||||
{
|
||||
jclass errorClass = VMWARE_FIND_CLASS("VMwareException");
|
||||
char *msg;
|
||||
int retval;
|
||||
|
||||
switch (type) {
|
||||
case VMWARE_EX_SERVER:
|
||||
retval = VMControl_ServerGetLastError((VMControlServer *)ptr,
|
||||
&msg);
|
||||
break;
|
||||
case VMWARE_EX_VM:
|
||||
retval = VMControl_VMGetLastError((VMControlVM *)ptr,
|
||||
&msg);
|
||||
break;
|
||||
}
|
||||
|
||||
JENV->ThrowNew(env, errorClass, msg);
|
||||
free(msg);
|
||||
}
|
||||
|
||||
#define vmware_throw_last_vm_error() \
|
||||
vmware_throw_last_error(env, vm, VMWARE_EX_VM);
|
||||
|
||||
#define vmware_throw_last_server_error() \
|
||||
vmware_throw_last_error(env, server, VMWARE_EX_SERVER)
|
||||
|
||||
static jint vmware_get_pointer(JNIEnv *env, jobject obj)
|
||||
{
|
||||
jclass cls = JENV->GetObjectClass(env, obj);
|
||||
jfieldID field = JENV->GetFieldID(env, cls, "ptr", "I");
|
||||
return JENV->GetIntField(env, obj, field);
|
||||
}
|
||||
|
||||
#define dVM(obj) \
|
||||
VMControlVM *vm = \
|
||||
(VMControlVM *)vmware_get_pointer(env, obj)
|
||||
|
||||
#define dSERVER(obj) \
|
||||
VMControlServer *server = \
|
||||
(VMControlServer *)vmware_get_pointer(env, obj)
|
||||
|
||||
#define dPARAMS(obj) \
|
||||
VMControlConnectParams *params = \
|
||||
(VMControlConnectParams *)vmware_get_pointer(env, obj)
|
||||
|
||||
JNIEXPORT jboolean VMWARE_JNI(VMwareObject_init)
|
||||
(JNIEnv *env, jclass classinstance, jstring jlib)
|
||||
{
|
||||
const char *lib;
|
||||
int retval;
|
||||
|
||||
if (jlib) {
|
||||
lib = JENV->GetStringUTFChars(env, jlib, NULL);
|
||||
}
|
||||
else {
|
||||
lib = getenv("VMCONTROL_SHLIB");
|
||||
}
|
||||
|
||||
retval = vmcontrol_wrapper_api_init(lib);
|
||||
|
||||
if (jlib) {
|
||||
JENV->ReleaseStringUTFChars(env, jlib, lib);
|
||||
}
|
||||
|
||||
if (retval != 0) {
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
return VMControl_Init() && VMControl_VMInit();
|
||||
}
|
||||
|
||||
JNIEXPORT jint VMWARE_JNI(ConnectParams_create)
|
||||
(JNIEnv *env, jclass classinstance,
|
||||
jstring jhost, jint port, jstring juser, jstring jpass)
|
||||
{
|
||||
jint ptr;
|
||||
const char *host=NULL;
|
||||
const char *user=NULL;
|
||||
const char *pass=NULL;
|
||||
|
||||
if (jhost) {
|
||||
host = JENV->GetStringUTFChars(env, jhost, NULL);
|
||||
}
|
||||
if (juser) {
|
||||
user = JENV->GetStringUTFChars(env, juser, NULL);
|
||||
}
|
||||
if (jpass) {
|
||||
pass = JENV->GetStringUTFChars(env, jpass, NULL);
|
||||
}
|
||||
|
||||
ptr = (jint)VMControl_ConnectParamsNew(host, port, user, pass);
|
||||
|
||||
if (host) {
|
||||
JENV->ReleaseStringUTFChars(env, jhost, host);
|
||||
}
|
||||
if (user) {
|
||||
JENV->ReleaseStringUTFChars(env, juser, user);
|
||||
}
|
||||
if (pass) {
|
||||
JENV->ReleaseStringUTFChars(env, jpass, pass);
|
||||
}
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
JNIEXPORT void VMWARE_JNI(ConnectParams_destroy)
|
||||
(JNIEnv *env, jobject obj)
|
||||
{
|
||||
dPARAMS(obj);
|
||||
VMControl_ConnectParamsDestroy(params);
|
||||
}
|
||||
|
||||
JNIEXPORT jint VMWARE_JNI(VMwareServer_create)
|
||||
(JNIEnv *env, jclass classinstance)
|
||||
{
|
||||
return (jint)VMControl_ServerNewEx();
|
||||
}
|
||||
|
||||
JNIEXPORT void VMWARE_JNI(VMwareServer_destroy)
|
||||
(JNIEnv *env, jclass obj)
|
||||
{
|
||||
dSERVER(obj);
|
||||
VMControl_ServerDestroy(server);
|
||||
}
|
||||
|
||||
JNIEXPORT void VMWARE_JNI(VMwareServer_disconnect)
|
||||
(JNIEnv *env, jclass obj)
|
||||
{
|
||||
dSERVER(obj);
|
||||
VMControl_ServerDisconnect(server);
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean VMWARE_JNI(VMwareServer_isConnected)
|
||||
(JNIEnv *env, jclass obj)
|
||||
{
|
||||
dSERVER(obj);
|
||||
return VMControl_ServerIsConnected(server);
|
||||
}
|
||||
|
||||
JNIEXPORT void VMWARE_JNI(VMwareServer_connect)
|
||||
(JNIEnv *env, jobject obj, jobject params_obj)
|
||||
{
|
||||
dSERVER(obj);
|
||||
dPARAMS(params_obj);
|
||||
|
||||
if (!VMControl_ServerConnectEx(server, params)) {
|
||||
vmware_throw_last_server_error();
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean VMWARE_JNI(VMwareServer_isRegistered)
|
||||
(JNIEnv *env, jclass obj, jstring jconfig)
|
||||
{
|
||||
dSERVER(obj);
|
||||
const char *config =
|
||||
JENV->GetStringUTFChars(env, jconfig, NULL);
|
||||
jboolean value;
|
||||
jboolean retval =
|
||||
VMControl_ServerIsRegistered(server, config, &value);
|
||||
|
||||
JENV->ReleaseStringUTFChars(env, jconfig, config);
|
||||
|
||||
if (!retval) {
|
||||
vmware_throw_last_server_error();
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
JNIEXPORT jobject VMWARE_JNI(VMwareServer_getRegisteredVmNames)
|
||||
(JNIEnv *env, jclass obj)
|
||||
{
|
||||
dSERVER(obj);
|
||||
char **ptr, **names;
|
||||
jobject listobj;
|
||||
jclass listclass =
|
||||
JENV->FindClass(env, "java/util/ArrayList");
|
||||
jmethodID listid =
|
||||
JENV->GetMethodID(env, listclass, "<init>", "()V");
|
||||
jmethodID addid =
|
||||
JENV->GetMethodID(env, listclass, "add",
|
||||
"(Ljava/lang/Object;)Z");
|
||||
|
||||
listobj = JENV->NewObject(env, listclass, listid);
|
||||
|
||||
ptr = names = VMControl_ServerEnumerate(server);
|
||||
|
||||
if (ptr) {
|
||||
while (*ptr) {
|
||||
JENV->CallBooleanMethod(env, listobj, addid,
|
||||
JENV->NewStringUTF(env, *ptr));
|
||||
if (JENV->ExceptionOccurred(env)) {
|
||||
JENV->ExceptionDescribe(env);
|
||||
}
|
||||
free(*ptr);
|
||||
ptr++;
|
||||
}
|
||||
free(names);
|
||||
}
|
||||
|
||||
return listobj;
|
||||
}
|
||||
|
||||
JNIEXPORT jstring VMWARE_JNI(VMwareServer_getResource)
|
||||
(JNIEnv *env, jclass obj, jstring jkey)
|
||||
{
|
||||
dSERVER(obj);
|
||||
jstring retval;
|
||||
const char *key =
|
||||
JENV->GetStringUTFChars(env, jkey, NULL);
|
||||
char *value =
|
||||
VMControl_ServerGetResource(server, (char *)key);
|
||||
|
||||
JENV->ReleaseStringUTFChars(env, jkey, key);
|
||||
|
||||
if (!value) {
|
||||
vmware_throw_last_server_error();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
retval = JENV->NewStringUTF(env, value);
|
||||
free(value);
|
||||
return retval;
|
||||
}
|
||||
|
||||
JNIEXPORT jstring VMWARE_JNI(VMwareServer_exec)
|
||||
(JNIEnv *env, jclass obj, jstring jxml)
|
||||
{
|
||||
dSERVER(obj);
|
||||
jstring retval;
|
||||
const char *xml =
|
||||
JENV->GetStringUTFChars(env, jxml, NULL);
|
||||
char *value =
|
||||
VMControl_ServerExec(server, xml);
|
||||
|
||||
JENV->ReleaseStringUTFChars(env, jxml, xml);
|
||||
|
||||
if (!value) {
|
||||
vmware_throw_last_server_error();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
retval = JENV->NewStringUTF(env, value);
|
||||
free(value);
|
||||
return retval;
|
||||
}
|
||||
|
||||
JNIEXPORT jint VMWARE_JNI(VM_create)
|
||||
(JNIEnv *env, jclass classinstance)
|
||||
{
|
||||
return (jint)VMControl_VMNewEx();
|
||||
}
|
||||
|
||||
JNIEXPORT void VMWARE_JNI(VM_destroy)
|
||||
(JNIEnv *env, jclass obj)
|
||||
{
|
||||
dVM(obj);
|
||||
VMControl_VMDestroy(vm);
|
||||
}
|
||||
|
||||
JNIEXPORT void VMWARE_JNI(VM_disconnect)
|
||||
(JNIEnv *env, jclass obj)
|
||||
{
|
||||
dVM(obj);
|
||||
VMControl_VMDisconnect(vm);
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean VMWARE_JNI(VM_isConnected)
|
||||
(JNIEnv *env, jclass obj)
|
||||
{
|
||||
dVM(obj);
|
||||
return VMControl_VMIsConnected(vm);
|
||||
}
|
||||
|
||||
JNIEXPORT void VMWARE_JNI(VM_connect)
|
||||
(JNIEnv *env, jobject obj, jobject params_obj,
|
||||
jstring jconfig, jint mks)
|
||||
{
|
||||
dVM(obj);
|
||||
dPARAMS(params_obj);
|
||||
const char *config =
|
||||
JENV->GetStringUTFChars(env, jconfig, NULL);
|
||||
|
||||
jboolean retval =
|
||||
VMControl_VMConnectEx(vm, params, config, mks);
|
||||
|
||||
JENV->ReleaseStringUTFChars(env, jconfig, config);
|
||||
|
||||
if (!retval) {
|
||||
vmware_throw_last_vm_error();
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT jint VMWARE_JNI(VM_getExecutionState)
|
||||
(JNIEnv *env, jclass obj)
|
||||
{
|
||||
dVM(obj);
|
||||
unsigned int state;
|
||||
|
||||
if (!VMControl_VMGetExecutionState(vm, &state)) {
|
||||
vmware_throw_last_vm_error();
|
||||
return -1;
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
JNIEXPORT jint VMWARE_JNI(VM_getRemoteConnections)
|
||||
(JNIEnv *env, jclass obj)
|
||||
{
|
||||
dVM(obj);
|
||||
unsigned int num;
|
||||
|
||||
if (!VMControl_VMGetRemoteConnections(vm, &num)) {
|
||||
vmware_throw_last_vm_error();
|
||||
return -1;
|
||||
}
|
||||
|
||||
return num;
|
||||
}
|
||||
|
||||
JNIEXPORT jint VMWARE_JNI(VM_getUptime)
|
||||
(JNIEnv *env, jclass obj)
|
||||
{
|
||||
dVM(obj);
|
||||
unsigned int uptime;
|
||||
|
||||
if (!VMControl_VMGetUptime(vm, &uptime)) {
|
||||
vmware_throw_last_vm_error();
|
||||
return -1;
|
||||
}
|
||||
|
||||
return uptime;
|
||||
}
|
||||
|
||||
JNIEXPORT jint VMWARE_JNI(VM_getHeartbeat)
|
||||
(JNIEnv *env, jclass obj)
|
||||
{
|
||||
dVM(obj);
|
||||
unsigned int heartbeat;
|
||||
|
||||
if (!VMControl_VMGetHeartbeat(vm, &heartbeat)) {
|
||||
vmware_throw_last_vm_error();
|
||||
return -1;
|
||||
}
|
||||
|
||||
return heartbeat;
|
||||
}
|
||||
|
||||
JNIEXPORT jint VMWARE_JNI(VM_getToolsLastActive)
|
||||
(JNIEnv *env, jclass obj)
|
||||
{
|
||||
dVM(obj);
|
||||
unsigned int seconds;
|
||||
|
||||
if (!VMControl_VMToolsLastActive(vm, &seconds)) {
|
||||
vmware_throw_last_vm_error();
|
||||
return -1;
|
||||
}
|
||||
|
||||
return seconds;
|
||||
}
|
||||
|
||||
JNIEXPORT jstring VMWARE_JNI(VM_getRunAsUser)
|
||||
(JNIEnv *env, jclass obj)
|
||||
{
|
||||
dVM(obj);
|
||||
char *user;
|
||||
jstring juser;
|
||||
|
||||
if (!VMControl_VMGetRunAsUser(vm, &user)) {
|
||||
vmware_throw_last_vm_error();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
juser = JENV->NewStringUTF(env, user);
|
||||
free(user);
|
||||
return juser;
|
||||
}
|
||||
|
||||
JNIEXPORT jint VMWARE_JNI(VM_getPermissions)
|
||||
(JNIEnv *env, jclass obj)
|
||||
{
|
||||
dVM(obj);
|
||||
unsigned int permissions;
|
||||
|
||||
if (!VMControl_VMGetCapabilities(vm, &permissions)) {
|
||||
vmware_throw_last_vm_error();
|
||||
return -1;
|
||||
}
|
||||
|
||||
return permissions;
|
||||
}
|
||||
|
||||
JNIEXPORT jstring VMWARE_JNI(VM_getConfig)
|
||||
(JNIEnv *env, jclass obj, jstring jkey)
|
||||
{
|
||||
dVM(obj);
|
||||
jstring retval;
|
||||
const char *key =
|
||||
JENV->GetStringUTFChars(env, jkey, NULL);
|
||||
char *value =
|
||||
VMControl_VMGetConfig(vm, (char *)key);
|
||||
|
||||
JENV->ReleaseStringUTFChars(env, jkey, key);
|
||||
|
||||
if (!value) {
|
||||
vmware_throw_last_vm_error();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
retval = JENV->NewStringUTF(env, value);
|
||||
free(value);
|
||||
return retval;
|
||||
}
|
||||
|
||||
JNIEXPORT void VMWARE_JNI(VM_setConfig)
|
||||
(JNIEnv *env, jclass obj, jstring jkey, jstring jvalue)
|
||||
{
|
||||
dVM(obj);
|
||||
jboolean retval;
|
||||
const char *key =
|
||||
JENV->GetStringUTFChars(env, jkey, NULL);
|
||||
const char *value =
|
||||
JENV->GetStringUTFChars(env, jvalue, NULL);
|
||||
|
||||
retval = VMControl_VMSetConfig(vm, (char *)key, (char *)value);
|
||||
|
||||
JENV->ReleaseStringUTFChars(env, jkey, key);
|
||||
JENV->ReleaseStringUTFChars(env, jvalue, value);
|
||||
|
||||
if (!retval) {
|
||||
vmware_throw_last_vm_error();
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT jstring VMWARE_JNI(VM_getResource)
|
||||
(JNIEnv *env, jclass obj, jstring jkey)
|
||||
{
|
||||
dVM(obj);
|
||||
jstring retval;
|
||||
const char *key =
|
||||
JENV->GetStringUTFChars(env, jkey, NULL);
|
||||
char *value =
|
||||
VMControl_VMGetResource(vm, (char *)key);
|
||||
|
||||
JENV->ReleaseStringUTFChars(env, jkey, key);
|
||||
|
||||
if (!value) {
|
||||
vmware_throw_last_vm_error();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
retval = JENV->NewStringUTF(env, value);
|
||||
free(value);
|
||||
return retval;
|
||||
}
|
||||
|
||||
JNIEXPORT jstring VMWARE_JNI(VM_getGuestInfo)
|
||||
(JNIEnv *env, jclass obj, jstring jkey)
|
||||
{
|
||||
dVM(obj);
|
||||
jstring retval;
|
||||
const char *key =
|
||||
JENV->GetStringUTFChars(env, jkey, NULL);
|
||||
char *value =
|
||||
VMControl_VMGetGuestInfo(vm, (char *)key);
|
||||
|
||||
JENV->ReleaseStringUTFChars(env, jkey, key);
|
||||
|
||||
if (!value) {
|
||||
vmware_throw_last_vm_error();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
retval = JENV->NewStringUTF(env, value);
|
||||
free(value);
|
||||
return retval;
|
||||
}
|
||||
|
||||
JNIEXPORT void VMWARE_JNI(VM_setGuestInfo)
|
||||
(JNIEnv *env, jclass obj, jstring jkey, jstring jvalue)
|
||||
{
|
||||
dVM(obj);
|
||||
jboolean retval;
|
||||
const char *key =
|
||||
JENV->GetStringUTFChars(env, jkey, NULL);
|
||||
const char *value =
|
||||
JENV->GetStringUTFChars(env, jvalue, NULL);
|
||||
|
||||
retval = VMControl_VMSetGuestInfo(vm, (char *)key, (char *)value);
|
||||
|
||||
JENV->ReleaseStringUTFChars(env, jkey, key);
|
||||
JENV->ReleaseStringUTFChars(env, jvalue, value);
|
||||
|
||||
if (!retval) {
|
||||
vmware_throw_last_vm_error();
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT jint VMWARE_JNI(VM_getProductInfo)
|
||||
(JNIEnv *env, jclass obj, jint type)
|
||||
{
|
||||
dVM(obj);
|
||||
unsigned int value;
|
||||
|
||||
if (!VMControl_VMGetProductInfo(vm, type, &value)) {
|
||||
vmware_throw_last_vm_error();
|
||||
return -1;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
JNIEXPORT void VMWARE_JNI(VM_start)
|
||||
(JNIEnv *env, jclass obj, jint mode)
|
||||
{
|
||||
dVM(obj);
|
||||
|
||||
if (!VMControl_VMStart(vm, mode)) {
|
||||
vmware_throw_last_vm_error();
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT void VMWARE_JNI(VM_stop)
|
||||
(JNIEnv *env, jclass obj, jint mode)
|
||||
{
|
||||
dVM(obj);
|
||||
|
||||
if (!VMControl_VMStopOrReset(vm, 1, mode)) {
|
||||
vmware_throw_last_vm_error();
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT void VMWARE_JNI(VM_reset)
|
||||
(JNIEnv *env, jclass obj, jint mode)
|
||||
{
|
||||
dVM(obj);
|
||||
|
||||
if (!VMControl_VMStopOrReset(vm, 0, mode)) {
|
||||
vmware_throw_last_vm_error();
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT void VMWARE_JNI(VM_suspend)
|
||||
(JNIEnv *env, jclass obj, jint mode)
|
||||
{
|
||||
dVM(obj);
|
||||
|
||||
if (!VMControl_VMSuspendToDisk(vm, mode)) {
|
||||
vmware_throw_last_vm_error();
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT void VMWARE_JNI(VM_createSnapshot)
|
||||
(JNIEnv *env, jclass obj,
|
||||
jstring jname, jstring jdescr,
|
||||
jboolean quiesce, jboolean memory)
|
||||
{
|
||||
dVM(obj);
|
||||
const char *name =
|
||||
JENV->GetStringUTFChars(env, jname, NULL);
|
||||
const char *descr =
|
||||
JENV->GetStringUTFChars(env, jdescr, NULL);
|
||||
|
||||
if (!VMControl_VMCreateSnapshot(vm, name, descr, quiesce, memory)) {
|
||||
vmware_throw_last_vm_error();
|
||||
}
|
||||
|
||||
JENV->ReleaseStringUTFChars(env, jname, name);
|
||||
JENV->ReleaseStringUTFChars(env, jdescr, descr);
|
||||
}
|
||||
|
||||
JNIEXPORT void VMWARE_JNI(VM_revertToSnapshot)
|
||||
(JNIEnv *env, jclass obj)
|
||||
{
|
||||
dVM(obj);
|
||||
|
||||
if (!VMControl_VMRevertToSnapshot(vm)) {
|
||||
vmware_throw_last_vm_error();
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT void VMWARE_JNI(VM_removeAllSnapshots)
|
||||
(JNIEnv *env, jclass obj)
|
||||
{
|
||||
dVM(obj);
|
||||
|
||||
if (!VMControl_VMRemoveAllSnapshots(vm)) {
|
||||
vmware_throw_last_vm_error();
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean VMWARE_JNI(VM_hasSnapshot)
|
||||
(JNIEnv *env, jclass obj)
|
||||
{
|
||||
dVM(obj);
|
||||
jboolean value;
|
||||
|
||||
if (!VMControl_VMHasSnapshot(vm, &value)) {
|
||||
vmware_throw_last_vm_error();
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
JNIEXPORT jlong VMWARE_JNI(VM_getPid)
|
||||
(JNIEnv *env, jclass obj)
|
||||
{
|
||||
dVM(obj);
|
||||
unsigned int pid;
|
||||
|
||||
if (!VMControl_VMGetPid(vm, &pid)) {
|
||||
vmware_throw_last_vm_error();
|
||||
return -1;
|
||||
}
|
||||
|
||||
return (jlong)pid;
|
||||
}
|
||||
|
||||
JNIEXPORT jint VMWARE_JNI(VM_getId)
|
||||
(JNIEnv *env, jclass obj)
|
||||
{
|
||||
dVM(obj);
|
||||
unsigned int id;
|
||||
|
||||
if (!VMControl_VMGetId(vm, &id)) {
|
||||
vmware_throw_last_vm_error();
|
||||
return -1;
|
||||
}
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
JNIEXPORT void VMWARE_JNI(VM_saveScreenshot)
|
||||
(JNIEnv *env, jclass obj, jstring jname)
|
||||
{
|
||||
dVM(obj);
|
||||
jboolean retval;
|
||||
const char *name =
|
||||
JENV->GetStringUTFChars(env, jname, NULL);
|
||||
|
||||
retval = VMControl_MKSSaveScreenshot(vm, name, "PNG");
|
||||
|
||||
JENV->ReleaseStringUTFChars(env, jname, name);
|
||||
|
||||
if (!retval) {
|
||||
vmware_throw_last_vm_error();
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT void VMWARE_JNI(VM_deviceConnect)
|
||||
(JNIEnv *env, jclass obj, jstring jdevice)
|
||||
{
|
||||
dVM(obj);
|
||||
const char *device =
|
||||
JENV->GetStringUTFChars(env, jdevice, NULL);
|
||||
jboolean retval =
|
||||
VMControl_VMDeviceConnect(vm, device);
|
||||
|
||||
JENV->ReleaseStringUTFChars(env, jdevice, device);
|
||||
|
||||
if (!retval) {
|
||||
vmware_throw_last_vm_error();
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT void VMWARE_JNI(VM_deviceDisconnect)
|
||||
(JNIEnv *env, jclass obj, jstring jdevice)
|
||||
{
|
||||
dVM(obj);
|
||||
const char *device =
|
||||
JENV->GetStringUTFChars(env, jdevice, NULL);
|
||||
jboolean retval =
|
||||
VMControl_VMDeviceDisconnect(vm, device);
|
||||
|
||||
JENV->ReleaseStringUTFChars(env, jdevice, device);
|
||||
|
||||
if (!retval) {
|
||||
vmware_throw_last_vm_error();
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean VMWARE_JNI(VM_deviceIsConnected)
|
||||
(JNIEnv *env, jclass obj, jstring jdevice)
|
||||
{
|
||||
dVM(obj);
|
||||
const char *device =
|
||||
JENV->GetStringUTFChars(env, jdevice, NULL);
|
||||
jboolean isConnected;
|
||||
jboolean retval =
|
||||
VMControl_VMDeviceIsConnected(vm, device,
|
||||
&isConnected);
|
||||
|
||||
JENV->ReleaseStringUTFChars(env, jdevice, device);
|
||||
|
||||
if (!retval) {
|
||||
vmware_throw_last_vm_error();
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
return isConnected;
|
||||
}
|
||||
|
||||
#endif /* WIN32 || linux */
|
||||
@@ -0,0 +1,203 @@
|
||||
/*
|
||||
* Copyright (C) [2004, 2005, 2006], Hyperic, Inc.
|
||||
* This file is part of SIGAR.
|
||||
*
|
||||
* SIGAR is free software; you can redistribute it and/or modify
|
||||
* it under the terms version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation. This program is distributed
|
||||
* in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
|
||||
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
* USA.
|
||||
*/
|
||||
|
||||
#if defined(WIN32) || defined(__linux__)
|
||||
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#include <dlfcn.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include "vmcontrol_wrapper.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#define DL_LOAD(lib) LoadLibrary(lib)
|
||||
#define DL_CLOSE(h) FreeLibrary(h)
|
||||
#define DL_SYM GetProcAddress
|
||||
#define DL_ERR GetLastError()
|
||||
#define DL_ENOENT ERROR_FILE_NOT_FOUND
|
||||
#else
|
||||
#define DL_LOAD(lib) dlopen(lib, RTLD_LAZY)
|
||||
#define DL_CLOSE(h) dlclose(h)
|
||||
#define DL_SYM dlsym
|
||||
#define DL_ERR errno
|
||||
#define DL_ENOENT ENOENT
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
const char *name;
|
||||
unsigned long offset;
|
||||
const char *alias;
|
||||
} vmcontrol_entry_t;
|
||||
|
||||
#define OffsetOf(structure, field) \
|
||||
(unsigned long)(&((structure *)NULL)->field)
|
||||
|
||||
#define VMCONTROL_ENTRY(name) \
|
||||
{ #name, OffsetOf(vmcontrol_wrapper_api_t, x##name), NULL }
|
||||
|
||||
#define VMCONTROL_ENTRY_ALIAS(name, alias) \
|
||||
{ #name, OffsetOf(vmcontrol_wrapper_api_t, x##name), alias }
|
||||
|
||||
static vmcontrol_entry_t vmcontrol_entries[] = {
|
||||
VMCONTROL_ENTRY(VMControl_ConnectParamsDestroy),
|
||||
VMCONTROL_ENTRY(VMControl_ConnectParamsNew),
|
||||
VMCONTROL_ENTRY(VMControl_Init),
|
||||
VMCONTROL_ENTRY(VMControl_MKSSaveScreenshot),
|
||||
VMCONTROL_ENTRY(VMControl_ServerConnectEx),
|
||||
VMCONTROL_ENTRY(VMControl_ServerDestroy),
|
||||
VMCONTROL_ENTRY(VMControl_ServerDisconnect),
|
||||
VMCONTROL_ENTRY(VMControl_ServerEnumerate),
|
||||
VMCONTROL_ENTRY(VMControl_ServerExec),
|
||||
VMCONTROL_ENTRY(VMControl_ServerGetLastError),
|
||||
VMCONTROL_ENTRY(VMControl_ServerGetResource),
|
||||
VMCONTROL_ENTRY(VMControl_ServerIsConnected),
|
||||
VMCONTROL_ENTRY(VMControl_ServerIsRegistered),
|
||||
VMCONTROL_ENTRY(VMControl_ServerNewEx),
|
||||
VMCONTROL_ENTRY(VMControl_VMConnectEx),
|
||||
VMCONTROL_ENTRY(VMControl_VMCreateSnapshot),
|
||||
VMCONTROL_ENTRY(VMControl_VMDestroy),
|
||||
VMCONTROL_ENTRY(VMControl_VMDeviceConnect),
|
||||
VMCONTROL_ENTRY(VMControl_VMDeviceDisconnect),
|
||||
VMCONTROL_ENTRY(VMControl_VMDeviceIsConnected),
|
||||
VMCONTROL_ENTRY(VMControl_VMDisconnect),
|
||||
VMCONTROL_ENTRY(VMControl_VMGetCapabilities),
|
||||
VMCONTROL_ENTRY(VMControl_VMGetConfig),
|
||||
VMCONTROL_ENTRY(VMControl_VMGetConfigFileName),
|
||||
VMCONTROL_ENTRY(VMControl_VMGetExecutionState),
|
||||
VMCONTROL_ENTRY(VMControl_VMGetGuestInfo),
|
||||
VMCONTROL_ENTRY(VMControl_VMGetHeartbeat),
|
||||
VMCONTROL_ENTRY(VMControl_VMGetId),
|
||||
VMCONTROL_ENTRY(VMControl_VMGetLastError),
|
||||
VMCONTROL_ENTRY(VMControl_VMGetPid),
|
||||
VMCONTROL_ENTRY(VMControl_VMGetProductInfo),
|
||||
VMCONTROL_ENTRY(VMControl_VMGetRemoteConnections),
|
||||
VMCONTROL_ENTRY(VMControl_VMGetResource),
|
||||
VMCONTROL_ENTRY(VMControl_VMGetRunAsUser),
|
||||
VMCONTROL_ENTRY(VMControl_VMGetUptime),
|
||||
VMCONTROL_ENTRY(VMControl_VMHasSnapshot),
|
||||
VMCONTROL_ENTRY(VMControl_VMInit),
|
||||
VMCONTROL_ENTRY(VMControl_VMIsConnected),
|
||||
VMCONTROL_ENTRY(VMControl_VMNewEx),
|
||||
VMCONTROL_ENTRY_ALIAS(VMControl_VMRemoveAllSnapshots,
|
||||
"VMControl_VMDeleteSnapshot"),
|
||||
VMCONTROL_ENTRY_ALIAS(VMControl_VMRevertToSnapshot,
|
||||
"VMControl_VMRevertSnapshot"),
|
||||
VMCONTROL_ENTRY(VMControl_VMSetConfig),
|
||||
VMCONTROL_ENTRY(VMControl_VMSetGuestInfo),
|
||||
VMCONTROL_ENTRY(VMControl_VMStart),
|
||||
VMCONTROL_ENTRY(VMControl_VMStopOrReset),
|
||||
VMCONTROL_ENTRY(VMControl_VMSuspendToDisk),
|
||||
VMCONTROL_ENTRY(VMControl_VMToolsLastActive),
|
||||
{ NULL, 0, NULL }
|
||||
};
|
||||
|
||||
static vmcontrol_wrapper_api_t *vmcontrol_api = NULL;
|
||||
|
||||
vmcontrol_wrapper_api_t *vmcontrol_wrapper_api_get(void)
|
||||
{
|
||||
return vmcontrol_api;
|
||||
}
|
||||
|
||||
typedef void (*any_function_t)(void);
|
||||
|
||||
static int unsupported_function(void *obj, ...)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int vmcontrol_wrapper_api_init(const char *lib)
|
||||
{
|
||||
int i;
|
||||
char *api;
|
||||
|
||||
if (vmcontrol_api) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!lib) { /* sanity check */
|
||||
return DL_ENOENT;
|
||||
}
|
||||
|
||||
vmcontrol_api = malloc(sizeof(*vmcontrol_api));
|
||||
api = (char *)vmcontrol_api;
|
||||
memset(vmcontrol_api, 0, sizeof(*vmcontrol_api));
|
||||
|
||||
if (!(vmcontrol_api->handle = DL_LOAD(lib))) {
|
||||
return DL_ERR;
|
||||
}
|
||||
|
||||
for (i=0; vmcontrol_entries[i].name; i++) {
|
||||
any_function_t *ptr =
|
||||
(any_function_t *)(api + (int)(long)vmcontrol_entries[i].offset);
|
||||
|
||||
*ptr =
|
||||
(any_function_t)DL_SYM(vmcontrol_api->handle,
|
||||
vmcontrol_entries[i].name);
|
||||
|
||||
if ((*ptr == NULL) && vmcontrol_entries[i].alias) {
|
||||
*ptr =
|
||||
(any_function_t)DL_SYM(vmcontrol_api->handle,
|
||||
vmcontrol_entries[i].alias);
|
||||
|
||||
#ifdef DL_DEBUG
|
||||
printf("%s -> %s\n",
|
||||
vmcontrol_entries[i].name,
|
||||
vmcontrol_entries[i].alias);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!*ptr) {
|
||||
#ifdef DL_DEBUG
|
||||
printf("%s -> UNDEFINED\n", vmcontrol_entries[i].name);
|
||||
#endif
|
||||
*ptr = (any_function_t)unsupported_function;
|
||||
}
|
||||
}
|
||||
|
||||
if ((void *)vmcontrol_api->xVMControl_VMInit == (void *)&unsupported_function) {
|
||||
#ifdef DL_DEBUG
|
||||
printf("%s unuseable\n", lib);
|
||||
#endif
|
||||
vmcontrol_wrapper_api_shutdown();
|
||||
return DL_ENOENT;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int vmcontrol_wrapper_api_shutdown(void)
|
||||
{
|
||||
if (vmcontrol_api) {
|
||||
if (vmcontrol_api->handle) {
|
||||
DL_CLOSE(vmcontrol_api->handle);
|
||||
}
|
||||
|
||||
free(vmcontrol_api);
|
||||
vmcontrol_api = NULL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* WIN32 || linux */
|
||||
@@ -0,0 +1,235 @@
|
||||
/*
|
||||
* Copyright (C) [2004, 2005, 2006], Hyperic, Inc.
|
||||
* This file is part of SIGAR.
|
||||
*
|
||||
* SIGAR is free software; you can redistribute it and/or modify
|
||||
* it under the terms version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation. This program is distributed
|
||||
* in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
|
||||
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
* USA.
|
||||
*/
|
||||
|
||||
#ifndef VMCONTROL_WRAPPER_H
|
||||
#define VMCONTROL_WRAPPER_H
|
||||
|
||||
/* types defined by vmcontrol.h */
|
||||
typedef struct VMControlServer VMControlServer;
|
||||
|
||||
typedef struct VMControlVM VMControlVM;
|
||||
|
||||
typedef char Bool;
|
||||
|
||||
typedef struct {
|
||||
const char *hostname;
|
||||
int port;
|
||||
const char *username;
|
||||
char *password;
|
||||
} VMControlConnectParams;
|
||||
|
||||
/* function pointers to api defined by vmcontrol.h */
|
||||
typedef struct {
|
||||
void *handle;
|
||||
void (*xVMControl_ConnectParamsDestroy)(VMControlConnectParams *);
|
||||
VMControlConnectParams * (*xVMControl_ConnectParamsNew)(const char *, int, const char *, const char *);
|
||||
Bool (*xVMControl_Init)(void);
|
||||
Bool (*xVMControl_MKSSaveScreenshot)(VMControlVM *, const char *, const char *);
|
||||
Bool (*xVMControl_ServerConnectEx)(VMControlServer *, VMControlConnectParams *);
|
||||
void (*xVMControl_ServerDestroy)(VMControlServer *);
|
||||
void (*xVMControl_ServerDisconnect)(VMControlServer *);
|
||||
char ** (*xVMControl_ServerEnumerate)(VMControlServer *);
|
||||
char * (*xVMControl_ServerExec)(VMControlServer *, const char *);
|
||||
int (*xVMControl_ServerGetLastError)(VMControlServer *, char **);
|
||||
char * (*xVMControl_ServerGetResource)(VMControlServer *, char *);
|
||||
Bool (*xVMControl_ServerIsConnected)(VMControlServer *);
|
||||
Bool (*xVMControl_ServerIsRegistered)(VMControlServer *, const char *, Bool *);
|
||||
VMControlServer * (*xVMControl_ServerNewEx)(void);
|
||||
Bool (*xVMControl_VMConnectEx)(VMControlVM *, VMControlConnectParams *, const char *, Bool);
|
||||
Bool (*xVMControl_VMCreateSnapshot)(VMControlVM *, const char *, const char *, Bool, Bool);
|
||||
void (*xVMControl_VMDestroy)(VMControlVM *);
|
||||
Bool (*xVMControl_VMDeviceConnect)(VMControlVM *, const char *);
|
||||
Bool (*xVMControl_VMDeviceDisconnect)(VMControlVM *, const char *);
|
||||
Bool (*xVMControl_VMDeviceIsConnected)(VMControlVM *, const char *, Bool *);
|
||||
void (*xVMControl_VMDisconnect)(VMControlVM *);
|
||||
Bool (*xVMControl_VMGetCapabilities)(VMControlVM *, unsigned int *);
|
||||
char * (*xVMControl_VMGetConfig)(VMControlVM *, char *);
|
||||
char * (*xVMControl_VMGetConfigFileName)(VMControlVM *);
|
||||
Bool (*xVMControl_VMGetExecutionState)(VMControlVM *, int *);
|
||||
char * (*xVMControl_VMGetGuestInfo)(VMControlVM *, char *);
|
||||
Bool (*xVMControl_VMGetHeartbeat)(VMControlVM *, unsigned int *);
|
||||
Bool (*xVMControl_VMGetId)(VMControlVM *, unsigned int *);
|
||||
int (*xVMControl_VMGetLastError)(VMControlVM *, char **);
|
||||
Bool (*xVMControl_VMGetPid)(VMControlVM *, unsigned int * );
|
||||
Bool (*xVMControl_VMGetProductInfo)(VMControlVM *, int, int *);
|
||||
Bool (*xVMControl_VMGetRemoteConnections)(VMControlVM *, unsigned int *);
|
||||
char * (*xVMControl_VMGetResource)(VMControlVM *, char *);
|
||||
Bool (*xVMControl_VMGetRunAsUser)(VMControlVM *, char **);
|
||||
Bool (*xVMControl_VMGetUptime)(VMControlVM *, unsigned int *);
|
||||
Bool (*xVMControl_VMHasSnapshot)(VMControlVM *, Bool *);
|
||||
char (*xVMControl_VMInit)(void);
|
||||
Bool (*xVMControl_VMIsConnected)(VMControlVM *);
|
||||
VMControlVM * (*xVMControl_VMNewEx)(void);
|
||||
Bool (*xVMControl_VMRemoveAllSnapshots)(VMControlVM *);
|
||||
Bool (*xVMControl_VMRevertToSnapshot)(VMControlVM *);
|
||||
Bool (*xVMControl_VMSetConfig)(VMControlVM *, char *, char *);
|
||||
Bool (*xVMControl_VMSetGuestInfo)(VMControlVM *, char *, char *);
|
||||
Bool (*xVMControl_VMStart)(VMControlVM *, int);
|
||||
Bool (*xVMControl_VMStopOrReset)(VMControlVM *, Bool, int);
|
||||
Bool (*xVMControl_VMSuspendToDisk)(VMControlVM *, int);
|
||||
Bool (*xVMControl_VMToolsLastActive)(VMControlVM *, int *);
|
||||
} vmcontrol_wrapper_api_t;
|
||||
|
||||
int vmcontrol_wrapper_api_init(const char *lib);
|
||||
|
||||
int vmcontrol_wrapper_api_shutdown(void);
|
||||
|
||||
vmcontrol_wrapper_api_t *vmcontrol_wrapper_api_get(void);
|
||||
|
||||
#define VMControl_ConnectParamsDestroy \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_ConnectParamsDestroy
|
||||
|
||||
#define VMControl_ConnectParamsNew \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_ConnectParamsNew
|
||||
|
||||
#define VMControl_Init \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_Init
|
||||
|
||||
#define VMControl_MKSSaveScreenshot \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_MKSSaveScreenshot
|
||||
|
||||
#define VMControl_ServerConnectEx \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_ServerConnectEx
|
||||
|
||||
#define VMControl_ServerDestroy \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_ServerDestroy
|
||||
|
||||
#define VMControl_ServerDisconnect \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_ServerDisconnect
|
||||
|
||||
#define VMControl_ServerEnumerate \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_ServerEnumerate
|
||||
|
||||
#define VMControl_ServerExec \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_ServerExec
|
||||
|
||||
#define VMControl_ServerGetLastError \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_ServerGetLastError
|
||||
|
||||
#define VMControl_ServerGetResource \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_ServerGetResource
|
||||
|
||||
#define VMControl_ServerIsConnected \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_ServerIsConnected
|
||||
|
||||
#define VMControl_ServerIsRegistered \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_ServerIsRegistered
|
||||
|
||||
#define VMControl_ServerNewEx \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_ServerNewEx
|
||||
|
||||
#define VMControl_VMConnectEx \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMConnectEx
|
||||
|
||||
#define VMControl_VMCreateSnapshot \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMCreateSnapshot
|
||||
|
||||
#define VMControl_VMDestroy \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMDestroy
|
||||
|
||||
#define VMControl_VMDeviceConnect \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMDeviceConnect
|
||||
|
||||
#define VMControl_VMDeviceDisconnect \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMDeviceDisconnect
|
||||
|
||||
#define VMControl_VMDeviceIsConnected \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMDeviceIsConnected
|
||||
|
||||
#define VMControl_VMDisconnect \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMDisconnect
|
||||
|
||||
#define VMControl_VMGetCapabilities \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMGetCapabilities
|
||||
|
||||
#define VMControl_VMGetConfig \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMGetConfig
|
||||
|
||||
#define VMControl_VMGetConfigFileName \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMGetConfigFileName
|
||||
|
||||
#define VMControl_VMGetExecutionState \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMGetExecutionState
|
||||
|
||||
#define VMControl_VMGetGuestInfo \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMGetGuestInfo
|
||||
|
||||
#define VMControl_VMGetHeartbeat \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMGetHeartbeat
|
||||
|
||||
#define VMControl_VMGetId \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMGetId
|
||||
|
||||
#define VMControl_VMGetLastError \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMGetLastError
|
||||
|
||||
#define VMControl_VMGetPid \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMGetPid
|
||||
|
||||
#define VMControl_VMGetProductInfo \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMGetProductInfo
|
||||
|
||||
#define VMControl_VMGetRemoteConnections \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMGetRemoteConnections
|
||||
|
||||
#define VMControl_VMGetResource \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMGetResource
|
||||
|
||||
#define VMControl_VMGetRunAsUser \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMGetRunAsUser
|
||||
|
||||
#define VMControl_VMGetUptime \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMGetUptime
|
||||
|
||||
#define VMControl_VMHasSnapshot \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMHasSnapshot
|
||||
|
||||
#define VMControl_VMInit \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMInit
|
||||
|
||||
#define VMControl_VMIsConnected \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMIsConnected
|
||||
|
||||
#define VMControl_VMNewEx \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMNewEx
|
||||
|
||||
#define VMControl_VMRemoveAllSnapshots \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMRemoveAllSnapshots
|
||||
|
||||
#define VMControl_VMRevertToSnapshot \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMRevertToSnapshot
|
||||
|
||||
#define VMControl_VMSetConfig \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMSetConfig
|
||||
|
||||
#define VMControl_VMSetGuestInfo \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMSetGuestInfo
|
||||
|
||||
#define VMControl_VMStart \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMStart
|
||||
|
||||
#define VMControl_VMStopOrReset \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMStopOrReset
|
||||
|
||||
#define VMControl_VMSuspendToDisk \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMSuspendToDisk
|
||||
|
||||
#define VMControl_VMToolsLastActive \
|
||||
vmcontrol_wrapper_api_get()->xVMControl_VMToolsLastActive
|
||||
|
||||
#endif /* VMCONTROL_WRAPPER_H */
|
||||
Reference in new issue
Block a user