mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-04-01 20:05:19 +00:00
esx: Stop passing around virConnectPtr for error reporting
This commit is contained in:
parent
9757e10d6d
commit
854111f97e
File diff suppressed because it is too large
Load Diff
@ -37,9 +37,9 @@
|
||||
|
||||
#define VIR_FROM_THIS VIR_FROM_ESX
|
||||
|
||||
#define ESX_ERROR(conn, code, fmt...) \
|
||||
virReportErrorHelper (conn, VIR_FROM_ESX, code, __FILE__, __FUNCTION__, \
|
||||
__LINE__, fmt)
|
||||
#define ESX_ERROR(code, fmt...) \
|
||||
virReportErrorHelper(NULL, VIR_FROM_ESX, code, __FILE__, __FUNCTION__, \
|
||||
__LINE__, fmt)
|
||||
|
||||
/* AI_ADDRCONFIG is missing on some systems. */
|
||||
#ifndef AI_ADDRCONFIG
|
||||
@ -132,7 +132,7 @@ esxUtil_RequestPassword(virConnectAuthPtr auth, const char *username,
|
||||
|
||||
|
||||
int
|
||||
esxUtil_ParseQuery(virConnectPtr conn, char **transport, char **vCenter,
|
||||
esxUtil_ParseQuery(xmlURIPtr uri, char **transport, char **vCenter,
|
||||
int *noVerify, int *autoAnswer)
|
||||
{
|
||||
int result = 0;
|
||||
@ -157,9 +157,9 @@ esxUtil_ParseQuery(virConnectPtr conn, char **transport, char **vCenter,
|
||||
}
|
||||
|
||||
#ifdef HAVE_XMLURI_QUERY_RAW
|
||||
queryParamSet = qparam_query_parse(conn->uri->query_raw);
|
||||
queryParamSet = qparam_query_parse(uri->query_raw);
|
||||
#else
|
||||
queryParamSet = qparam_query_parse(conn->uri->query);
|
||||
queryParamSet = qparam_query_parse(uri->query);
|
||||
#endif
|
||||
|
||||
if (queryParamSet == NULL) {
|
||||
@ -177,12 +177,12 @@ esxUtil_ParseQuery(virConnectPtr conn, char **transport, char **vCenter,
|
||||
*transport = strdup(queryParam->value);
|
||||
|
||||
if (*transport == NULL) {
|
||||
virReportOOMError(conn);
|
||||
virReportOOMError(NULL);
|
||||
goto failure;
|
||||
}
|
||||
|
||||
if (STRNEQ(*transport, "http") && STRNEQ(*transport, "https")) {
|
||||
ESX_ERROR(conn, VIR_ERR_INVALID_ARG,
|
||||
ESX_ERROR(VIR_ERR_INVALID_ARG,
|
||||
"Query parameter 'transport' has unexpected value "
|
||||
"'%s' (should be http|https)", *transport);
|
||||
goto failure;
|
||||
@ -195,7 +195,7 @@ esxUtil_ParseQuery(virConnectPtr conn, char **transport, char **vCenter,
|
||||
*vCenter = strdup(queryParam->value);
|
||||
|
||||
if (*vCenter == NULL) {
|
||||
virReportOOMError(conn);
|
||||
virReportOOMError(NULL);
|
||||
goto failure;
|
||||
}
|
||||
} else if (STRCASEEQ(queryParam->name, "no_verify")) {
|
||||
@ -205,7 +205,7 @@ esxUtil_ParseQuery(virConnectPtr conn, char **transport, char **vCenter,
|
||||
|
||||
if (virStrToLong_i(queryParam->value, NULL, 10, noVerify) < 0 ||
|
||||
(*noVerify != 0 && *noVerify != 1)) {
|
||||
ESX_ERROR(conn, VIR_ERR_INVALID_ARG,
|
||||
ESX_ERROR(VIR_ERR_INVALID_ARG,
|
||||
"Query parameter 'no_verify' has unexpected value "
|
||||
"'%s' (should be 0 or 1)", queryParam->value);
|
||||
goto failure;
|
||||
@ -217,7 +217,7 @@ esxUtil_ParseQuery(virConnectPtr conn, char **transport, char **vCenter,
|
||||
|
||||
if (virStrToLong_i(queryParam->value, NULL, 10, autoAnswer) < 0 ||
|
||||
(*autoAnswer != 0 && *autoAnswer != 1)) {
|
||||
ESX_ERROR(conn, VIR_ERR_INVALID_ARG,
|
||||
ESX_ERROR(VIR_ERR_INVALID_ARG,
|
||||
"Query parameter 'auto_answer' has unexpected value "
|
||||
"'%s' (should be 0 or 1)", queryParam->value);
|
||||
goto failure;
|
||||
@ -232,7 +232,7 @@ esxUtil_ParseQuery(virConnectPtr conn, char **transport, char **vCenter,
|
||||
*transport = strdup("https");
|
||||
|
||||
if (*transport == NULL) {
|
||||
virReportOOMError(conn);
|
||||
virReportOOMError(NULL);
|
||||
goto failure;
|
||||
}
|
||||
}
|
||||
@ -284,8 +284,7 @@ esxUtil_ParseVirtualMachineIDString(const char *id_string, int *id)
|
||||
|
||||
|
||||
int
|
||||
esxUtil_ParseDatastoreRelatedPath(virConnectPtr conn,
|
||||
const char *datastoreRelatedPath,
|
||||
esxUtil_ParseDatastoreRelatedPath(const char *datastoreRelatedPath,
|
||||
char **datastoreName,
|
||||
char **directoryName, char **fileName)
|
||||
{
|
||||
@ -296,7 +295,7 @@ esxUtil_ParseDatastoreRelatedPath(virConnectPtr conn,
|
||||
if (datastoreName == NULL || *datastoreName != NULL ||
|
||||
directoryName == NULL || *directoryName != NULL ||
|
||||
fileName == NULL || *fileName != NULL) {
|
||||
ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -316,7 +315,7 @@ esxUtil_ParseDatastoreRelatedPath(virConnectPtr conn,
|
||||
*/
|
||||
if (sscanf(datastoreRelatedPath, "[%a[^]%]] %a[^\n]", datastoreName,
|
||||
&directoryAndFileName) != 2) {
|
||||
ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
"Datastore related path '%s' doesn't have expected format "
|
||||
"'[<datastore>] <path>'", datastoreRelatedPath);
|
||||
goto failure;
|
||||
@ -332,7 +331,7 @@ esxUtil_ParseDatastoreRelatedPath(virConnectPtr conn,
|
||||
directoryAndFileName = NULL;
|
||||
|
||||
if (*separator == '\0') {
|
||||
ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
"Datastore related path '%s' doesn't reference a file",
|
||||
datastoreRelatedPath);
|
||||
goto failure;
|
||||
@ -341,7 +340,7 @@ esxUtil_ParseDatastoreRelatedPath(virConnectPtr conn,
|
||||
*fileName = strdup(separator);
|
||||
|
||||
if (*fileName == NULL) {
|
||||
virReportOOMError(conn);
|
||||
virReportOOMError(NULL);
|
||||
goto failure;
|
||||
}
|
||||
} else {
|
||||
@ -367,7 +366,7 @@ esxUtil_ParseDatastoreRelatedPath(virConnectPtr conn,
|
||||
|
||||
|
||||
int
|
||||
esxUtil_ResolveHostname(virConnectPtr conn, const char *hostname,
|
||||
esxUtil_ResolveHostname(const char *hostname,
|
||||
char *ipAddress, size_t ipAddress_length)
|
||||
{
|
||||
struct addrinfo hints;
|
||||
@ -384,14 +383,14 @@ esxUtil_ResolveHostname(virConnectPtr conn, const char *hostname,
|
||||
errcode = getaddrinfo(hostname, NULL, &hints, &result);
|
||||
|
||||
if (errcode != 0) {
|
||||
ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
"IP address lookup for host '%s' failed: %s", hostname,
|
||||
gai_strerror(errcode));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (result == NULL) {
|
||||
ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
"No IP address for host '%s' found: %s", hostname,
|
||||
gai_strerror(errcode));
|
||||
return -1;
|
||||
@ -401,7 +400,7 @@ esxUtil_ResolveHostname(virConnectPtr conn, const char *hostname,
|
||||
ipAddress_length, NULL, 0, NI_NUMERICHOST);
|
||||
|
||||
if (errcode != 0) {
|
||||
ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
"Formating IP address for host '%s' failed: %s", hostname,
|
||||
gai_strerror(errcode));
|
||||
freeaddrinfo(result);
|
||||
@ -416,8 +415,8 @@ esxUtil_ResolveHostname(virConnectPtr conn, const char *hostname,
|
||||
|
||||
|
||||
int
|
||||
esxUtil_GetConfigString(virConnectPtr conn, virConfPtr conf, const char *name,
|
||||
char **string, int optional)
|
||||
esxUtil_GetConfigString(virConfPtr conf, const char *name, char **string,
|
||||
int optional)
|
||||
{
|
||||
virConfValuePtr value;
|
||||
|
||||
@ -429,13 +428,13 @@ esxUtil_GetConfigString(virConnectPtr conn, virConfPtr conf, const char *name,
|
||||
return 0;
|
||||
}
|
||||
|
||||
ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
"Missing essential config entry '%s'", name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (value->type != VIR_CONF_STRING) {
|
||||
ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
"Config entry '%s' must be a string", name);
|
||||
return -1;
|
||||
}
|
||||
@ -445,7 +444,7 @@ esxUtil_GetConfigString(virConnectPtr conn, virConfPtr conf, const char *name,
|
||||
return 0;
|
||||
}
|
||||
|
||||
ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
"Missing essential config entry '%s'", name);
|
||||
return -1;
|
||||
}
|
||||
@ -453,7 +452,7 @@ esxUtil_GetConfigString(virConnectPtr conn, virConfPtr conf, const char *name,
|
||||
*string = strdup(value->str);
|
||||
|
||||
if (*string == NULL) {
|
||||
virReportOOMError(conn);
|
||||
virReportOOMError(NULL);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -463,8 +462,8 @@ esxUtil_GetConfigString(virConnectPtr conn, virConfPtr conf, const char *name,
|
||||
|
||||
|
||||
int
|
||||
esxUtil_GetConfigUUID(virConnectPtr conn, virConfPtr conf, const char *name,
|
||||
unsigned char *uuid, int optional)
|
||||
esxUtil_GetConfigUUID(virConfPtr conf, const char *name, unsigned char *uuid,
|
||||
int optional)
|
||||
{
|
||||
virConfValuePtr value;
|
||||
|
||||
@ -474,14 +473,14 @@ esxUtil_GetConfigUUID(virConnectPtr conn, virConfPtr conf, const char *name,
|
||||
if (optional) {
|
||||
return 0;
|
||||
} else {
|
||||
ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
"Missing essential config entry '%s'", name);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (value->type != VIR_CONF_STRING) {
|
||||
ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
"Config entry '%s' must be a string", name);
|
||||
return -1;
|
||||
}
|
||||
@ -490,14 +489,14 @@ esxUtil_GetConfigUUID(virConnectPtr conn, virConfPtr conf, const char *name,
|
||||
if (optional) {
|
||||
return 0;
|
||||
} else {
|
||||
ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
"Missing essential config entry '%s'", name);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (virUUIDParse(value->str, uuid) < 0) {
|
||||
ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
"Could not parse UUID from string '%s'", value->str);
|
||||
return -1;
|
||||
}
|
||||
@ -508,8 +507,8 @@ esxUtil_GetConfigUUID(virConnectPtr conn, virConfPtr conf, const char *name,
|
||||
|
||||
|
||||
int
|
||||
esxUtil_GetConfigLong(virConnectPtr conn, virConfPtr conf, const char *name,
|
||||
long long *number, long long default_, int optional)
|
||||
esxUtil_GetConfigLong(virConfPtr conf, const char *name, long long *number,
|
||||
long long default_, int optional)
|
||||
{
|
||||
virConfValuePtr value;
|
||||
|
||||
@ -520,7 +519,7 @@ esxUtil_GetConfigLong(virConnectPtr conn, virConfPtr conf, const char *name,
|
||||
if (optional) {
|
||||
return 0;
|
||||
} else {
|
||||
ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
"Missing essential config entry '%s'", name);
|
||||
return -1;
|
||||
}
|
||||
@ -531,7 +530,7 @@ esxUtil_GetConfigLong(virConnectPtr conn, virConfPtr conf, const char *name,
|
||||
if (optional) {
|
||||
return 0;
|
||||
} else {
|
||||
ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
"Missing essential config entry '%s'", name);
|
||||
return -1;
|
||||
}
|
||||
@ -540,13 +539,13 @@ esxUtil_GetConfigLong(virConnectPtr conn, virConfPtr conf, const char *name,
|
||||
if (STREQ(value->str, "unlimited")) {
|
||||
*number = -1;
|
||||
} else if (virStrToLong_ll(value->str, NULL, 10, number) < 0) {
|
||||
ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
"Config entry '%s' must represent an integer value",
|
||||
name);
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
"Config entry '%s' must be a string", name);
|
||||
return -1;
|
||||
}
|
||||
@ -557,9 +556,8 @@ esxUtil_GetConfigLong(virConnectPtr conn, virConfPtr conf, const char *name,
|
||||
|
||||
|
||||
int
|
||||
esxUtil_GetConfigBoolean(virConnectPtr conn, virConfPtr conf,
|
||||
const char *name, int *boolean_, int default_,
|
||||
int optional)
|
||||
esxUtil_GetConfigBoolean(virConfPtr conf, const char *name, int *boolean_,
|
||||
int default_, int optional)
|
||||
{
|
||||
virConfValuePtr value;
|
||||
|
||||
@ -570,7 +568,7 @@ esxUtil_GetConfigBoolean(virConnectPtr conn, virConfPtr conf,
|
||||
if (optional) {
|
||||
return 0;
|
||||
} else {
|
||||
ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
"Missing essential config entry '%s'", name);
|
||||
return -1;
|
||||
}
|
||||
@ -581,7 +579,7 @@ esxUtil_GetConfigBoolean(virConnectPtr conn, virConfPtr conf,
|
||||
if (optional) {
|
||||
return 0;
|
||||
} else {
|
||||
ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
"Missing essential config entry '%s'", name);
|
||||
return -1;
|
||||
}
|
||||
@ -592,13 +590,13 @@ esxUtil_GetConfigBoolean(virConnectPtr conn, virConfPtr conf,
|
||||
} else if (STRCASEEQ(value->str, "false")) {
|
||||
*boolean_ = 0;
|
||||
} else {
|
||||
ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
"Config entry '%s' must represent a boolean value "
|
||||
"(true|false)", name);
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
"Config entry '%s' must be a string", name);
|
||||
return -1;
|
||||
}
|
||||
|
@ -23,7 +23,7 @@
|
||||
#ifndef __ESX_UTIL_H__
|
||||
#define __ESX_UTIL_H__
|
||||
|
||||
#include <libxml/tree.h>
|
||||
#include <libxml/uri.h>
|
||||
|
||||
#include "internal.h"
|
||||
#include "conf.h"
|
||||
@ -35,30 +35,28 @@ char *esxUtil_RequestUsername(virConnectAuthPtr auth,
|
||||
char *esxUtil_RequestPassword(virConnectAuthPtr auth, const char *username,
|
||||
const char *hostname);
|
||||
|
||||
int esxUtil_ParseQuery(virConnectPtr conn, char **transport, char **vCenter,
|
||||
int esxUtil_ParseQuery(xmlURIPtr uri, char **transport, char **vCenter,
|
||||
int *noVerify, int *autoAnswer);
|
||||
|
||||
int esxUtil_ParseVirtualMachineIDString(const char *id_string, int *id);
|
||||
|
||||
int esxUtil_ParseDatastoreRelatedPath(virConnectPtr conn,
|
||||
const char *datastoreRelatedPath,
|
||||
int esxUtil_ParseDatastoreRelatedPath(const char *datastoreRelatedPath,
|
||||
char **datastoreName,
|
||||
char **directoryName, char **fileName);
|
||||
|
||||
int esxUtil_ResolveHostname(virConnectPtr conn, const char *hostname,
|
||||
int esxUtil_ResolveHostname(const char *hostname,
|
||||
char *ipAddress, size_t ipAddress_length);
|
||||
|
||||
int esxUtil_GetConfigString(virConnectPtr conn, virConfPtr conf,
|
||||
const char *name, char **string, int optional);
|
||||
int esxUtil_GetConfigString(virConfPtr conf, const char *name, char **string,
|
||||
int optional);
|
||||
|
||||
int esxUtil_GetConfigUUID(virConnectPtr conn, virConfPtr conf, const char *name,
|
||||
int esxUtil_GetConfigUUID(virConfPtr conf, const char *name,
|
||||
unsigned char *uuid, int optional);
|
||||
|
||||
int esxUtil_GetConfigLong(virConnectPtr conn, virConfPtr conf, const char *name,
|
||||
long long *number, long long default_, int optional);
|
||||
int esxUtil_GetConfigLong(virConfPtr conf, const char *name, long long *number,
|
||||
long long default_, int optional);
|
||||
|
||||
int esxUtil_GetConfigBoolean(virConnectPtr conn, virConfPtr conf,
|
||||
const char *name, int *boolean_, int default_,
|
||||
int optional);
|
||||
int esxUtil_GetConfigBoolean(virConfPtr conf, const char *name, int *boolean_,
|
||||
int default_, int optional);
|
||||
|
||||
#endif /* __ESX_UTIL_H__ */
|
||||
|
573
src/esx/esx_vi.c
573
src/esx/esx_vi.c
File diff suppressed because it is too large
Load Diff
123
src/esx/esx_vi.h
123
src/esx/esx_vi.h
@ -90,19 +90,18 @@ struct _esxVI_Context {
|
||||
esxVI_SelectionSpec *fullTraversalSpecList;
|
||||
};
|
||||
|
||||
int esxVI_Context_Alloc(virConnectPtr conn, esxVI_Context **ctx);
|
||||
int esxVI_Context_Alloc(esxVI_Context **ctx);
|
||||
void esxVI_Context_Free(esxVI_Context **ctx);
|
||||
int esxVI_Context_Connect(virConnectPtr conn, esxVI_Context *ctx,
|
||||
const char *ipAddress, const char *url,
|
||||
const char *username, const char *password,
|
||||
int noVerify);
|
||||
int esxVI_Context_DownloadFile(virConnectPtr conn, esxVI_Context *ctx,
|
||||
const char *url, char **content);
|
||||
int esxVI_Context_UploadFile(virConnectPtr conn, esxVI_Context *ctx,
|
||||
const char *url, const char *content);
|
||||
int esxVI_Context_Execute(virConnectPtr conn, esxVI_Context *ctx,
|
||||
const char *methodName, const char *request,
|
||||
esxVI_Response **response, esxVI_Occurrence occurrence);
|
||||
int esxVI_Context_Connect(esxVI_Context *ctx, const char *ipAddress,
|
||||
const char *url, const char *username,
|
||||
const char *password, int noVerify);
|
||||
int esxVI_Context_DownloadFile(esxVI_Context *ctx, const char *url,
|
||||
char **content);
|
||||
int esxVI_Context_UploadFile(esxVI_Context *ctx, const char *url,
|
||||
const char *content);
|
||||
int esxVI_Context_Execute(esxVI_Context *ctx, const char *methodName,
|
||||
const char *request, esxVI_Response **response,
|
||||
esxVI_Occurrence occurrence);
|
||||
|
||||
|
||||
|
||||
@ -117,7 +116,7 @@ struct _esxVI_Response {
|
||||
xmlNodePtr node; /* optional, list */
|
||||
};
|
||||
|
||||
int esxVI_Response_Alloc(virConnectPtr conn, esxVI_Response **response);
|
||||
int esxVI_Response_Alloc(esxVI_Response **response);
|
||||
void esxVI_Response_Free(esxVI_Response **response);
|
||||
|
||||
|
||||
@ -136,15 +135,12 @@ struct _esxVI_Enumeration {
|
||||
esxVI_EnumerationValue values[10];
|
||||
};
|
||||
|
||||
int esxVI_Enumeration_CastFromAnyType(virConnectPtr conn,
|
||||
const esxVI_Enumeration *enumeration,
|
||||
int esxVI_Enumeration_CastFromAnyType(const esxVI_Enumeration *enumeration,
|
||||
esxVI_AnyType *anyType, int *value);
|
||||
int esxVI_Enumeration_Serialize(virConnectPtr conn,
|
||||
const esxVI_Enumeration *enumeration,
|
||||
int esxVI_Enumeration_Serialize(const esxVI_Enumeration *enumeration,
|
||||
int value, const char *element,
|
||||
virBufferPtr output, esxVI_Boolean required);
|
||||
int esxVI_Enumeration_Deserialize(virConnectPtr conn,
|
||||
const esxVI_Enumeration *enumeration,
|
||||
int esxVI_Enumeration_Deserialize(const esxVI_Enumeration *enumeration,
|
||||
xmlNodePtr node, int *value);
|
||||
|
||||
|
||||
@ -158,33 +154,25 @@ struct _esxVI_List {
|
||||
};
|
||||
|
||||
typedef int (*esxVI_List_FreeFunc) (esxVI_List **item);
|
||||
typedef int (*esxVI_List_DeepCopyFunc) (virConnectPtr conn, esxVI_List **dest,
|
||||
esxVI_List *src);
|
||||
typedef int (*esxVI_List_CastFromAnyTypeFunc) (virConnectPtr conn,
|
||||
esxVI_AnyType *anyType,
|
||||
typedef int (*esxVI_List_DeepCopyFunc) (esxVI_List **dest, esxVI_List *src);
|
||||
typedef int (*esxVI_List_CastFromAnyTypeFunc) (esxVI_AnyType *anyType,
|
||||
esxVI_List **item);
|
||||
typedef int (*esxVI_List_SerializeFunc) (virConnectPtr conn, esxVI_List *item,
|
||||
const char *element,
|
||||
typedef int (*esxVI_List_SerializeFunc) (esxVI_List *item, const char *element,
|
||||
virBufferPtr output,
|
||||
esxVI_Boolean required);
|
||||
typedef int (*esxVI_List_DeserializeFunc) (virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_List **item);
|
||||
typedef int (*esxVI_List_DeserializeFunc) (xmlNodePtr node, esxVI_List **item);
|
||||
|
||||
int esxVI_List_Append(virConnectPtr conn, esxVI_List **list, esxVI_List *item);
|
||||
int esxVI_List_DeepCopy(virConnectPtr conn, esxVI_List **destList,
|
||||
esxVI_List *srcList,
|
||||
int esxVI_List_Append(esxVI_List **list, esxVI_List *item);
|
||||
int esxVI_List_DeepCopy(esxVI_List **destList, esxVI_List *srcList,
|
||||
esxVI_List_DeepCopyFunc deepCopyFunc,
|
||||
esxVI_List_FreeFunc freeFunc);
|
||||
int esxVI_List_CastFromAnyType(virConnectPtr conn, esxVI_AnyType *anyType,
|
||||
esxVI_List **list,
|
||||
int esxVI_List_CastFromAnyType(esxVI_AnyType *anyType, esxVI_List **list,
|
||||
esxVI_List_CastFromAnyTypeFunc castFromAnyTypeFunc,
|
||||
esxVI_List_FreeFunc freeFunc);
|
||||
int esxVI_List_Serialize(virConnectPtr conn, esxVI_List *list,
|
||||
const char *element, virBufferPtr output,
|
||||
esxVI_Boolean required,
|
||||
int esxVI_List_Serialize(esxVI_List *list, const char *element,
|
||||
virBufferPtr output, esxVI_Boolean required,
|
||||
esxVI_List_SerializeFunc serializeFunc);
|
||||
int esxVI_List_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_List **list,
|
||||
int esxVI_List_Deserialize(xmlNodePtr node, esxVI_List **list,
|
||||
esxVI_List_DeserializeFunc deserializeFunc,
|
||||
esxVI_List_FreeFunc freeFunc);
|
||||
|
||||
@ -198,22 +186,21 @@ int esxVI_List_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
* - 'get' functions get information from a local object
|
||||
*/
|
||||
|
||||
int esxVI_Alloc(virConnectPtr conn, void **ptrptr, size_t size);
|
||||
int esxVI_Alloc(void **ptrptr, size_t size);
|
||||
|
||||
int esxVI_CheckSerializationNecessity(virConnectPtr conn, const char *element,
|
||||
int esxVI_CheckSerializationNecessity(const char *element,
|
||||
esxVI_Boolean required);
|
||||
|
||||
int esxVI_BuildFullTraversalSpecItem
|
||||
(virConnectPtr conn, esxVI_SelectionSpec **fullTraversalSpecList,
|
||||
const char *name, const char *type, const char *path,
|
||||
const char *selectSetNames);
|
||||
(esxVI_SelectionSpec **fullTraversalSpecList, const char *name,
|
||||
const char *type, const char *path, const char *selectSetNames);
|
||||
|
||||
int esxVI_BuildFullTraversalSpecList
|
||||
(virConnectPtr conn, esxVI_SelectionSpec **fullTraversalSpecList);
|
||||
(esxVI_SelectionSpec **fullTraversalSpecList);
|
||||
|
||||
int esxVI_EnsureSession(virConnectPtr conn, esxVI_Context *ctx);
|
||||
int esxVI_EnsureSession(esxVI_Context *ctx);
|
||||
|
||||
int esxVI_LookupObjectContentByType(virConnectPtr conn, esxVI_Context *ctx,
|
||||
int esxVI_LookupObjectContentByType(esxVI_Context *ctx,
|
||||
esxVI_ManagedObjectReference *root,
|
||||
const char *type,
|
||||
esxVI_String *propertyNameList,
|
||||
@ -221,86 +208,80 @@ int esxVI_LookupObjectContentByType(virConnectPtr conn, esxVI_Context *ctx,
|
||||
esxVI_ObjectContent **objectContentList);
|
||||
|
||||
int esxVI_GetManagedEntityStatus
|
||||
(virConnectPtr conn, esxVI_ObjectContent *objectContent,
|
||||
const char *propertyName,
|
||||
(esxVI_ObjectContent *objectContent, const char *propertyName,
|
||||
esxVI_ManagedEntityStatus *managedEntityStatus);
|
||||
|
||||
int esxVI_GetVirtualMachinePowerState
|
||||
(virConnectPtr conn, esxVI_ObjectContent *virtualMachine,
|
||||
(esxVI_ObjectContent *virtualMachine,
|
||||
esxVI_VirtualMachinePowerState *powerState);
|
||||
|
||||
int esxVI_GetVirtualMachineQuestionInfo
|
||||
(virConnectPtr conn, esxVI_ObjectContent *virtualMachine,
|
||||
(esxVI_ObjectContent *virtualMachine,
|
||||
esxVI_VirtualMachineQuestionInfo **questionInfo);
|
||||
|
||||
int esxVI_LookupNumberOfDomainsByPowerState
|
||||
(virConnectPtr conn, esxVI_Context *ctx,
|
||||
esxVI_VirtualMachinePowerState powerState, esxVI_Boolean inverse);
|
||||
(esxVI_Context *ctx, esxVI_VirtualMachinePowerState powerState,
|
||||
esxVI_Boolean inverse);
|
||||
|
||||
int esxVI_GetVirtualMachineIdentity(virConnectPtr conn,
|
||||
esxVI_ObjectContent *virtualMachine,
|
||||
int esxVI_GetVirtualMachineIdentity(esxVI_ObjectContent *virtualMachine,
|
||||
int *id, char **name, unsigned char *uuid);
|
||||
|
||||
int esxVI_LookupResourcePoolByHostSystem
|
||||
(virConnectPtr conn, esxVI_Context *ctx, esxVI_ObjectContent *hostSystem,
|
||||
(esxVI_Context *ctx, esxVI_ObjectContent *hostSystem,
|
||||
esxVI_ManagedObjectReference **resourcePool);
|
||||
|
||||
int esxVI_LookupHostSystemByIp(virConnectPtr conn, esxVI_Context *ctx,
|
||||
const char *ipAddress,
|
||||
int esxVI_LookupHostSystemByIp(esxVI_Context *ctx, const char *ipAddress,
|
||||
esxVI_String *propertyNameList,
|
||||
esxVI_ObjectContent **hostSystem);
|
||||
|
||||
int esxVI_LookupVirtualMachineByUuid(virConnectPtr conn, esxVI_Context *ctx,
|
||||
int esxVI_LookupVirtualMachineByUuid(esxVI_Context *ctx,
|
||||
const unsigned char *uuid,
|
||||
esxVI_String *propertyNameList,
|
||||
esxVI_ObjectContent **virtualMachine,
|
||||
esxVI_Occurrence occurrence);
|
||||
|
||||
int esxVI_LookupVirtualMachineByUuidAndPrepareForTask
|
||||
(virConnectPtr conn, esxVI_Context *ctx, const unsigned char *uuid,
|
||||
(esxVI_Context *ctx, const unsigned char *uuid,
|
||||
esxVI_String *propertyNameList, esxVI_ObjectContent **virtualMachine,
|
||||
esxVI_Boolean autoAnswer);
|
||||
|
||||
int esxVI_LookupDatastoreByName(virConnectPtr conn, esxVI_Context *ctx,
|
||||
const char *name,
|
||||
int esxVI_LookupDatastoreByName(esxVI_Context *ctx, const char *name,
|
||||
esxVI_String *propertyNameList,
|
||||
esxVI_ObjectContent **datastore,
|
||||
esxVI_Occurrence occurrence);
|
||||
|
||||
int esxVI_LookupTaskInfoByTask(virConnectPtr conn, esxVI_Context *ctx,
|
||||
int esxVI_LookupTaskInfoByTask(esxVI_Context *ctx,
|
||||
esxVI_ManagedObjectReference *task,
|
||||
esxVI_TaskInfo **taskInfo);
|
||||
|
||||
int esxVI_LookupPendingTaskInfoListByVirtualMachine
|
||||
(virConnectPtr conn, esxVI_Context *ctx,
|
||||
esxVI_ObjectContent *virtualMachine,
|
||||
(esxVI_Context *ctx, esxVI_ObjectContent *virtualMachine,
|
||||
esxVI_TaskInfo **pendingTaskInfoList);
|
||||
|
||||
int esxVI_LookupAndHandleVirtualMachineQuestion(virConnectPtr conn,
|
||||
esxVI_Context *ctx,
|
||||
int esxVI_LookupAndHandleVirtualMachineQuestion(esxVI_Context *ctx,
|
||||
const unsigned char *uuid,
|
||||
esxVI_Boolean autoAnswer);
|
||||
|
||||
int esxVI_StartVirtualMachineTask(virConnectPtr conn, esxVI_Context *ctx,
|
||||
const char *name, const char *request,
|
||||
int esxVI_StartVirtualMachineTask(esxVI_Context *ctx, const char *name,
|
||||
const char *request,
|
||||
esxVI_ManagedObjectReference **task);
|
||||
|
||||
int esxVI_StartSimpleVirtualMachineTask
|
||||
(virConnectPtr conn, esxVI_Context *ctx, const char *name,
|
||||
(esxVI_Context *ctx, const char *name,
|
||||
esxVI_ManagedObjectReference *virtualMachine,
|
||||
esxVI_ManagedObjectReference **task);
|
||||
|
||||
int esxVI_SimpleVirtualMachineMethod
|
||||
(virConnectPtr conn, esxVI_Context *ctx, const char *name,
|
||||
(esxVI_Context *ctx, const char *name,
|
||||
esxVI_ManagedObjectReference *virtualMachine);
|
||||
|
||||
int esxVI_HandleVirtualMachineQuestion
|
||||
(virConnectPtr conn, esxVI_Context *ctx,
|
||||
(esxVI_Context *ctx,
|
||||
esxVI_ManagedObjectReference *virtualMachine,
|
||||
esxVI_VirtualMachineQuestionInfo *questionInfo,
|
||||
esxVI_Boolean autoAnswer);
|
||||
|
||||
int esxVI_WaitForTaskCompletion(virConnectPtr conn, esxVI_Context *ctx,
|
||||
int esxVI_WaitForTaskCompletion(esxVI_Context *ctx,
|
||||
esxVI_ManagedObjectReference *task,
|
||||
const unsigned char *virtualMachineUuid,
|
||||
esxVI_Boolean autoAnswer,
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -32,47 +32,45 @@
|
||||
* VI Methods
|
||||
*/
|
||||
|
||||
int esxVI_RetrieveServiceContent(virConnectPtr conn, esxVI_Context *ctx,
|
||||
int esxVI_RetrieveServiceContent(esxVI_Context *ctx,
|
||||
esxVI_ServiceContent **serviceContent);
|
||||
|
||||
int esxVI_Login(virConnectPtr conn, esxVI_Context *ctx,
|
||||
const char *userName, const char *password,
|
||||
int esxVI_Login(esxVI_Context *ctx, const char *userName, const char *password,
|
||||
esxVI_UserSession **userSession);
|
||||
|
||||
int esxVI_Logout(virConnectPtr conn, esxVI_Context *ctx);
|
||||
int esxVI_Logout(esxVI_Context *ctx);
|
||||
|
||||
int esxVI_SessionIsActive(virConnectPtr conn, esxVI_Context *ctx,
|
||||
const char *sessionID, const char *userName,
|
||||
esxVI_Boolean *active);
|
||||
int esxVI_SessionIsActive(esxVI_Context *ctx, const char *sessionID,
|
||||
const char *userName, esxVI_Boolean *active);
|
||||
|
||||
int esxVI_RetrieveProperties(virConnectPtr conn, esxVI_Context *ctx,
|
||||
int esxVI_RetrieveProperties(esxVI_Context *ctx,
|
||||
esxVI_PropertyFilterSpec *propertyFilterSpecList,
|
||||
esxVI_ObjectContent **objectContentList);
|
||||
|
||||
int esxVI_PowerOnVM_Task(virConnectPtr conn, esxVI_Context *ctx,
|
||||
int esxVI_PowerOnVM_Task(esxVI_Context *ctx,
|
||||
esxVI_ManagedObjectReference *virtualMachine,
|
||||
esxVI_ManagedObjectReference **task);
|
||||
|
||||
int esxVI_PowerOffVM_Task(virConnectPtr conn, esxVI_Context *ctx,
|
||||
int esxVI_PowerOffVM_Task(esxVI_Context *ctx,
|
||||
esxVI_ManagedObjectReference *virtualMachine,
|
||||
esxVI_ManagedObjectReference **task);
|
||||
|
||||
int esxVI_SuspendVM_Task(virConnectPtr conn, esxVI_Context *ctx,
|
||||
int esxVI_SuspendVM_Task(esxVI_Context *ctx,
|
||||
esxVI_ManagedObjectReference *virtualMachine,
|
||||
esxVI_ManagedObjectReference **task);
|
||||
|
||||
int esxVI_MigrateVM_Task(virConnectPtr conn, esxVI_Context *ctx,
|
||||
int esxVI_MigrateVM_Task(esxVI_Context *ctx,
|
||||
esxVI_ManagedObjectReference *virtualMachine,
|
||||
esxVI_ManagedObjectReference *resourcePool,
|
||||
esxVI_ManagedObjectReference *hostSystem,
|
||||
esxVI_ManagedObjectReference **task);
|
||||
|
||||
int esxVI_ReconfigVM_Task(virConnectPtr conn, esxVI_Context *ctx,
|
||||
int esxVI_ReconfigVM_Task(esxVI_Context *ctx,
|
||||
esxVI_ManagedObjectReference *virtualMachine,
|
||||
esxVI_VirtualMachineConfigSpec *spec,
|
||||
esxVI_ManagedObjectReference **task);
|
||||
|
||||
int esxVI_RegisterVM_Task(virConnectPtr conn, esxVI_Context *ctx,
|
||||
int esxVI_RegisterVM_Task(esxVI_Context *ctx,
|
||||
esxVI_ManagedObjectReference *folder,
|
||||
const char *path, const char *name,
|
||||
esxVI_Boolean asTemplate,
|
||||
@ -80,34 +78,33 @@ int esxVI_RegisterVM_Task(virConnectPtr conn, esxVI_Context *ctx,
|
||||
esxVI_ManagedObjectReference *hostSystem,
|
||||
esxVI_ManagedObjectReference **task);
|
||||
|
||||
int esxVI_CancelTask(virConnectPtr conn, esxVI_Context *ctx,
|
||||
esxVI_ManagedObjectReference *task);
|
||||
int esxVI_CancelTask(esxVI_Context *ctx, esxVI_ManagedObjectReference *task);
|
||||
|
||||
int esxVI_UnregisterVM(virConnectPtr conn, esxVI_Context *ctx,
|
||||
int esxVI_UnregisterVM(esxVI_Context *ctx,
|
||||
esxVI_ManagedObjectReference *virtualMachine);
|
||||
|
||||
int esxVI_AnswerVM(virConnectPtr conn, esxVI_Context *ctx,
|
||||
int esxVI_AnswerVM(esxVI_Context *ctx,
|
||||
esxVI_ManagedObjectReference *virtualMachine,
|
||||
const char *questionId, const char *answerChoice);
|
||||
|
||||
int esxVI_CreateFilter(virConnectPtr conn, esxVI_Context *ctx,
|
||||
int esxVI_CreateFilter(esxVI_Context *ctx,
|
||||
esxVI_PropertyFilterSpec *propertyFilterSpec,
|
||||
esxVI_Boolean partialUpdates,
|
||||
esxVI_ManagedObjectReference **propertyFilter);
|
||||
|
||||
int esxVI_DestroyPropertyFilter(virConnectPtr conn, esxVI_Context *ctx,
|
||||
int esxVI_DestroyPropertyFilter(esxVI_Context *ctx,
|
||||
esxVI_ManagedObjectReference *propertyFilter);
|
||||
|
||||
int esxVI_WaitForUpdates(virConnectPtr conn, esxVI_Context *ctx,
|
||||
const char *version, esxVI_UpdateSet **updateSet);
|
||||
int esxVI_WaitForUpdates(esxVI_Context *ctx, const char *version,
|
||||
esxVI_UpdateSet **updateSet);
|
||||
|
||||
int esxVI_RebootGuest(virConnectPtr conn, esxVI_Context *ctx,
|
||||
int esxVI_RebootGuest(esxVI_Context *ctx,
|
||||
esxVI_ManagedObjectReference *virtualMachine);
|
||||
|
||||
int esxVI_ShutdownGuest(virConnectPtr conn, esxVI_Context *ctx,
|
||||
int esxVI_ShutdownGuest(esxVI_Context *ctx,
|
||||
esxVI_ManagedObjectReference *virtualMachine);
|
||||
|
||||
int esxVI_ValidateMigration(virConnectPtr conn, esxVI_Context *ctx,
|
||||
int esxVI_ValidateMigration(esxVI_Context *ctx,
|
||||
esxVI_ManagedObjectReference *virtualMachineList,
|
||||
esxVI_VirtualMachinePowerState powerState,
|
||||
esxVI_String *testTypeList, // FIXME: see ValidateMigrationTestType
|
||||
@ -115,29 +112,26 @@ int esxVI_ValidateMigration(virConnectPtr conn, esxVI_Context *ctx,
|
||||
esxVI_ManagedObjectReference *hostSystem,
|
||||
esxVI_Event **eventList);
|
||||
|
||||
int esxVI_FindByIp(virConnectPtr conn, esxVI_Context *ctx,
|
||||
esxVI_ManagedObjectReference *datacenter,
|
||||
int esxVI_FindByIp(esxVI_Context *ctx, esxVI_ManagedObjectReference *datacenter,
|
||||
const char *ip, esxVI_Boolean vmSearch,
|
||||
esxVI_ManagedObjectReference **managedObjectReference);
|
||||
|
||||
int esxVI_FindByUuid(virConnectPtr conn, esxVI_Context *ctx,
|
||||
int esxVI_FindByUuid(esxVI_Context *ctx,
|
||||
esxVI_ManagedObjectReference *datacenter,
|
||||
const unsigned char *uuid, esxVI_Boolean vmSearch,
|
||||
esxVI_ManagedObjectReference **managedObjectReference);
|
||||
|
||||
int esxVI_QueryAvailablePerfMetric(virConnectPtr conn, esxVI_Context *ctx,
|
||||
int esxVI_QueryAvailablePerfMetric(esxVI_Context *ctx,
|
||||
esxVI_ManagedObjectReference *entity,
|
||||
esxVI_DateTime *beginTime,
|
||||
esxVI_DateTime *endTime,
|
||||
esxVI_Int *intervalId,
|
||||
esxVI_PerfMetricId **perfMetricIdList);
|
||||
|
||||
int esxVI_QueryPerfCounter(virConnectPtr conn, esxVI_Context *ctx,
|
||||
esxVI_Int *counterIdList,
|
||||
int esxVI_QueryPerfCounter(esxVI_Context *ctx, esxVI_Int *counterIdList,
|
||||
esxVI_PerfCounterInfo **perfCounterInfoList);
|
||||
|
||||
int esxVI_QueryPerf(virConnectPtr conn, esxVI_Context *ctx,
|
||||
esxVI_PerfQuerySpec *querySpecList,
|
||||
int esxVI_QueryPerf(esxVI_Context *ctx, esxVI_PerfQuerySpec *querySpecList,
|
||||
esxVI_PerfEntityMetric **perfEntityMetricList);
|
||||
|
||||
#endif /* __ESX_VI_METHODS_H__ */
|
||||
|
@ -37,8 +37,8 @@
|
||||
|
||||
#define VIR_FROM_THIS VIR_FROM_ESX
|
||||
|
||||
#define ESX_VI_ERROR(conn, code, fmt...) \
|
||||
virReportErrorHelper(conn, VIR_FROM_ESX, code, __FILE__, __FUNCTION__, \
|
||||
#define ESX_VI_ERROR(code, fmt...) \
|
||||
virReportErrorHelper(NULL, VIR_FROM_ESX, code, __FILE__, __FUNCTION__, \
|
||||
__LINE__, fmt)
|
||||
|
||||
|
||||
@ -65,9 +65,9 @@
|
||||
|
||||
#define ESX_VI__TEMPLATE__ALLOC(_type) \
|
||||
int \
|
||||
esxVI_##_type##_Alloc(virConnectPtr conn, esxVI_##_type **ptrptr) \
|
||||
esxVI_##_type##_Alloc(esxVI_##_type **ptrptr) \
|
||||
{ \
|
||||
return esxVI_Alloc(conn, (void **)ptrptr, sizeof(esxVI_##_type)); \
|
||||
return esxVI_Alloc((void **)ptrptr, sizeof(esxVI_##_type)); \
|
||||
}
|
||||
|
||||
|
||||
@ -93,23 +93,20 @@
|
||||
|
||||
#define ESX_VI__TEMPLATE__LIST__APPEND(_type) \
|
||||
int \
|
||||
esxVI_##_type##_AppendToList(virConnectPtr conn, esxVI_##_type **list, \
|
||||
esxVI_##_type *item) \
|
||||
esxVI_##_type##_AppendToList(esxVI_##_type **list, esxVI_##_type *item) \
|
||||
{ \
|
||||
return esxVI_List_Append(conn, (esxVI_List **)list, \
|
||||
(esxVI_List *)item); \
|
||||
return esxVI_List_Append((esxVI_List **)list, (esxVI_List *)item); \
|
||||
}
|
||||
|
||||
|
||||
|
||||
#define ESX_VI__TEMPLATE__LIST__DEEP_COPY(_type) \
|
||||
int \
|
||||
esxVI_##_type##_DeepCopyList(virConnectPtr conn, \
|
||||
esxVI_##_type **destList, \
|
||||
esxVI_##_type##_DeepCopyList(esxVI_##_type **destList, \
|
||||
esxVI_##_type *srcList) \
|
||||
{ \
|
||||
return esxVI_List_DeepCopy \
|
||||
(conn, (esxVI_List **)destList, (esxVI_List *)srcList, \
|
||||
((esxVI_List **)destList, (esxVI_List *)srcList, \
|
||||
(esxVI_List_DeepCopyFunc)esxVI_##_type##_DeepCopy, \
|
||||
(esxVI_List_FreeFunc)esxVI_##_type##_Free); \
|
||||
}
|
||||
@ -118,12 +115,11 @@
|
||||
|
||||
#define ESX_VI__TEMPLATE__LIST__CAST_FROM_ANY_TYPE(_type) \
|
||||
int \
|
||||
esxVI_##_type##_CastListFromAnyType(virConnectPtr conn, \
|
||||
esxVI_AnyType *anyType, \
|
||||
esxVI_##_type##_CastListFromAnyType(esxVI_AnyType *anyType, \
|
||||
esxVI_##_type **list) \
|
||||
{ \
|
||||
return esxVI_List_CastFromAnyType \
|
||||
(conn, anyType, (esxVI_List **)list, \
|
||||
(anyType, (esxVI_List **)list, \
|
||||
(esxVI_List_CastFromAnyTypeFunc) \
|
||||
esxVI_##_type##_CastFromAnyType, \
|
||||
(esxVI_List_FreeFunc)esxVI_##_type##_Free); \
|
||||
@ -133,12 +129,12 @@
|
||||
|
||||
#define ESX_VI__TEMPLATE__LIST__SERIALIZE(_type) \
|
||||
int \
|
||||
esxVI_##_type##_SerializeList(virConnectPtr conn, esxVI_##_type *list, \
|
||||
const char *element, virBufferPtr output, \
|
||||
esxVI_##_type##_SerializeList(esxVI_##_type *list, const char *element, \
|
||||
virBufferPtr output, \
|
||||
esxVI_Boolean required) \
|
||||
{ \
|
||||
return esxVI_List_Serialize(conn, (esxVI_List *)list, \
|
||||
element, output, required, \
|
||||
return esxVI_List_Serialize((esxVI_List *)list, element, \
|
||||
output, required, \
|
||||
(esxVI_List_SerializeFunc) \
|
||||
esxVI_##_type##_Serialize); \
|
||||
}
|
||||
@ -147,11 +143,10 @@
|
||||
|
||||
#define ESX_VI__TEMPLATE__LIST__DESERIALIZE(_type) \
|
||||
int \
|
||||
esxVI_##_type##_DeserializeList(virConnectPtr conn, xmlNodePtr node, \
|
||||
esxVI_##_type **list) \
|
||||
esxVI_##_type##_DeserializeList(xmlNodePtr node, esxVI_##_type **list) \
|
||||
{ \
|
||||
return esxVI_List_Deserialize \
|
||||
(conn, node, (esxVI_List **)list, \
|
||||
(node, (esxVI_List **)list, \
|
||||
(esxVI_List_DeserializeFunc)esxVI_##_type##_Deserialize, \
|
||||
(esxVI_List_FreeFunc)esxVI_##_type##_Free); \
|
||||
}
|
||||
@ -160,42 +155,39 @@
|
||||
|
||||
#define ESX_VI__TEMPLATE__CAST_FROM_ANY_TYPE(_type) \
|
||||
int \
|
||||
esxVI_##_type##_CastFromAnyType(virConnectPtr conn, \
|
||||
esxVI_AnyType *anyType, \
|
||||
esxVI_##_type##_CastFromAnyType(esxVI_AnyType *anyType, \
|
||||
esxVI_##_type **ptrptr) \
|
||||
{ \
|
||||
if (anyType == NULL || ptrptr == NULL || *ptrptr != NULL) { \
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR, "Invalid argument"); \
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument"); \
|
||||
return -1; \
|
||||
} \
|
||||
\
|
||||
if (STRNEQ(anyType->other, #_type)) { \
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR, \
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
|
||||
"Expecting type '%s' but found '%s'", \
|
||||
#_type, anyType->other); \
|
||||
return -1; \
|
||||
} \
|
||||
\
|
||||
return esxVI_##_type##_Deserialize(conn, anyType->_node, ptrptr); \
|
||||
return esxVI_##_type##_Deserialize(anyType->_node, ptrptr); \
|
||||
}
|
||||
|
||||
|
||||
|
||||
#define ESX_VI__TEMPLATE__SERIALIZE_EXTRA(_type, _type_string, _serialize) \
|
||||
int \
|
||||
esxVI_##_type##_Serialize(virConnectPtr conn, \
|
||||
esxVI_##_type *item, \
|
||||
esxVI_##_type##_Serialize(esxVI_##_type *item, \
|
||||
const char *element, virBufferPtr output, \
|
||||
esxVI_Boolean required) \
|
||||
{ \
|
||||
if (element == NULL || output == NULL ) { \
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR, "Invalid argument"); \
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument"); \
|
||||
return -1; \
|
||||
} \
|
||||
\
|
||||
if (item == NULL) { \
|
||||
return esxVI_CheckSerializationNecessity(conn, element, \
|
||||
required); \
|
||||
return esxVI_CheckSerializationNecessity(element, required); \
|
||||
} \
|
||||
\
|
||||
ESV_VI__XML_TAG__OPEN(output, element, _type_string); \
|
||||
@ -216,24 +208,23 @@
|
||||
|
||||
#define ESX_VI__TEMPLATE__DESERIALIZE(_type, _deserialize, _require) \
|
||||
int \
|
||||
esxVI_##_type##_Deserialize(virConnectPtr conn, xmlNodePtr node, \
|
||||
esxVI_##_type **ptrptr) \
|
||||
esxVI_##_type##_Deserialize(xmlNodePtr node, esxVI_##_type **ptrptr) \
|
||||
{ \
|
||||
xmlNodePtr childNode = NULL; \
|
||||
\
|
||||
if (ptrptr == NULL || *ptrptr != NULL) { \
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR, "Invalid argument"); \
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument"); \
|
||||
return -1; \
|
||||
} \
|
||||
\
|
||||
if (esxVI_##_type##_Alloc(conn, ptrptr) < 0) { \
|
||||
if (esxVI_##_type##_Alloc(ptrptr) < 0) { \
|
||||
return -1; \
|
||||
} \
|
||||
\
|
||||
for (childNode = node->children; childNode != NULL; \
|
||||
childNode = childNode->next) { \
|
||||
if (childNode->type != XML_ELEMENT_NODE) { \
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR, \
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
|
||||
"Wrong XML element type %d", childNode->type); \
|
||||
goto failure; \
|
||||
} \
|
||||
@ -257,39 +248,38 @@
|
||||
|
||||
#define ESX_VI__TEMPLATE__DESERIALIZE_NUMBER(_type, _xsdType, _min, _max) \
|
||||
int \
|
||||
esxVI_##_type##_Deserialize(virConnectPtr conn, xmlNodePtr node, \
|
||||
esxVI_##_type **number) \
|
||||
esxVI_##_type##_Deserialize(xmlNodePtr node, esxVI_##_type **number) \
|
||||
{ \
|
||||
int result = 0; \
|
||||
char *string; \
|
||||
long long value; \
|
||||
\
|
||||
if (number == NULL || *number != NULL) { \
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR, "Invalid argument"); \
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument"); \
|
||||
return -1; \
|
||||
} \
|
||||
\
|
||||
if (esxVI_##_type##_Alloc(conn, number) < 0) { \
|
||||
if (esxVI_##_type##_Alloc(number) < 0) { \
|
||||
return -1; \
|
||||
} \
|
||||
\
|
||||
string = (char *)xmlNodeListGetString(node->doc, node->children, 1); \
|
||||
\
|
||||
if (string == NULL) { \
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR, \
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
|
||||
"XML node doesn't contain text, expecting an " \
|
||||
_xsdType" value"); \
|
||||
goto failure; \
|
||||
} \
|
||||
\
|
||||
if (virStrToLong_ll(string, NULL, 10, &value) < 0) { \
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR, \
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
|
||||
"Unknown value '%s' for "_xsdType, string); \
|
||||
goto failure; \
|
||||
} \
|
||||
\
|
||||
if (value < (_min) || value > (_max)) { \
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR, \
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
|
||||
"Value '%s' is not representable as "_xsdType, \
|
||||
(const char *)string); \
|
||||
goto failure; \
|
||||
@ -313,7 +303,7 @@
|
||||
|
||||
|
||||
#define ESX_VI__TEMPLATE__PROPERTY__SERIALIZE(_type, _name, _required) \
|
||||
if (esxVI_##_type##_Serialize(conn, item->_name, #_name, output, \
|
||||
if (esxVI_##_type##_Serialize(item->_name, #_name, output, \
|
||||
esxVI_Boolean_##_required) < 0) { \
|
||||
return -1; \
|
||||
}
|
||||
@ -321,7 +311,7 @@
|
||||
|
||||
|
||||
#define ESX_VI__TEMPLATE__PROPERTY__SERIALIZE_VALUE(_type, _name, _required) \
|
||||
if (esxVI_##_type##_SerializeValue(conn, item->_name, #_name, output, \
|
||||
if (esxVI_##_type##_SerializeValue(item->_name, #_name, output, \
|
||||
esxVI_Boolean_##_required) < 0) { \
|
||||
return -1; \
|
||||
}
|
||||
@ -329,7 +319,7 @@
|
||||
|
||||
|
||||
#define ESX_VI__TEMPLATE__PROPERTY__SERIALIZE_LIST(_type, _name, _required) \
|
||||
if (esxVI_##_type##_SerializeList(conn, item->_name, #_name, output, \
|
||||
if (esxVI_##_type##_SerializeList(item->_name, #_name, output, \
|
||||
esxVI_Boolean_##_required) < 0) { \
|
||||
return -1; \
|
||||
}
|
||||
@ -338,8 +328,7 @@
|
||||
|
||||
#define ESX_VI__TEMPLATE__PROPERTY__DESERIALIZE(_type, _name) \
|
||||
if (xmlStrEqual(childNode->name, BAD_CAST #_name)) { \
|
||||
if (esxVI_##_type##_Deserialize(conn, childNode, \
|
||||
&(*ptrptr)->_name) < 0) { \
|
||||
if (esxVI_##_type##_Deserialize(childNode, &(*ptrptr)->_name) < 0) { \
|
||||
goto failure; \
|
||||
} \
|
||||
\
|
||||
@ -350,7 +339,7 @@
|
||||
|
||||
#define ESX_VI__TEMPLATE__PROPERTY__DESERIALIZE_VALUE(_type, _name) \
|
||||
if (xmlStrEqual(childNode->name, BAD_CAST #_name)) { \
|
||||
if (esxVI_##_type##_DeserializeValue(conn, childNode, \
|
||||
if (esxVI_##_type##_DeserializeValue(childNode, \
|
||||
&(*ptrptr)->_name) < 0) { \
|
||||
goto failure; \
|
||||
} \
|
||||
@ -363,7 +352,7 @@
|
||||
#define ESX_VI__TEMPLATE__PROPERTY__DESERIALIZE_EXPECTED(_type, _expected, \
|
||||
_name) \
|
||||
if (xmlStrEqual(childNode->name, BAD_CAST #_name)) { \
|
||||
if (esxVI_##_type##_Deserialize(conn, childNode, &(*ptrptr)->_name, \
|
||||
if (esxVI_##_type##_Deserialize(childNode, &(*ptrptr)->_name, \
|
||||
_expected) < 0) { \
|
||||
goto failure; \
|
||||
} \
|
||||
@ -384,11 +373,11 @@
|
||||
if (xmlStrEqual(childNode->name, BAD_CAST #_name)) { \
|
||||
esxVI_##_type *_name##Item = NULL; \
|
||||
\
|
||||
if (esxVI_##_type##_Deserialize(conn, childNode, &_name##Item) < 0) { \
|
||||
if (esxVI_##_type##_Deserialize(childNode, &_name##Item) < 0) { \
|
||||
goto failure; \
|
||||
} \
|
||||
\
|
||||
if (esxVI_##_type##_AppendToList(conn, &(*ptrptr)->_name, \
|
||||
if (esxVI_##_type##_AppendToList(&(*ptrptr)->_name, \
|
||||
_name##Item) < 0) { \
|
||||
esxVI_##_type##_Free(&_name##Item); \
|
||||
goto failure; \
|
||||
@ -405,7 +394,7 @@
|
||||
*/
|
||||
#define ESX_VI__TEMPLATE__PROPERTY__REQUIRED(_name) \
|
||||
if ((*ptrptr)->_name == 0) { \
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR, \
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
|
||||
"Missing required '%s' property", #_name); \
|
||||
goto failure; \
|
||||
}
|
||||
@ -414,38 +403,31 @@
|
||||
|
||||
#define ESX_VI__TEMPLATE__ENUMERATION__CAST_FROM_ANY_TYPE(_type) \
|
||||
int \
|
||||
esxVI_##_type##_CastFromAnyType(virConnectPtr conn, \
|
||||
esxVI_AnyType *anyType, \
|
||||
esxVI_##_type##_CastFromAnyType(esxVI_AnyType *anyType, \
|
||||
esxVI_##_type *value) \
|
||||
{ \
|
||||
return esxVI_Enumeration_CastFromAnyType \
|
||||
(conn, &_esxVI_##_type##_Enumeration, anyType, \
|
||||
(int *)value); \
|
||||
(&_esxVI_##_type##_Enumeration, anyType, (int *)value); \
|
||||
}
|
||||
|
||||
|
||||
|
||||
#define ESX_VI__TEMPLATE__ENUMERATION__SERIALIZE(_type) \
|
||||
int \
|
||||
esxVI_##_type##_Serialize(virConnectPtr conn, esxVI_##_type value, \
|
||||
const char *element, virBufferPtr output, \
|
||||
esxVI_Boolean required) \
|
||||
esxVI_##_type##_Serialize(esxVI_##_type value, const char *element, \
|
||||
virBufferPtr output, esxVI_Boolean required) \
|
||||
{ \
|
||||
return esxVI_Enumeration_Serialize(conn, \
|
||||
&_esxVI_##_type##_Enumeration, \
|
||||
value, element, output, \
|
||||
required); \
|
||||
return esxVI_Enumeration_Serialize(&_esxVI_##_type##_Enumeration, \
|
||||
value, element, output, required); \
|
||||
}
|
||||
|
||||
|
||||
|
||||
#define ESX_VI__TEMPLATE__ENUMERATION__DESERIALIZE(_type) \
|
||||
int \
|
||||
esxVI_##_type##_Deserialize(virConnectPtr conn, xmlNodePtr node, \
|
||||
esxVI_##_type *value) \
|
||||
esxVI_##_type##_Deserialize(xmlNodePtr node, esxVI_##_type *value) \
|
||||
{ \
|
||||
return esxVI_Enumeration_Deserialize(conn, \
|
||||
&_esxVI_##_type##_Enumeration, \
|
||||
return esxVI_Enumeration_Deserialize(&_esxVI_##_type##_Enumeration, \
|
||||
node, (int *)value); \
|
||||
}
|
||||
|
||||
@ -523,11 +505,10 @@ ESX_VI__TEMPLATE__FREE(AnyType,
|
||||
});
|
||||
|
||||
int
|
||||
esxVI_AnyType_ExpectType(virConnectPtr conn, esxVI_AnyType *anyType,
|
||||
esxVI_Type type)
|
||||
esxVI_AnyType_ExpectType(esxVI_AnyType *anyType, esxVI_Type type)
|
||||
{
|
||||
if (anyType->type != type) {
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
"Expecting type '%s' but found '%s'",
|
||||
esxVI_Type_Name(type),
|
||||
anyType->type != esxVI_Type_Other
|
||||
@ -540,11 +521,10 @@ esxVI_AnyType_ExpectType(virConnectPtr conn, esxVI_AnyType *anyType,
|
||||
}
|
||||
|
||||
int
|
||||
esxVI_AnyType_DeepCopy(virConnectPtr conn, esxVI_AnyType **dest,
|
||||
esxVI_AnyType *src)
|
||||
esxVI_AnyType_DeepCopy(esxVI_AnyType **dest, esxVI_AnyType *src)
|
||||
{
|
||||
if (dest == NULL || *dest != NULL) {
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -552,22 +532,21 @@ esxVI_AnyType_DeepCopy(virConnectPtr conn, esxVI_AnyType **dest,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (esxVI_AnyType_Alloc(conn, dest) < 0) {
|
||||
if (esxVI_AnyType_Alloc(dest) < 0) {
|
||||
goto failure;
|
||||
}
|
||||
|
||||
(*dest)->_node = xmlCopyNode(src->_node, 1);
|
||||
|
||||
if ((*dest)->_node == NULL) {
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
"Could not copy an XML node");
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Could not copy an XML node");
|
||||
goto failure;
|
||||
}
|
||||
|
||||
(*dest)->type = src->type;
|
||||
|
||||
if (esxVI_String_DeepCopyValue(conn, &(*dest)->other, src->other) < 0 ||
|
||||
esxVI_String_DeepCopyValue(conn, &(*dest)->value, src->value) < 0) {
|
||||
if (esxVI_String_DeepCopyValue(&(*dest)->other, src->other) < 0 ||
|
||||
esxVI_String_DeepCopyValue(&(*dest)->value, src->value) < 0) {
|
||||
goto failure;
|
||||
}
|
||||
|
||||
@ -605,25 +584,23 @@ esxVI_AnyType_DeepCopy(virConnectPtr conn, esxVI_AnyType **dest,
|
||||
}
|
||||
|
||||
int
|
||||
esxVI_AnyType_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_AnyType **anyType)
|
||||
esxVI_AnyType_Deserialize(xmlNodePtr node, esxVI_AnyType **anyType)
|
||||
{
|
||||
long long number;
|
||||
|
||||
if (anyType == NULL || *anyType != NULL) {
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (esxVI_AnyType_Alloc(conn, anyType) < 0) {
|
||||
if (esxVI_AnyType_Alloc(anyType) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
(*anyType)->_node = xmlCopyNode(node, 1);
|
||||
|
||||
if ((*anyType)->_node == NULL) {
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
"Could not copy an XML node");
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Could not copy an XML node");
|
||||
goto failure;
|
||||
}
|
||||
|
||||
@ -633,7 +610,7 @@ esxVI_AnyType_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
BAD_CAST "http://www.w3.org/2001/XMLSchema-instance");
|
||||
|
||||
if ((*anyType)->other == NULL) {
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
"AnyType is missing 'type' property");
|
||||
goto failure;
|
||||
}
|
||||
@ -645,7 +622,7 @@ esxVI_AnyType_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
(*anyType)->value = strdup("");
|
||||
|
||||
if ((*anyType)->value == NULL) {
|
||||
virReportOOMError(conn);
|
||||
virReportOOMError(NULL);
|
||||
goto failure;
|
||||
}
|
||||
}
|
||||
@ -653,14 +630,14 @@ esxVI_AnyType_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
#define _DESERIALIZE_NUMBER(_type, _xsdType, _name, _min, _max) \
|
||||
do { \
|
||||
if (virStrToLong_ll((*anyType)->value, NULL, 10, &number) < 0) { \
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR, \
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
|
||||
"Unknown value '%s' for "_xsdType, \
|
||||
(*anyType)->value); \
|
||||
goto failure; \
|
||||
} \
|
||||
\
|
||||
if (number < (_min) || number > (_max)) { \
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR, \
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
|
||||
"Value '%s' is out of "_xsdType" range", \
|
||||
(*anyType)->value); \
|
||||
goto failure; \
|
||||
@ -678,7 +655,7 @@ esxVI_AnyType_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
} else if (STREQ((*anyType)->value, "false")) {
|
||||
(*anyType)->boolean = esxVI_Boolean_False;
|
||||
} else {
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
"Unknown value '%s' for xsd:boolean",
|
||||
(*anyType)->value);
|
||||
goto failure;
|
||||
@ -725,23 +702,22 @@ ESX_VI__TEMPLATE__FREE(String,
|
||||
ESX_VI__TEMPLATE__LIST__APPEND(String);
|
||||
|
||||
int
|
||||
esxVI_String_AppendValueToList(virConnectPtr conn,
|
||||
esxVI_String **stringList, const char *value)
|
||||
esxVI_String_AppendValueToList(esxVI_String **stringList, const char *value)
|
||||
{
|
||||
esxVI_String *string = NULL;
|
||||
|
||||
if (esxVI_String_Alloc(conn, &string) < 0) {
|
||||
if (esxVI_String_Alloc(&string) < 0) {
|
||||
goto failure;
|
||||
}
|
||||
|
||||
string->value = strdup(value);
|
||||
|
||||
if (string->value == NULL) {
|
||||
virReportOOMError(conn);
|
||||
virReportOOMError(NULL);
|
||||
goto failure;
|
||||
}
|
||||
|
||||
if (esxVI_String_AppendToList(conn, stringList, string) < 0) {
|
||||
if (esxVI_String_AppendToList(stringList, string) < 0) {
|
||||
goto failure;
|
||||
}
|
||||
|
||||
@ -754,23 +730,21 @@ esxVI_String_AppendValueToList(virConnectPtr conn,
|
||||
}
|
||||
|
||||
int
|
||||
esxVI_String_AppendValueListToList(virConnectPtr conn,
|
||||
esxVI_String **stringList,
|
||||
esxVI_String_AppendValueListToList(esxVI_String **stringList,
|
||||
const char *valueList)
|
||||
{
|
||||
esxVI_String *stringListToAppend = NULL;
|
||||
const char *value = valueList;
|
||||
|
||||
while (value != NULL && *value != '\0') {
|
||||
if (esxVI_String_AppendValueToList(conn, &stringListToAppend,
|
||||
value) < 0) {
|
||||
if (esxVI_String_AppendValueToList(&stringListToAppend, value) < 0) {
|
||||
goto failure;
|
||||
}
|
||||
|
||||
value += strlen(value) + 1;
|
||||
}
|
||||
|
||||
if (esxVI_String_AppendToList(conn, stringList, stringListToAppend) < 0) {
|
||||
if (esxVI_String_AppendToList(stringList, stringListToAppend) < 0) {
|
||||
goto failure;
|
||||
}
|
||||
|
||||
@ -783,11 +757,10 @@ esxVI_String_AppendValueListToList(virConnectPtr conn,
|
||||
}
|
||||
|
||||
int
|
||||
esxVI_String_DeepCopy(virConnectPtr conn, esxVI_String **dest,
|
||||
esxVI_String *src)
|
||||
esxVI_String_DeepCopy(esxVI_String **dest, esxVI_String *src)
|
||||
{
|
||||
if (dest == NULL || *dest != NULL) {
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -795,8 +768,8 @@ esxVI_String_DeepCopy(virConnectPtr conn, esxVI_String **dest,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (esxVI_String_Alloc(conn, dest) < 0 ||
|
||||
esxVI_String_DeepCopyValue(conn, &(*dest)->value, src->value)) {
|
||||
if (esxVI_String_Alloc(dest) < 0 ||
|
||||
esxVI_String_DeepCopyValue(&(*dest)->value, src->value)) {
|
||||
goto failure;
|
||||
}
|
||||
|
||||
@ -812,10 +785,10 @@ esxVI_String_DeepCopy(virConnectPtr conn, esxVI_String **dest,
|
||||
ESX_VI__TEMPLATE__LIST__DEEP_COPY(String);
|
||||
|
||||
int
|
||||
esxVI_String_DeepCopyValue(virConnectPtr conn, char **dest, const char *src)
|
||||
esxVI_String_DeepCopyValue(char **dest, const char *src)
|
||||
{
|
||||
if (dest == NULL || *dest != NULL) {
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -826,7 +799,7 @@ esxVI_String_DeepCopyValue(virConnectPtr conn, char **dest, const char *src)
|
||||
*dest = strdup(src);
|
||||
|
||||
if (*dest == NULL) {
|
||||
virReportOOMError(conn);
|
||||
virReportOOMError(NULL);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -834,12 +807,10 @@ esxVI_String_DeepCopyValue(virConnectPtr conn, char **dest, const char *src)
|
||||
}
|
||||
|
||||
int
|
||||
esxVI_String_Serialize(virConnectPtr conn, esxVI_String *string,
|
||||
const char *element, virBufferPtr output,
|
||||
esxVI_Boolean required)
|
||||
esxVI_String_Serialize(esxVI_String *string, const char *element,
|
||||
virBufferPtr output, esxVI_Boolean required)
|
||||
{
|
||||
return esxVI_String_SerializeValue(conn,
|
||||
string != NULL ? string->value : NULL,
|
||||
return esxVI_String_SerializeValue(string != NULL ? string->value : NULL,
|
||||
element, output, required);
|
||||
}
|
||||
|
||||
@ -847,17 +818,16 @@ esxVI_String_Serialize(virConnectPtr conn, esxVI_String *string,
|
||||
ESX_VI__TEMPLATE__LIST__SERIALIZE(String);
|
||||
|
||||
int
|
||||
esxVI_String_SerializeValue(virConnectPtr conn, const char *value,
|
||||
const char *element, virBufferPtr output,
|
||||
esxVI_Boolean required)
|
||||
esxVI_String_SerializeValue(const char *value, const char *element,
|
||||
virBufferPtr output, esxVI_Boolean required)
|
||||
{
|
||||
if (element == NULL || output == NULL) {
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (value == NULL) {
|
||||
return esxVI_CheckSerializationNecessity(conn, element, required);
|
||||
return esxVI_CheckSerializationNecessity(element, required);
|
||||
}
|
||||
|
||||
ESV_VI__XML_TAG__OPEN(output, element, "xsd:string");
|
||||
@ -870,15 +840,14 @@ esxVI_String_SerializeValue(virConnectPtr conn, const char *value,
|
||||
}
|
||||
|
||||
int
|
||||
esxVI_String_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_String **string)
|
||||
esxVI_String_Deserialize(xmlNodePtr node, esxVI_String **string)
|
||||
{
|
||||
if (string == NULL || *string != NULL) {
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (esxVI_String_Alloc(conn, string) < 0) {
|
||||
if (esxVI_String_Alloc(string) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -889,7 +858,7 @@ esxVI_String_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
(*string)->value = strdup("");
|
||||
|
||||
if ((*string)->value == NULL) {
|
||||
virReportOOMError(conn);
|
||||
virReportOOMError(NULL);
|
||||
goto failure;
|
||||
}
|
||||
}
|
||||
@ -906,11 +875,10 @@ esxVI_String_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
ESX_VI__TEMPLATE__LIST__DESERIALIZE(String);
|
||||
|
||||
int
|
||||
esxVI_String_DeserializeValue(virConnectPtr conn, xmlNodePtr node,
|
||||
char **value)
|
||||
esxVI_String_DeserializeValue(xmlNodePtr node, char **value)
|
||||
{
|
||||
if (value == NULL || *value != NULL) {
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -920,7 +888,7 @@ esxVI_String_DeserializeValue(virConnectPtr conn, xmlNodePtr node,
|
||||
*value = strdup("");
|
||||
|
||||
if (*value == NULL) {
|
||||
virReportOOMError(conn);
|
||||
virReportOOMError(NULL);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -947,10 +915,10 @@ ESX_VI__TEMPLATE__FREE(Int,
|
||||
ESX_VI__TEMPLATE__LIST__APPEND(Int);
|
||||
|
||||
int
|
||||
esxVI_Int_DeepCopy(virConnectPtr conn, esxVI_Int **dest, esxVI_Int *src)
|
||||
esxVI_Int_DeepCopy(esxVI_Int **dest, esxVI_Int *src)
|
||||
{
|
||||
if (dest == NULL || *dest != NULL) {
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -958,7 +926,7 @@ esxVI_Int_DeepCopy(virConnectPtr conn, esxVI_Int **dest, esxVI_Int *src)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (esxVI_Int_Alloc(conn, dest) < 0) {
|
||||
if (esxVI_Int_Alloc(dest) < 0) {
|
||||
goto failure;
|
||||
}
|
||||
|
||||
@ -1036,15 +1004,14 @@ ESX_VI__TEMPLATE__SERIALIZE_EXTRA(DateTime, "xsd:dateTime",
|
||||
});
|
||||
|
||||
int
|
||||
esxVI_DateTime_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_DateTime **dateTime)
|
||||
esxVI_DateTime_Deserialize(xmlNodePtr node, esxVI_DateTime **dateTime)
|
||||
{
|
||||
if (dateTime == NULL || *dateTime != NULL) {
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (esxVI_DateTime_Alloc(conn, dateTime) < 0) {
|
||||
if (esxVI_DateTime_Alloc(dateTime) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1052,7 +1019,7 @@ esxVI_DateTime_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
(char *)xmlNodeListGetString(node->doc, node->children, 1);
|
||||
|
||||
if ((*dateTime)->value == NULL) {
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
"XML node doesn't contain text, expecting an "
|
||||
"xsd:dateTime value");
|
||||
goto failure;
|
||||
@ -1291,12 +1258,11 @@ ESX_VI__TEMPLATE__FREE(ManagedObjectReference,
|
||||
});
|
||||
|
||||
int
|
||||
esxVI_ManagedObjectReference_DeepCopy(virConnectPtr conn,
|
||||
esxVI_ManagedObjectReference **dest,
|
||||
esxVI_ManagedObjectReference_DeepCopy(esxVI_ManagedObjectReference **dest,
|
||||
esxVI_ManagedObjectReference *src)
|
||||
{
|
||||
if (dest == NULL || *dest != NULL) {
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1304,9 +1270,9 @@ esxVI_ManagedObjectReference_DeepCopy(virConnectPtr conn,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (esxVI_ManagedObjectReference_Alloc(conn, dest) < 0 ||
|
||||
esxVI_String_DeepCopyValue(conn, &(*dest)->type, src->type) < 0 ||
|
||||
esxVI_String_DeepCopyValue(conn, &(*dest)->value, src->value) < 0) {
|
||||
if (esxVI_ManagedObjectReference_Alloc(dest) < 0 ||
|
||||
esxVI_String_DeepCopyValue(&(*dest)->type, src->type) < 0 ||
|
||||
esxVI_String_DeepCopyValue(&(*dest)->value, src->value) < 0) {
|
||||
goto failure;
|
||||
}
|
||||
|
||||
@ -1323,31 +1289,31 @@ ESX_VI__TEMPLATE__LIST__APPEND(ManagedObjectReference);
|
||||
|
||||
int
|
||||
esxVI_ManagedObjectReference_CastFromAnyType
|
||||
(virConnectPtr conn, esxVI_AnyType *anyType,
|
||||
(esxVI_AnyType *anyType,
|
||||
esxVI_ManagedObjectReference **managedObjectReference,
|
||||
const char *expectedType)
|
||||
{
|
||||
if (anyType == NULL || managedObjectReference == NULL ||
|
||||
*managedObjectReference != NULL) {
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (STRNEQ(anyType->other, "ManagedObjectReference")) {
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
"Expecting type 'ManagedObjectReference' but found '%s'",
|
||||
anyType->other);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return esxVI_ManagedObjectReference_Deserialize(conn, anyType->_node,
|
||||
return esxVI_ManagedObjectReference_Deserialize(anyType->_node,
|
||||
managedObjectReference,
|
||||
expectedType);
|
||||
}
|
||||
|
||||
int
|
||||
esxVI_ManagedObjectReference_CastListFromAnyType
|
||||
(virConnectPtr conn, esxVI_AnyType *anyType,
|
||||
(esxVI_AnyType *anyType,
|
||||
esxVI_ManagedObjectReference **managedObjectReferenceList,
|
||||
const char *expectedType)
|
||||
{
|
||||
@ -1358,7 +1324,7 @@ esxVI_ManagedObjectReference_CastListFromAnyType
|
||||
|
||||
if (managedObjectReferenceList == NULL ||
|
||||
*managedObjectReferenceList != NULL) {
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
goto failure;
|
||||
}
|
||||
|
||||
@ -1367,7 +1333,7 @@ esxVI_ManagedObjectReference_CastListFromAnyType
|
||||
}
|
||||
|
||||
if (STRNEQ(anyType->other, "ArrayOfManagedObjectReference")) {
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
"Expecting type to be 'ArrayOfManagedObjectReference' "
|
||||
"but found '%s'", anyType->other);
|
||||
goto failure;
|
||||
@ -1376,27 +1342,26 @@ esxVI_ManagedObjectReference_CastListFromAnyType
|
||||
for (childNode = anyType->_node->children; childNode != NULL;
|
||||
childNode = childNode->next) {
|
||||
if (childNode->type != XML_ELEMENT_NODE) {
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
"Wrong XML element type %d", childNode->type);
|
||||
goto failure;
|
||||
}
|
||||
|
||||
esxVI_AnyType_Free(&childAnyType);
|
||||
|
||||
if (esxVI_AnyType_Deserialize(conn, childNode, &childAnyType) < 0) {
|
||||
if (esxVI_AnyType_Deserialize(childNode, &childAnyType) < 0) {
|
||||
goto failure;
|
||||
}
|
||||
|
||||
managedObjectReference = NULL;
|
||||
|
||||
if (esxVI_ManagedObjectReference_CastFromAnyType
|
||||
(conn, childAnyType, &managedObjectReference,
|
||||
expectedType) < 0) {
|
||||
(childAnyType, &managedObjectReference, expectedType) < 0) {
|
||||
goto failure;
|
||||
}
|
||||
|
||||
if (esxVI_ManagedObjectReference_AppendToList
|
||||
(conn, managedObjectReferenceList, managedObjectReference) < 0) {
|
||||
(managedObjectReferenceList, managedObjectReference) < 0) {
|
||||
goto failure;
|
||||
}
|
||||
}
|
||||
@ -1417,16 +1382,16 @@ esxVI_ManagedObjectReference_CastListFromAnyType
|
||||
|
||||
int
|
||||
esxVI_ManagedObjectReference_Serialize
|
||||
(virConnectPtr conn, esxVI_ManagedObjectReference *managedObjectReference,
|
||||
(esxVI_ManagedObjectReference *managedObjectReference,
|
||||
const char *element, virBufferPtr output, esxVI_Boolean required)
|
||||
{
|
||||
if (element == NULL || output == NULL) {
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (managedObjectReference == NULL) {
|
||||
return esxVI_CheckSerializationNecessity(conn, element, required);
|
||||
return esxVI_CheckSerializationNecessity(element, required);
|
||||
}
|
||||
|
||||
virBufferAddLit(output, "<");
|
||||
@ -1448,16 +1413,15 @@ ESX_VI__TEMPLATE__LIST__SERIALIZE(ManagedObjectReference);
|
||||
|
||||
int
|
||||
esxVI_ManagedObjectReference_Deserialize
|
||||
(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_ManagedObjectReference **managedObjectReference,
|
||||
(xmlNodePtr node, esxVI_ManagedObjectReference **managedObjectReference,
|
||||
const char *expectedType)
|
||||
{
|
||||
if (managedObjectReference == NULL || *managedObjectReference != NULL) {
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (esxVI_ManagedObjectReference_Alloc(conn, managedObjectReference) < 0) {
|
||||
if (esxVI_ManagedObjectReference_Alloc(managedObjectReference) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1465,20 +1429,20 @@ esxVI_ManagedObjectReference_Deserialize
|
||||
(char *)xmlGetNoNsProp(node, BAD_CAST "type");
|
||||
|
||||
if ((*managedObjectReference)->type == NULL) {
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
"ManagedObjectReference is missing 'type' property");
|
||||
goto failure;
|
||||
}
|
||||
|
||||
if (expectedType != NULL &&
|
||||
STRNEQ(expectedType, (*managedObjectReference)->type)) {
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||
"Expected type '%s' but found '%s'", expectedType,
|
||||
(*managedObjectReference)->type);
|
||||
goto failure;
|
||||
}
|
||||
|
||||
if (esxVI_String_DeserializeValue(conn, node,
|
||||
if (esxVI_String_DeserializeValue(node,
|
||||
&(*managedObjectReference)->value) < 0) {
|
||||
goto failure;
|
||||
}
|
||||
@ -1510,12 +1474,11 @@ ESX_VI__TEMPLATE__FREE(DynamicProperty,
|
||||
});
|
||||
|
||||
int
|
||||
esxVI_DynamicProperty_DeepCopy(virConnectPtr conn,
|
||||
esxVI_DynamicProperty **dest,
|
||||
esxVI_DynamicProperty_DeepCopy(esxVI_DynamicProperty **dest,
|
||||
esxVI_DynamicProperty *src)
|
||||
{
|
||||
if (dest == NULL || *dest != NULL) {
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1523,9 +1486,9 @@ esxVI_DynamicProperty_DeepCopy(virConnectPtr conn,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (esxVI_DynamicProperty_Alloc(conn, dest) < 0 ||
|
||||
esxVI_String_DeepCopyValue(conn, &(*dest)->name, src->name) < 0 ||
|
||||
esxVI_AnyType_DeepCopy(conn, &(*dest)->val, src->val) < 0) {
|
||||
if (esxVI_DynamicProperty_Alloc(dest) < 0 ||
|
||||
esxVI_String_DeepCopyValue(&(*dest)->name, src->name) < 0 ||
|
||||
esxVI_AnyType_DeepCopy(&(*dest)->val, src->val) < 0) {
|
||||
goto failure;
|
||||
}
|
||||
|
||||
@ -1648,28 +1611,27 @@ esxVI_SelectionSpec_Free(esxVI_SelectionSpec **selectionSpec)
|
||||
ESX_VI__TEMPLATE__LIST__APPEND(SelectionSpec);
|
||||
|
||||
int
|
||||
esxVI_SelectionSpec_Serialize(virConnectPtr conn,
|
||||
esxVI_SelectionSpec *selectionSpec,
|
||||
esxVI_SelectionSpec_Serialize(esxVI_SelectionSpec *selectionSpec,
|
||||
const char *element, virBufferPtr output,
|
||||
esxVI_Boolean required)
|
||||
{
|
||||
if (element == NULL || output == NULL) {
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (selectionSpec == NULL) {
|
||||
return esxVI_CheckSerializationNecessity(conn, element, required);
|
||||
return esxVI_CheckSerializationNecessity(element, required);
|
||||
}
|
||||
|
||||
if (selectionSpec->_super != NULL) {
|
||||
return esxVI_TraversalSpec_Serialize(conn, selectionSpec->_super,
|
||||
element, output, required);
|
||||
return esxVI_TraversalSpec_Serialize(selectionSpec->_super, element,
|
||||
output, required);
|
||||
}
|
||||
|
||||
ESV_VI__XML_TAG__OPEN(output, element, "SelectionSpec");
|
||||
|
||||
if (esxVI_String_SerializeValue(conn, selectionSpec->name, "name", output,
|
||||
if (esxVI_String_SerializeValue(selectionSpec->name, "name", output,
|
||||
esxVI_Boolean_False) < 0) {
|
||||
return -1;
|
||||
}
|
||||
@ -1689,15 +1651,13 @@ ESX_VI__TEMPLATE__LIST__SERIALIZE(SelectionSpec);
|
||||
*/
|
||||
|
||||
int
|
||||
esxVI_TraversalSpec_Alloc(virConnectPtr conn,
|
||||
esxVI_TraversalSpec **traversalSpec)
|
||||
esxVI_TraversalSpec_Alloc(esxVI_TraversalSpec **traversalSpec)
|
||||
{
|
||||
if (esxVI_Alloc(conn, (void **)traversalSpec,
|
||||
sizeof(esxVI_TraversalSpec)) < 0) {
|
||||
if (esxVI_Alloc((void **)traversalSpec, sizeof(esxVI_TraversalSpec)) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (esxVI_SelectionSpec_Alloc(conn, &(*traversalSpec)->_base) < 0) {
|
||||
if (esxVI_SelectionSpec_Alloc(&(*traversalSpec)->_base) < 0) {
|
||||
esxVI_TraversalSpec_Free(traversalSpec);
|
||||
return -1;
|
||||
}
|
||||
@ -1750,7 +1710,7 @@ esxVI_TraversalSpec_Free(esxVI_TraversalSpec **traversalSpec)
|
||||
/* esxVI_TraversalSpec_Serialize */
|
||||
ESX_VI__TEMPLATE__SERIALIZE(TraversalSpec,
|
||||
{
|
||||
if (esxVI_String_SerializeValue(conn, item->_base->name, "name", output,
|
||||
if (esxVI_String_SerializeValue(item->_base->name, "name", output,
|
||||
esxVI_Boolean_False) < 0) {
|
||||
return -1;
|
||||
}
|
||||
@ -1915,12 +1875,11 @@ ESX_VI__TEMPLATE__FREE(ObjectContent,
|
||||
ESX_VI__TEMPLATE__LIST__APPEND(ObjectContent);
|
||||
|
||||
int
|
||||
esxVI_ObjectContent_DeepCopy(virConnectPtr conn,
|
||||
esxVI_ObjectContent **dest,
|
||||
esxVI_ObjectContent_DeepCopy(esxVI_ObjectContent **dest,
|
||||
esxVI_ObjectContent *src)
|
||||
{
|
||||
if (dest == NULL || *dest != NULL) {
|
||||
ESX_VI_ERROR(conn, VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1928,10 +1887,9 @@ esxVI_ObjectContent_DeepCopy(virConnectPtr conn,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (esxVI_ObjectContent_Alloc(conn, dest) < 0 ||
|
||||
esxVI_ManagedObjectReference_DeepCopy(conn, &(*dest)->obj,
|
||||
src->obj) < 0 ||
|
||||
esxVI_DynamicProperty_DeepCopyList(conn, &(*dest)->propSet,
|
||||
if (esxVI_ObjectContent_Alloc(dest) < 0 ||
|
||||
esxVI_ManagedObjectReference_DeepCopy(&(*dest)->obj, src->obj) < 0 ||
|
||||
esxVI_DynamicProperty_DeepCopyList(&(*dest)->propSet,
|
||||
src->propSet) < 0) {
|
||||
goto failure;
|
||||
}
|
||||
|
@ -131,11 +131,9 @@ enum _esxVI_Boolean {
|
||||
esxVI_Boolean_False,
|
||||
};
|
||||
|
||||
int esxVI_Boolean_Serialize(virConnectPtr conn, esxVI_Boolean boolean_,
|
||||
const char *element, virBufferPtr output,
|
||||
esxVI_Boolean required);
|
||||
int esxVI_Boolean_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_Boolean *boolean_);
|
||||
int esxVI_Boolean_Serialize(esxVI_Boolean boolean_, const char *element,
|
||||
virBufferPtr output, esxVI_Boolean required);
|
||||
int esxVI_Boolean_Deserialize(xmlNodePtr node, esxVI_Boolean *boolean_);
|
||||
|
||||
|
||||
|
||||
@ -158,14 +156,11 @@ struct _esxVI_AnyType {
|
||||
};
|
||||
};
|
||||
|
||||
int esxVI_AnyType_Alloc(virConnectPtr conn, esxVI_AnyType **anyType);
|
||||
int esxVI_AnyType_Alloc(esxVI_AnyType **anyType);
|
||||
void esxVI_AnyType_Free(esxVI_AnyType **anyType);
|
||||
int esxVI_AnyType_ExpectType(virConnectPtr conn, esxVI_AnyType *anyType,
|
||||
esxVI_Type type);
|
||||
int esxVI_AnyType_DeepCopy(virConnectPtr conn, esxVI_AnyType **dest,
|
||||
esxVI_AnyType *src);
|
||||
int esxVI_AnyType_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_AnyType **anyType);
|
||||
int esxVI_AnyType_ExpectType(esxVI_AnyType *anyType, esxVI_Type type);
|
||||
int esxVI_AnyType_DeepCopy(esxVI_AnyType **dest, esxVI_AnyType *src);
|
||||
int esxVI_AnyType_Deserialize(xmlNodePtr node, esxVI_AnyType **anyType);
|
||||
|
||||
|
||||
|
||||
@ -179,37 +174,25 @@ struct _esxVI_String {
|
||||
char *value; /* required */
|
||||
};
|
||||
|
||||
int esxVI_String_Alloc(virConnectPtr conn, esxVI_String **string);
|
||||
int esxVI_String_Alloc(esxVI_String **string);
|
||||
void esxVI_String_Free(esxVI_String **stringList);
|
||||
int esxVI_String_AppendToList(virConnectPtr conn, esxVI_String **stringList,
|
||||
esxVI_String *string);
|
||||
int esxVI_String_AppendValueToList(virConnectPtr conn,
|
||||
esxVI_String **stringList,
|
||||
int esxVI_String_AppendToList(esxVI_String **stringList, esxVI_String *string);
|
||||
int esxVI_String_AppendValueToList(esxVI_String **stringList,
|
||||
const char *value);
|
||||
int esxVI_String_AppendValueListToList(virConnectPtr conn,
|
||||
esxVI_String **stringList,
|
||||
int esxVI_String_AppendValueListToList(esxVI_String **stringList,
|
||||
const char *valueList);
|
||||
int esxVI_String_DeepCopy(virConnectPtr conn, esxVI_String **dest,
|
||||
esxVI_String *src);
|
||||
int esxVI_String_DeepCopyList(virConnectPtr conn, esxVI_String **destList,
|
||||
esxVI_String *srcList);
|
||||
int esxVI_String_DeepCopyValue(virConnectPtr conn, char **dest,
|
||||
const char *src);
|
||||
int esxVI_String_Serialize(virConnectPtr conn, esxVI_String *string,
|
||||
const char *element, virBufferPtr output,
|
||||
esxVI_Boolean required);
|
||||
int esxVI_String_SerializeList(virConnectPtr conn, esxVI_String *stringList,
|
||||
const char *element, virBufferPtr output,
|
||||
esxVI_Boolean required);
|
||||
int esxVI_String_SerializeValue(virConnectPtr conn, const char *value,
|
||||
const char *element, virBufferPtr output,
|
||||
esxVI_Boolean required);
|
||||
int esxVI_String_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_String **string);
|
||||
int esxVI_String_DeserializeList(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_String **stringList);
|
||||
int esxVI_String_DeserializeValue(virConnectPtr conn, xmlNodePtr node,
|
||||
char **value);
|
||||
int esxVI_String_DeepCopy(esxVI_String **dest, esxVI_String *src);
|
||||
int esxVI_String_DeepCopyList(esxVI_String **destList, esxVI_String *srcList);
|
||||
int esxVI_String_DeepCopyValue(char **dest, const char *src);
|
||||
int esxVI_String_Serialize(esxVI_String *string, const char *element,
|
||||
virBufferPtr output, esxVI_Boolean required);
|
||||
int esxVI_String_SerializeList(esxVI_String *stringList, const char *element,
|
||||
virBufferPtr output, esxVI_Boolean required);
|
||||
int esxVI_String_SerializeValue(const char *value, const char *element,
|
||||
virBufferPtr output, esxVI_Boolean required);
|
||||
int esxVI_String_Deserialize(xmlNodePtr node, esxVI_String **string);
|
||||
int esxVI_String_DeserializeList(xmlNodePtr node, esxVI_String **stringList);
|
||||
int esxVI_String_DeserializeValue(xmlNodePtr node, char **value);
|
||||
|
||||
|
||||
|
||||
@ -223,19 +206,15 @@ struct _esxVI_Int {
|
||||
int32_t value; /* required */
|
||||
};
|
||||
|
||||
int esxVI_Int_Alloc(virConnectPtr conn, esxVI_Int **number);
|
||||
int esxVI_Int_Alloc(esxVI_Int **number);
|
||||
void esxVI_Int_Free(esxVI_Int **numberList);
|
||||
int esxVI_Int_AppendToList(virConnectPtr conn, esxVI_Int **numberList,
|
||||
esxVI_Int *number);
|
||||
int esxVI_Int_DeepCopy(virConnectPtr conn, esxVI_Int **dest, esxVI_Int *src);
|
||||
int esxVI_Int_Serialize(virConnectPtr conn, esxVI_Int *number,
|
||||
const char *element, virBufferPtr output,
|
||||
esxVI_Boolean required);
|
||||
int esxVI_Int_SerializeList(virConnectPtr conn, esxVI_Int *numberList,
|
||||
const char *element, virBufferPtr output,
|
||||
esxVI_Boolean required);
|
||||
int esxVI_Int_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_Int **number);
|
||||
int esxVI_Int_AppendToList(esxVI_Int **numberList, esxVI_Int *number);
|
||||
int esxVI_Int_DeepCopy(esxVI_Int **dest, esxVI_Int *src);
|
||||
int esxVI_Int_Serialize(esxVI_Int *number, const char *element,
|
||||
virBufferPtr output, esxVI_Boolean required);
|
||||
int esxVI_Int_SerializeList(esxVI_Int *numberList, const char *element,
|
||||
virBufferPtr output, esxVI_Boolean required);
|
||||
int esxVI_Int_Deserialize(xmlNodePtr node, esxVI_Int **number);
|
||||
|
||||
|
||||
|
||||
@ -249,18 +228,14 @@ struct _esxVI_Long {
|
||||
int64_t value; /* required */
|
||||
};
|
||||
|
||||
int esxVI_Long_Alloc(virConnectPtr conn, esxVI_Long **number);
|
||||
int esxVI_Long_Alloc(esxVI_Long **number);
|
||||
void esxVI_Long_Free(esxVI_Long **numberList);
|
||||
int esxVI_Long_AppendToList(virConnectPtr conn, esxVI_Long **numberList,
|
||||
esxVI_Long *number);
|
||||
int esxVI_Long_Serialize(virConnectPtr conn, esxVI_Long *number,
|
||||
const char *element, virBufferPtr output,
|
||||
esxVI_Boolean required);
|
||||
int esxVI_Long_SerializeList(virConnectPtr conn, esxVI_Long *numberList,
|
||||
const char *element, virBufferPtr output,
|
||||
esxVI_Boolean required);
|
||||
int esxVI_Long_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_Long **number);
|
||||
int esxVI_Long_AppendToList(esxVI_Long **numberList, esxVI_Long *number);
|
||||
int esxVI_Long_Serialize(esxVI_Long *number, const char *element,
|
||||
virBufferPtr output, esxVI_Boolean required);
|
||||
int esxVI_Long_SerializeList(esxVI_Long *numberList, const char *element,
|
||||
virBufferPtr output,esxVI_Boolean required);
|
||||
int esxVI_Long_Deserialize(xmlNodePtr node, esxVI_Long **number);
|
||||
|
||||
|
||||
|
||||
@ -272,13 +247,11 @@ struct _esxVI_DateTime {
|
||||
char *value; /* required */
|
||||
};
|
||||
|
||||
int esxVI_DateTime_Alloc(virConnectPtr conn, esxVI_DateTime **dateTime);
|
||||
int esxVI_DateTime_Alloc(esxVI_DateTime **dateTime);
|
||||
void esxVI_DateTime_Free(esxVI_DateTime **dateTime);
|
||||
int esxVI_DateTime_Serialize(virConnectPtr conn, esxVI_DateTime *dateTime,
|
||||
const char *element, virBufferPtr output,
|
||||
esxVI_Boolean required);
|
||||
int esxVI_DateTime_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_DateTime **dateTime);
|
||||
int esxVI_DateTime_Serialize(esxVI_DateTime *dateTime, const char *element,
|
||||
virBufferPtr output, esxVI_Boolean required);
|
||||
int esxVI_DateTime_Deserialize(xmlNodePtr node, esxVI_DateTime **dateTime);
|
||||
|
||||
|
||||
|
||||
@ -295,8 +268,7 @@ enum _esxVI_ManagedEntityStatus {
|
||||
};
|
||||
|
||||
int esxVI_ManagedEntityStatus_CastFromAnyType
|
||||
(virConnectPtr conn, esxVI_AnyType *anyType,
|
||||
esxVI_ManagedEntityStatus *managedEntityStatus);
|
||||
(esxVI_AnyType *anyType, esxVI_ManagedEntityStatus *managedEntityStatus);
|
||||
|
||||
|
||||
|
||||
@ -312,8 +284,7 @@ enum _esxVI_ObjectUpdateKind {
|
||||
};
|
||||
|
||||
int esxVI_ObjectUpdateKind_Deserialize
|
||||
(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_ObjectUpdateKind *objectUpdateKind);
|
||||
(xmlNodePtr node, esxVI_ObjectUpdateKind *objectUpdateKind);
|
||||
|
||||
|
||||
|
||||
@ -331,7 +302,7 @@ enum _esxVI_PerfSummaryType {
|
||||
esxVI_PerfSummaryType_Summation,
|
||||
};
|
||||
|
||||
int esxVI_PerfSummaryType_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
int esxVI_PerfSummaryType_Deserialize(xmlNodePtr node,
|
||||
esxVI_PerfSummaryType *perfSummaryType);
|
||||
|
||||
|
||||
@ -347,7 +318,7 @@ enum _esxVI_PerfStatsType {
|
||||
esxVI_PerfStatsType_Rate,
|
||||
};
|
||||
|
||||
int esxVI_PerfStatsType_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
int esxVI_PerfStatsType_Deserialize(xmlNodePtr node,
|
||||
esxVI_PerfStatsType *perfStatsType);
|
||||
|
||||
|
||||
@ -365,8 +336,7 @@ enum _esxVI_PropertyChangeOp {
|
||||
};
|
||||
|
||||
int esxVI_PropertyChangeOp_Deserialize
|
||||
(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_PropertyChangeOp *propertyChangeOp);
|
||||
(xmlNodePtr node, esxVI_PropertyChangeOp *propertyChangeOp);
|
||||
|
||||
|
||||
|
||||
@ -382,11 +352,10 @@ enum _esxVI_SharesLevel {
|
||||
esxVI_SharesLevel_Normal,
|
||||
};
|
||||
|
||||
int esxVI_SharesLevel_Serialize(virConnectPtr conn,
|
||||
esxVI_SharesLevel sharesLevel,
|
||||
int esxVI_SharesLevel_Serialize(esxVI_SharesLevel sharesLevel,
|
||||
const char *element, virBufferPtr output,
|
||||
esxVI_Boolean required);
|
||||
int esxVI_SharesLevel_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
int esxVI_SharesLevel_Deserialize(xmlNodePtr node,
|
||||
esxVI_SharesLevel *sharesLevel);
|
||||
|
||||
|
||||
@ -403,10 +372,9 @@ enum _esxVI_TaskInfoState {
|
||||
esxVI_TaskInfoState_Success,
|
||||
};
|
||||
|
||||
int esxVI_TaskInfoState_CastFromAnyType(virConnectPtr conn,
|
||||
esxVI_AnyType *anyType,
|
||||
int esxVI_TaskInfoState_CastFromAnyType(esxVI_AnyType *anyType,
|
||||
esxVI_TaskInfoState *taskInfoState);
|
||||
int esxVI_TaskInfoState_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
int esxVI_TaskInfoState_Deserialize(xmlNodePtr node,
|
||||
esxVI_TaskInfoState *taskInfoState);
|
||||
|
||||
|
||||
@ -423,8 +391,7 @@ enum _esxVI_VirtualMachineMovePriority {
|
||||
};
|
||||
|
||||
int esxVI_VirtualMachineMovePriority_Serialize
|
||||
(virConnectPtr conn,
|
||||
esxVI_VirtualMachineMovePriority virtualMachineMovePriority,
|
||||
(esxVI_VirtualMachineMovePriority virtualMachineMovePriority,
|
||||
const char *element, virBufferPtr output, esxVI_Boolean required);
|
||||
|
||||
|
||||
@ -441,11 +408,10 @@ enum _esxVI_VirtualMachinePowerState {
|
||||
};
|
||||
|
||||
int esxVI_VirtualMachinePowerState_CastFromAnyType
|
||||
(virConnectPtr conn, esxVI_AnyType *anyType,
|
||||
(esxVI_AnyType *anyType,
|
||||
esxVI_VirtualMachinePowerState *virtualMachinePowerState);
|
||||
int esxVI_VirtualMachinePowerState_Serialize
|
||||
(virConnectPtr conn,
|
||||
esxVI_VirtualMachinePowerState virtualMachinePowerState,
|
||||
(esxVI_VirtualMachinePowerState virtualMachinePowerState,
|
||||
const char *element, virBufferPtr output, esxVI_Boolean required);
|
||||
|
||||
|
||||
@ -459,10 +425,9 @@ struct _esxVI_Fault {
|
||||
char *faultstring; /* required */
|
||||
};
|
||||
|
||||
int esxVI_Fault_Alloc(virConnectPtr conn, esxVI_Fault **fault);
|
||||
int esxVI_Fault_Alloc(esxVI_Fault **fault);
|
||||
void esxVI_Fault_Free(esxVI_Fault **fault);
|
||||
int esxVI_Fault_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_Fault **fault);
|
||||
int esxVI_Fault_Deserialize(xmlNodePtr node, esxVI_Fault **fault);
|
||||
|
||||
|
||||
|
||||
@ -478,37 +443,30 @@ struct _esxVI_ManagedObjectReference {
|
||||
};
|
||||
|
||||
int esxVI_ManagedObjectReference_Alloc
|
||||
(virConnectPtr conn,
|
||||
esxVI_ManagedObjectReference **managedObjectReference);
|
||||
(esxVI_ManagedObjectReference **managedObjectReference);
|
||||
void esxVI_ManagedObjectReference_Free
|
||||
(esxVI_ManagedObjectReference **managedObjectReferenceList);
|
||||
int esxVI_ManagedObjectReference_DeepCopy(virConnectPtr conn,
|
||||
esxVI_ManagedObjectReference **dest,
|
||||
int esxVI_ManagedObjectReference_DeepCopy(esxVI_ManagedObjectReference **dest,
|
||||
esxVI_ManagedObjectReference *src);
|
||||
int esxVI_ManagedObjectReference_AppendToList
|
||||
(virConnectPtr conn,
|
||||
esxVI_ManagedObjectReference **managedObjectReferenceList,
|
||||
(esxVI_ManagedObjectReference **managedObjectReferenceList,
|
||||
esxVI_ManagedObjectReference *managedObjectReference);
|
||||
int esxVI_ManagedObjectReference_CastFromAnyType(virConnectPtr conn,
|
||||
esxVI_AnyType *anyType,
|
||||
int esxVI_ManagedObjectReference_CastFromAnyType(esxVI_AnyType *anyType,
|
||||
esxVI_ManagedObjectReference
|
||||
**managedObjectReference,
|
||||
const char *expectedType);
|
||||
int esxVI_ManagedObjectReference_CastListFromAnyType
|
||||
(virConnectPtr conn, esxVI_AnyType *anyType,
|
||||
(esxVI_AnyType *anyType,
|
||||
esxVI_ManagedObjectReference **managedObjectReferenceList,
|
||||
const char *expectedType);
|
||||
int esxVI_ManagedObjectReference_Serialize
|
||||
(virConnectPtr conn,
|
||||
esxVI_ManagedObjectReference *managedObjectReference,
|
||||
(esxVI_ManagedObjectReference *managedObjectReference,
|
||||
const char *element, virBufferPtr output, esxVI_Boolean required);
|
||||
int esxVI_ManagedObjectReference_SerializeList
|
||||
(virConnectPtr conn,
|
||||
esxVI_ManagedObjectReference *managedObjectReference,
|
||||
(esxVI_ManagedObjectReference *managedObjectReference,
|
||||
const char *element, virBufferPtr output, esxVI_Boolean required);
|
||||
int esxVI_ManagedObjectReference_Deserialize
|
||||
(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_ManagedObjectReference **managedObjectReference,
|
||||
(xmlNodePtr node, esxVI_ManagedObjectReference **managedObjectReference,
|
||||
const char *expectedType);
|
||||
|
||||
|
||||
@ -524,24 +482,20 @@ struct _esxVI_DynamicProperty {
|
||||
esxVI_AnyType *val; /* required */
|
||||
};
|
||||
|
||||
int esxVI_DynamicProperty_Alloc(virConnectPtr conn,
|
||||
esxVI_DynamicProperty **dynamicProperty);
|
||||
int esxVI_DynamicProperty_Alloc(esxVI_DynamicProperty **dynamicProperty);
|
||||
void esxVI_DynamicProperty_Free
|
||||
(esxVI_DynamicProperty **dynamicPropertyList);
|
||||
int esxVI_DynamicProperty_DeepCopy(virConnectPtr conn,
|
||||
esxVI_DynamicProperty **dest,
|
||||
int esxVI_DynamicProperty_DeepCopy(esxVI_DynamicProperty **dest,
|
||||
esxVI_DynamicProperty *src);
|
||||
int esxVI_DynamicProperty_DeepCopyList(virConnectPtr conn,
|
||||
esxVI_DynamicProperty **destList,
|
||||
int esxVI_DynamicProperty_DeepCopyList(esxVI_DynamicProperty **destList,
|
||||
esxVI_DynamicProperty *srcList);
|
||||
int esxVI_DynamicProperty_AppendToList
|
||||
(virConnectPtr conn, esxVI_DynamicProperty **dynamicPropertyList,
|
||||
(esxVI_DynamicProperty **dynamicPropertyList,
|
||||
esxVI_DynamicProperty *dynamicProperty);
|
||||
int esxVI_DynamicProperty_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
int esxVI_DynamicProperty_Deserialize(xmlNodePtr node,
|
||||
esxVI_DynamicProperty **dynamicProperty);
|
||||
int esxVI_DynamicProperty_DeserializeList
|
||||
(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_DynamicProperty **dynamicPropertyList);
|
||||
(xmlNodePtr node, esxVI_DynamicProperty **dynamicPropertyList);
|
||||
|
||||
|
||||
|
||||
@ -560,20 +514,16 @@ struct _esxVI_HostCpuIdInfo {
|
||||
char *edx; /* optional */
|
||||
};
|
||||
|
||||
int esxVI_HostCpuIdInfo_Alloc(virConnectPtr conn,
|
||||
esxVI_HostCpuIdInfo **hostCpuIdInfo);
|
||||
int esxVI_HostCpuIdInfo_Alloc(esxVI_HostCpuIdInfo **hostCpuIdInfo);
|
||||
void esxVI_HostCpuIdInfo_Free(esxVI_HostCpuIdInfo **hostCpuIdInfoList);
|
||||
int esxVI_HostCpuIdInfo_CastFromAnyType(virConnectPtr conn,
|
||||
esxVI_AnyType *anyType,
|
||||
int esxVI_HostCpuIdInfo_CastFromAnyType(esxVI_AnyType *anyType,
|
||||
esxVI_HostCpuIdInfo **hostCpuIdInfo);
|
||||
int esxVI_HostCpuIdInfo_CastListFromAnyType
|
||||
(virConnectPtr conn, esxVI_AnyType *anyType,
|
||||
esxVI_HostCpuIdInfo **hostCpuIdInfoList);
|
||||
int esxVI_HostCpuIdInfo_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
(esxVI_AnyType *anyType, esxVI_HostCpuIdInfo **hostCpuIdInfoList);
|
||||
int esxVI_HostCpuIdInfo_Deserialize(xmlNodePtr node,
|
||||
esxVI_HostCpuIdInfo **hostCpuIdInfo);
|
||||
int esxVI_HostCpuIdInfo_DeserializeList
|
||||
(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_HostCpuIdInfo **hostCpuIdInfoList);
|
||||
(xmlNodePtr node, esxVI_HostCpuIdInfo **hostCpuIdInfoList);
|
||||
|
||||
|
||||
|
||||
@ -588,18 +538,14 @@ struct _esxVI_SelectionSpec {
|
||||
char *name; /* optional */
|
||||
};
|
||||
|
||||
int esxVI_SelectionSpec_Alloc(virConnectPtr conn,
|
||||
esxVI_SelectionSpec **selectionSpec);
|
||||
int esxVI_SelectionSpec_Alloc(esxVI_SelectionSpec **selectionSpec);
|
||||
void esxVI_SelectionSpec_Free(esxVI_SelectionSpec **selectionSpecList);
|
||||
int esxVI_SelectionSpec_AppendToList(virConnectPtr conn,
|
||||
esxVI_SelectionSpec **selectionSpecList,
|
||||
int esxVI_SelectionSpec_AppendToList(esxVI_SelectionSpec **selectionSpecList,
|
||||
esxVI_SelectionSpec *selectionSpec);
|
||||
int esxVI_SelectionSpec_Serialize(virConnectPtr conn,
|
||||
esxVI_SelectionSpec *selectionSpec,
|
||||
int esxVI_SelectionSpec_Serialize(esxVI_SelectionSpec *selectionSpec,
|
||||
const char *element, virBufferPtr output,
|
||||
esxVI_Boolean required);
|
||||
int esxVI_SelectionSpec_SerializeList(virConnectPtr conn,
|
||||
esxVI_SelectionSpec *selectionSpecList,
|
||||
int esxVI_SelectionSpec_SerializeList(esxVI_SelectionSpec *selectionSpecList,
|
||||
const char *element, virBufferPtr output,
|
||||
esxVI_Boolean required);
|
||||
|
||||
@ -618,11 +564,9 @@ struct _esxVI_TraversalSpec {
|
||||
esxVI_SelectionSpec *selectSet; /* optional, list */
|
||||
};
|
||||
|
||||
int esxVI_TraversalSpec_Alloc(virConnectPtr conn,
|
||||
esxVI_TraversalSpec **traversalSpec);
|
||||
int esxVI_TraversalSpec_Alloc(esxVI_TraversalSpec **traversalSpec);
|
||||
void esxVI_TraversalSpec_Free(esxVI_TraversalSpec **traversalSpec);
|
||||
int esxVI_TraversalSpec_Serialize(virConnectPtr conn,
|
||||
esxVI_TraversalSpec *traversalSpec,
|
||||
int esxVI_TraversalSpec_Serialize(esxVI_TraversalSpec *traversalSpec,
|
||||
const char *element, virBufferPtr output,
|
||||
esxVI_Boolean required);
|
||||
|
||||
@ -640,17 +584,14 @@ struct _esxVI_ObjectSpec {
|
||||
esxVI_SelectionSpec *selectSet; /* optional, list */
|
||||
};
|
||||
|
||||
int esxVI_ObjectSpec_Alloc(virConnectPtr conn, esxVI_ObjectSpec **objectSpec);
|
||||
int esxVI_ObjectSpec_Alloc(esxVI_ObjectSpec **objectSpec);
|
||||
void esxVI_ObjectSpec_Free(esxVI_ObjectSpec **objectSpecList);
|
||||
int esxVI_ObjectSpec_AppendToList(virConnectPtr conn,
|
||||
esxVI_ObjectSpec **objectSpecList,
|
||||
int esxVI_ObjectSpec_AppendToList(esxVI_ObjectSpec **objectSpecList,
|
||||
esxVI_ObjectSpec *objectSpec);
|
||||
int esxVI_ObjectSpec_Serialize(virConnectPtr conn,
|
||||
esxVI_ObjectSpec *objectSpec,
|
||||
int esxVI_ObjectSpec_Serialize(esxVI_ObjectSpec *objectSpec,
|
||||
const char *element, virBufferPtr output,
|
||||
esxVI_Boolean required);
|
||||
int esxVI_ObjectSpec_SerializeList(virConnectPtr conn,
|
||||
esxVI_ObjectSpec *objectSpecList,
|
||||
int esxVI_ObjectSpec_SerializeList(esxVI_ObjectSpec *objectSpecList,
|
||||
const char *element, virBufferPtr output,
|
||||
esxVI_Boolean required);
|
||||
|
||||
@ -668,17 +609,15 @@ struct _esxVI_PropertyChange {
|
||||
esxVI_AnyType *val; /* optional */
|
||||
};
|
||||
|
||||
int esxVI_PropertyChange_Alloc(virConnectPtr conn,
|
||||
esxVI_PropertyChange **propertyChange);
|
||||
int esxVI_PropertyChange_Alloc(esxVI_PropertyChange **propertyChange);
|
||||
void esxVI_PropertyChange_Free(esxVI_PropertyChange **propertyChangeList);
|
||||
int esxVI_PropertyChange_AppendToList
|
||||
(virConnectPtr conn, esxVI_PropertyChange **propertyChangeList,
|
||||
(esxVI_PropertyChange **propertyChangeList,
|
||||
esxVI_PropertyChange *propertyChange);
|
||||
int esxVI_PropertyChange_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
int esxVI_PropertyChange_Deserialize(xmlNodePtr node,
|
||||
esxVI_PropertyChange **propertyChange);
|
||||
int esxVI_PropertyChange_DeserializeList
|
||||
(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_PropertyChange **propertyChangeList);
|
||||
(xmlNodePtr node, esxVI_PropertyChange **propertyChangeList);
|
||||
|
||||
|
||||
|
||||
@ -694,18 +633,14 @@ struct _esxVI_PropertySpec {
|
||||
esxVI_String *pathSet; /* optional, list */
|
||||
};
|
||||
|
||||
int esxVI_PropertySpec_Alloc(virConnectPtr conn,
|
||||
esxVI_PropertySpec **propertySpec);
|
||||
int esxVI_PropertySpec_Alloc(esxVI_PropertySpec **propertySpec);
|
||||
void esxVI_PropertySpec_Free(esxVI_PropertySpec **propertySpecList);
|
||||
int esxVI_PropertySpec_AppendToList(virConnectPtr conn,
|
||||
esxVI_PropertySpec **propertySpecList,
|
||||
int esxVI_PropertySpec_AppendToList(esxVI_PropertySpec **propertySpecList,
|
||||
esxVI_PropertySpec *propertySpec);
|
||||
int esxVI_PropertySpec_Serialize(virConnectPtr conn,
|
||||
esxVI_PropertySpec *propertySpec,
|
||||
int esxVI_PropertySpec_Serialize(esxVI_PropertySpec *propertySpec,
|
||||
const char *element, virBufferPtr output,
|
||||
esxVI_Boolean required);
|
||||
int esxVI_PropertySpec_SerializeList(virConnectPtr conn,
|
||||
esxVI_PropertySpec *propertySpecList,
|
||||
int esxVI_PropertySpec_SerializeList(esxVI_PropertySpec *propertySpecList,
|
||||
const char *element, virBufferPtr output,
|
||||
esxVI_Boolean required);
|
||||
|
||||
@ -723,18 +658,18 @@ struct _esxVI_PropertyFilterSpec {
|
||||
};
|
||||
|
||||
int esxVI_PropertyFilterSpec_Alloc
|
||||
(virConnectPtr conn, esxVI_PropertyFilterSpec **propertyFilterSpec);
|
||||
(esxVI_PropertyFilterSpec **propertyFilterSpec);
|
||||
void esxVI_PropertyFilterSpec_Free
|
||||
(esxVI_PropertyFilterSpec **propertyFilterSpecList);
|
||||
int esxVI_PropertyFilterSpec_AppendToList
|
||||
(virConnectPtr conn, esxVI_PropertyFilterSpec **propertyFilterSpecList,
|
||||
(esxVI_PropertyFilterSpec **propertyFilterSpecList,
|
||||
esxVI_PropertyFilterSpec *propertyFilterSpec);
|
||||
int esxVI_PropertyFilterSpec_Serialize
|
||||
(virConnectPtr conn, esxVI_PropertyFilterSpec *propertyFilterSpec,
|
||||
const char *element, virBufferPtr output, esxVI_Boolean required);
|
||||
(esxVI_PropertyFilterSpec *propertyFilterSpec, const char *element,
|
||||
virBufferPtr output, esxVI_Boolean required);
|
||||
int esxVI_PropertyFilterSpec_SerializeList
|
||||
(virConnectPtr conn, esxVI_PropertyFilterSpec *propertyFilterSpecList,
|
||||
const char *element, virBufferPtr output, esxVI_Boolean required);
|
||||
(esxVI_PropertyFilterSpec *propertyFilterSpecList, const char *element,
|
||||
virBufferPtr output, esxVI_Boolean required);
|
||||
|
||||
|
||||
|
||||
@ -750,20 +685,16 @@ struct _esxVI_ObjectContent {
|
||||
/*esxVI_MissingProperty *missingSet; *//* optional, list *//* FIXME */
|
||||
};
|
||||
|
||||
int esxVI_ObjectContent_Alloc(virConnectPtr conn,
|
||||
esxVI_ObjectContent **objectContent);
|
||||
int esxVI_ObjectContent_Alloc(esxVI_ObjectContent **objectContent);
|
||||
void esxVI_ObjectContent_Free(esxVI_ObjectContent **objectContentList);
|
||||
int esxVI_ObjectContent_AppendToList(virConnectPtr conn,
|
||||
esxVI_ObjectContent **objectContentList,
|
||||
int esxVI_ObjectContent_AppendToList(esxVI_ObjectContent **objectContentList,
|
||||
esxVI_ObjectContent *objectContent);
|
||||
int esxVI_ObjectContent_DeepCopy(virConnectPtr conn,
|
||||
esxVI_ObjectContent **dest,
|
||||
int esxVI_ObjectContent_DeepCopy(esxVI_ObjectContent **dest,
|
||||
esxVI_ObjectContent *src);
|
||||
int esxVI_ObjectContent_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
int esxVI_ObjectContent_Deserialize(xmlNodePtr node,
|
||||
esxVI_ObjectContent **objectContent);
|
||||
int esxVI_ObjectContent_DeserializeList
|
||||
(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_ObjectContent **objectContentList);
|
||||
(xmlNodePtr node, esxVI_ObjectContent **objectContentList);
|
||||
|
||||
|
||||
|
||||
@ -780,15 +711,13 @@ struct _esxVI_ObjectUpdate {
|
||||
/*esxVI_MissingProperty *missingSet; *//* optional, list *//* FIXME */
|
||||
};
|
||||
|
||||
int esxVI_ObjectUpdate_Alloc(virConnectPtr conn,
|
||||
esxVI_ObjectUpdate **objectUpdate);
|
||||
int esxVI_ObjectUpdate_Alloc(esxVI_ObjectUpdate **objectUpdate);
|
||||
void esxVI_ObjectUpdate_Free(esxVI_ObjectUpdate **objectUpdateList);
|
||||
int esxVI_ObjectUpdate_AppendToList(virConnectPtr conn,
|
||||
esxVI_ObjectUpdate **objectUpdateList,
|
||||
int esxVI_ObjectUpdate_AppendToList(esxVI_ObjectUpdate **objectUpdateList,
|
||||
esxVI_ObjectUpdate *objectUpdate);
|
||||
int esxVI_ObjectUpdate_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
int esxVI_ObjectUpdate_Deserialize(xmlNodePtr node,
|
||||
esxVI_ObjectUpdate **objectUpdate);
|
||||
int esxVI_ObjectUpdate_DeserializeList(virConnectPtr conn, xmlNodePtr node,
|
||||
int esxVI_ObjectUpdate_DeserializeList(xmlNodePtr node,
|
||||
esxVI_ObjectUpdate **objectUpdateList);
|
||||
|
||||
|
||||
@ -806,20 +735,16 @@ struct _esxVI_PropertyFilterUpdate {
|
||||
};
|
||||
|
||||
int esxVI_PropertyFilterUpdate_Alloc
|
||||
(virConnectPtr conn,
|
||||
esxVI_PropertyFilterUpdate **propertyFilterUpdate);
|
||||
(esxVI_PropertyFilterUpdate **propertyFilterUpdate);
|
||||
void esxVI_PropertyFilterUpdate_Free
|
||||
(esxVI_PropertyFilterUpdate **propertyFilterUpdateList);
|
||||
int esxVI_PropertyFilterUpdate_AppendToList
|
||||
(virConnectPtr conn,
|
||||
esxVI_PropertyFilterUpdate **propertyFilterUpdateList,
|
||||
(esxVI_PropertyFilterUpdate **propertyFilterUpdateList,
|
||||
esxVI_PropertyFilterUpdate *propertyFilterUpdate);
|
||||
int esxVI_PropertyFilterUpdate_Deserialize
|
||||
(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_PropertyFilterUpdate **propertyFilterUpdate);
|
||||
(xmlNodePtr node, esxVI_PropertyFilterUpdate **propertyFilterUpdate);
|
||||
int esxVI_PropertyFilterUpdate_DeserializeList
|
||||
(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_PropertyFilterUpdate **propertyFilterUpdateList);
|
||||
(xmlNodePtr node, esxVI_PropertyFilterUpdate **propertyFilterUpdateList);
|
||||
|
||||
|
||||
|
||||
@ -841,10 +766,9 @@ struct _esxVI_AboutInfo {
|
||||
char *apiVersion; /* required */
|
||||
};
|
||||
|
||||
int esxVI_AboutInfo_Alloc(virConnectPtr conn, esxVI_AboutInfo **aboutInfo);
|
||||
int esxVI_AboutInfo_Alloc(esxVI_AboutInfo **aboutInfo);
|
||||
void esxVI_AboutInfo_Free(esxVI_AboutInfo **aboutInfo);
|
||||
int esxVI_AboutInfo_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_AboutInfo **aboutInfo);
|
||||
int esxVI_AboutInfo_Deserialize(xmlNodePtr node, esxVI_AboutInfo **aboutInfo);
|
||||
|
||||
|
||||
|
||||
@ -878,10 +802,9 @@ struct _esxVI_ServiceContent {
|
||||
esxVI_ManagedObjectReference *virtualizationManager; /* optional */
|
||||
};
|
||||
|
||||
int esxVI_ServiceContent_Alloc(virConnectPtr conn,
|
||||
esxVI_ServiceContent **serviceContent);
|
||||
int esxVI_ServiceContent_Alloc(esxVI_ServiceContent **serviceContent);
|
||||
void esxVI_ServiceContent_Free(esxVI_ServiceContent **serviceContent);
|
||||
int esxVI_ServiceContent_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
int esxVI_ServiceContent_Deserialize(xmlNodePtr node,
|
||||
esxVI_ServiceContent **serviceContent);
|
||||
|
||||
|
||||
@ -895,10 +818,9 @@ struct _esxVI_UpdateSet {
|
||||
esxVI_PropertyFilterUpdate *filterSet; /* optional, list */
|
||||
};
|
||||
|
||||
int esxVI_UpdateSet_Alloc(virConnectPtr conn, esxVI_UpdateSet **updateSet);
|
||||
int esxVI_UpdateSet_Alloc(esxVI_UpdateSet **updateSet);
|
||||
void esxVI_UpdateSet_Free(esxVI_UpdateSet **updateSet);
|
||||
int esxVI_UpdateSet_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_UpdateSet **updateSet);
|
||||
int esxVI_UpdateSet_Deserialize(xmlNodePtr node, esxVI_UpdateSet **updateSet);
|
||||
|
||||
|
||||
|
||||
@ -911,15 +833,13 @@ struct _esxVI_SharesInfo {
|
||||
esxVI_SharesLevel level; /* required */
|
||||
};
|
||||
|
||||
int esxVI_SharesInfo_Alloc(virConnectPtr conn, esxVI_SharesInfo **sharesInfo);
|
||||
int esxVI_SharesInfo_Alloc(esxVI_SharesInfo **sharesInfo);
|
||||
void esxVI_SharesInfo_Free(esxVI_SharesInfo **sharesInfo);
|
||||
int esxVI_SharesInfo_CastFromAnyType(virConnectPtr conn,
|
||||
esxVI_AnyType *anyType,
|
||||
int esxVI_SharesInfo_CastFromAnyType(esxVI_AnyType *anyType,
|
||||
esxVI_SharesInfo **sharesInfo);
|
||||
int esxVI_SharesInfo_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
int esxVI_SharesInfo_Deserialize(xmlNodePtr node,
|
||||
esxVI_SharesInfo **sharesInfo);
|
||||
int esxVI_SharesInfo_Serialize(virConnectPtr conn,
|
||||
esxVI_SharesInfo *sharesInfo,
|
||||
int esxVI_SharesInfo_Serialize(esxVI_SharesInfo *sharesInfo,
|
||||
const char *element, virBufferPtr output,
|
||||
esxVI_Boolean required);
|
||||
|
||||
@ -938,12 +858,11 @@ struct _esxVI_ResourceAllocationInfo {
|
||||
};
|
||||
|
||||
int esxVI_ResourceAllocationInfo_Alloc
|
||||
(virConnectPtr conn,
|
||||
esxVI_ResourceAllocationInfo **resourceAllocationInfo);
|
||||
(esxVI_ResourceAllocationInfo **resourceAllocationInfo);
|
||||
void esxVI_ResourceAllocationInfo_Free
|
||||
(esxVI_ResourceAllocationInfo **resourceAllocationInfo);
|
||||
int esxVI_ResourceAllocationInfo_Serialize
|
||||
(virConnectPtr conn, esxVI_ResourceAllocationInfo *resourceAllocationInfo,
|
||||
(esxVI_ResourceAllocationInfo *resourceAllocationInfo,
|
||||
const char *element, virBufferPtr output, esxVI_Boolean required);
|
||||
|
||||
|
||||
@ -962,15 +881,14 @@ struct _esxVI_ResourcePoolResourceUsage {
|
||||
};
|
||||
|
||||
int esxVI_ResourcePoolResourceUsage_Alloc
|
||||
(virConnectPtr conn,
|
||||
esxVI_ResourcePoolResourceUsage **resourcePoolResourceUsage);
|
||||
(esxVI_ResourcePoolResourceUsage **resourcePoolResourceUsage);
|
||||
void esxVI_ResourcePoolResourceUsage_Free
|
||||
(esxVI_ResourcePoolResourceUsage **resourcePoolResourceUsage);
|
||||
int esxVI_ResourcePoolResourceUsage_CastFromAnyType
|
||||
(virConnectPtr conn, esxVI_AnyType *anyType,
|
||||
(esxVI_AnyType *anyType,
|
||||
esxVI_ResourcePoolResourceUsage **resourcePoolResourceUsage);
|
||||
int esxVI_ResourcePoolResourceUsage_Deserialize
|
||||
(virConnectPtr conn, xmlNodePtr node,
|
||||
(xmlNodePtr node,
|
||||
esxVI_ResourcePoolResourceUsage **resourcePoolResourceUsage);
|
||||
|
||||
|
||||
@ -1013,13 +931,11 @@ struct _esxVI_VirtualMachineConfigSpec {
|
||||
};
|
||||
|
||||
int esxVI_VirtualMachineConfigSpec_Alloc
|
||||
(virConnectPtr conn,
|
||||
esxVI_VirtualMachineConfigSpec **virtualMachineConfigSpec);
|
||||
(esxVI_VirtualMachineConfigSpec **virtualMachineConfigSpec);
|
||||
void esxVI_VirtualMachineConfigSpec_Free
|
||||
(esxVI_VirtualMachineConfigSpec **virtualMachineConfigSpec);
|
||||
int esxVI_VirtualMachineConfigSpec_Serialize
|
||||
(virConnectPtr conn,
|
||||
esxVI_VirtualMachineConfigSpec *virtualMachineConfigSpec,
|
||||
(esxVI_VirtualMachineConfigSpec *virtualMachineConfigSpec,
|
||||
const char *element, virBufferPtr output, esxVI_Boolean required);
|
||||
|
||||
|
||||
@ -1043,12 +959,10 @@ struct _esxVI_Event {
|
||||
char *fullFormattedMessage; /* optional */
|
||||
};
|
||||
|
||||
int esxVI_Event_Alloc(virConnectPtr conn, esxVI_Event **event);
|
||||
int esxVI_Event_Alloc(esxVI_Event **event);
|
||||
void esxVI_Event_Free(esxVI_Event **eventList);
|
||||
int esxVI_Event_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_Event **event);
|
||||
int esxVI_Event_DeserializeList(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_Event **eventList);
|
||||
int esxVI_Event_Deserialize(xmlNodePtr node, esxVI_Event **event);
|
||||
int esxVI_Event_DeserializeList(xmlNodePtr node, esxVI_Event **eventList);
|
||||
|
||||
|
||||
|
||||
@ -1066,13 +980,11 @@ struct _esxVI_UserSession {
|
||||
char *messageLocale; /* required */
|
||||
};
|
||||
|
||||
int esxVI_UserSession_Alloc(virConnectPtr conn,
|
||||
esxVI_UserSession **userSession);
|
||||
int esxVI_UserSession_Alloc(esxVI_UserSession **userSession);
|
||||
void esxVI_UserSession_Free(esxVI_UserSession **userSession);
|
||||
int esxVI_UserSession_CastFromAnyType(virConnectPtr conn,
|
||||
esxVI_AnyType *anyType,
|
||||
int esxVI_UserSession_CastFromAnyType(esxVI_AnyType *anyType,
|
||||
esxVI_UserSession **userSession);
|
||||
int esxVI_UserSession_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
int esxVI_UserSession_Deserialize(xmlNodePtr node,
|
||||
esxVI_UserSession **userSession);
|
||||
|
||||
|
||||
@ -1090,15 +1002,14 @@ struct _esxVI_VirtualMachineQuestionInfo {
|
||||
};
|
||||
|
||||
int esxVI_VirtualMachineQuestionInfo_Alloc
|
||||
(virConnectPtr conn,
|
||||
esxVI_VirtualMachineQuestionInfo **virtualMachineQuestionInfo);
|
||||
(esxVI_VirtualMachineQuestionInfo **virtualMachineQuestionInfo);
|
||||
void esxVI_VirtualMachineQuestionInfo_Free
|
||||
(esxVI_VirtualMachineQuestionInfo **virtualMachineQuestionInfo);
|
||||
int esxVI_VirtualMachineQuestionInfo_CastFromAnyType
|
||||
(virConnectPtr conn, esxVI_AnyType *anyType,
|
||||
(esxVI_AnyType *anyType,
|
||||
esxVI_VirtualMachineQuestionInfo **virtualMachineQuestionInfo);
|
||||
int esxVI_VirtualMachineQuestionInfo_Deserialize
|
||||
(virConnectPtr conn, xmlNodePtr node,
|
||||
(xmlNodePtr node,
|
||||
esxVI_VirtualMachineQuestionInfo **virtualMachineQuestionInfo);
|
||||
|
||||
|
||||
@ -1123,15 +1034,14 @@ struct _esxVI_ElementDescription {
|
||||
};
|
||||
|
||||
int esxVI_ElementDescription_Alloc
|
||||
(virConnectPtr conn, esxVI_ElementDescription **elementDescription);
|
||||
(esxVI_ElementDescription **elementDescription);
|
||||
void esxVI_ElementDescription_Free
|
||||
(esxVI_ElementDescription **elementDescription);
|
||||
int esxVI_ElementDescription_AppendToList
|
||||
(virConnectPtr conn, esxVI_ElementDescription **elementDescriptionList,
|
||||
(esxVI_ElementDescription **elementDescriptionList,
|
||||
esxVI_ElementDescription *elementDescription);
|
||||
int esxVI_ElementDescription_Deserialize
|
||||
(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_ElementDescription **elementDescription);
|
||||
(xmlNodePtr node, esxVI_ElementDescription **elementDescription);
|
||||
|
||||
|
||||
|
||||
@ -1152,10 +1062,9 @@ struct _esxVI_ChoiceOption {
|
||||
esxVI_Int *defaultIndex; /* optional */
|
||||
};
|
||||
|
||||
int esxVI_ChoiceOption_Alloc(virConnectPtr conn,
|
||||
esxVI_ChoiceOption **choiceOption);
|
||||
int esxVI_ChoiceOption_Alloc(esxVI_ChoiceOption **choiceOption);
|
||||
void esxVI_ChoiceOption_Free(esxVI_ChoiceOption **choiceOption);
|
||||
int esxVI_ChoiceOption_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
int esxVI_ChoiceOption_Deserialize(xmlNodePtr node,
|
||||
esxVI_ChoiceOption **choiceOption);
|
||||
|
||||
|
||||
@ -1171,20 +1080,17 @@ struct _esxVI_PerfMetricId {
|
||||
char *instance; /* required */
|
||||
};
|
||||
|
||||
int esxVI_PerfMetricId_Alloc(virConnectPtr conn,
|
||||
esxVI_PerfMetricId **perfMetricId);
|
||||
int esxVI_PerfMetricId_Alloc(esxVI_PerfMetricId **perfMetricId);
|
||||
void esxVI_PerfMetricId_Free(esxVI_PerfMetricId **perfMetricId);
|
||||
int esxVI_PerfMetricId_Serialize(virConnectPtr conn,
|
||||
esxVI_PerfMetricId *perfMetricId,
|
||||
int esxVI_PerfMetricId_Serialize(esxVI_PerfMetricId *perfMetricId,
|
||||
const char *element, virBufferPtr output,
|
||||
esxVI_Boolean required);
|
||||
int esxVI_PerfMetricId_SerializeList(virConnectPtr conn,
|
||||
esxVI_PerfMetricId *perfMetricIdList,
|
||||
int esxVI_PerfMetricId_SerializeList(esxVI_PerfMetricId *perfMetricIdList,
|
||||
const char *element, virBufferPtr output,
|
||||
esxVI_Boolean required);
|
||||
int esxVI_PerfMetricId_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
int esxVI_PerfMetricId_Deserialize(xmlNodePtr node,
|
||||
esxVI_PerfMetricId **perfMetricId);
|
||||
int esxVI_PerfMetricId_DeserializeList(virConnectPtr conn, xmlNodePtr node,
|
||||
int esxVI_PerfMetricId_DeserializeList(xmlNodePtr node,
|
||||
esxVI_PerfMetricId **perfMetricIdList);
|
||||
|
||||
|
||||
@ -1206,14 +1112,12 @@ struct _esxVI_PerfCounterInfo {
|
||||
esxVI_Int *associatedCounterId; /* optional, list */
|
||||
};
|
||||
|
||||
int esxVI_PerfCounterInfo_Alloc(virConnectPtr conn,
|
||||
esxVI_PerfCounterInfo **perfCounterInfo);
|
||||
int esxVI_PerfCounterInfo_Alloc(esxVI_PerfCounterInfo **perfCounterInfo);
|
||||
void esxVI_PerfCounterInfo_Free(esxVI_PerfCounterInfo **perfCounterInfo);
|
||||
int esxVI_PerfCounterInfo_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
int esxVI_PerfCounterInfo_Deserialize(xmlNodePtr node,
|
||||
esxVI_PerfCounterInfo **perfCounterInfo);
|
||||
int esxVI_PerfCounterInfo_DeserializeList
|
||||
(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_PerfCounterInfo **perfCounterInfoList);
|
||||
(xmlNodePtr node, esxVI_PerfCounterInfo **perfCounterInfoList);
|
||||
|
||||
|
||||
|
||||
@ -1233,15 +1137,12 @@ struct _esxVI_PerfQuerySpec {
|
||||
char *format; /* optional */ // FIXME: see PerfFormat
|
||||
};
|
||||
|
||||
int esxVI_PerfQuerySpec_Alloc(virConnectPtr conn,
|
||||
esxVI_PerfQuerySpec **perfQuerySpec);
|
||||
int esxVI_PerfQuerySpec_Alloc(esxVI_PerfQuerySpec **perfQuerySpec);
|
||||
void esxVI_PerfQuerySpec_Free(esxVI_PerfQuerySpec **perfQuerySpec);
|
||||
int esxVI_PerfQuerySpec_Serialize(virConnectPtr conn,
|
||||
esxVI_PerfQuerySpec *perfQuerySpec,
|
||||
int esxVI_PerfQuerySpec_Serialize(esxVI_PerfQuerySpec *perfQuerySpec,
|
||||
const char *element, virBufferPtr output,
|
||||
esxVI_Boolean required);
|
||||
int esxVI_PerfQuerySpec_SerializeList(virConnectPtr conn,
|
||||
esxVI_PerfQuerySpec *perfQuerySpecList,
|
||||
int esxVI_PerfQuerySpec_SerializeList(esxVI_PerfQuerySpec *perfQuerySpecList,
|
||||
const char *element, virBufferPtr output,
|
||||
esxVI_Boolean required);
|
||||
|
||||
@ -1258,17 +1159,14 @@ struct _esxVI_PerfSampleInfo {
|
||||
esxVI_Int *interval; /* required */
|
||||
};
|
||||
|
||||
int esxVI_PerfSampleInfo_Alloc(virConnectPtr conn,
|
||||
esxVI_PerfSampleInfo **perfSampleInfo);
|
||||
int esxVI_PerfSampleInfo_Alloc(esxVI_PerfSampleInfo **perfSampleInfo);
|
||||
void esxVI_PerfSampleInfo_Free(esxVI_PerfSampleInfo **perfSampleInfo);
|
||||
int esxVI_PerfSampleInfo_AppendToList(virConnectPtr conn,
|
||||
esxVI_PerfSampleInfo **perfSampleInfoList,
|
||||
int esxVI_PerfSampleInfo_AppendToList(esxVI_PerfSampleInfo **perfSampleInfoList,
|
||||
esxVI_PerfSampleInfo *perfSampleInfo);
|
||||
int esxVI_PerfSampleInfo_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
int esxVI_PerfSampleInfo_Deserialize(xmlNodePtr node,
|
||||
esxVI_PerfSampleInfo **perfSampleInfo);
|
||||
int esxVI_PerfSampleInfo_DeserializeList
|
||||
(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_PerfSampleInfo **perfSampleInfoList);
|
||||
(xmlNodePtr node, esxVI_PerfSampleInfo **perfSampleInfoList);
|
||||
|
||||
|
||||
|
||||
@ -1292,15 +1190,14 @@ struct _esxVI_PerfMetricIntSeries {
|
||||
};
|
||||
|
||||
int esxVI_PerfMetricIntSeries_Alloc
|
||||
(virConnectPtr conn, esxVI_PerfMetricIntSeries **perfMetricIntSeries);
|
||||
(esxVI_PerfMetricIntSeries **perfMetricIntSeries);
|
||||
void esxVI_PerfMetricIntSeries_Free
|
||||
(esxVI_PerfMetricIntSeries **perfMetricIntSeries);
|
||||
int esxVI_PerfMetricIntSeries_AppendToList
|
||||
(virConnectPtr conn, esxVI_PerfMetricIntSeries **perfMetricIntSeriesList,
|
||||
(esxVI_PerfMetricIntSeries **perfMetricIntSeriesList,
|
||||
esxVI_PerfMetricIntSeries *perfMetricIntSeries);
|
||||
int esxVI_PerfMetricIntSeries_Deserialize
|
||||
(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_PerfMetricIntSeries **perfMetricIntSeries);
|
||||
(xmlNodePtr node, esxVI_PerfMetricIntSeries **perfMetricIntSeries);
|
||||
|
||||
|
||||
|
||||
@ -1328,16 +1225,13 @@ struct _esxVI_PerfEntityMetric {
|
||||
esxVI_PerfMetricIntSeries *value; /* optional, list */
|
||||
};
|
||||
|
||||
int esxVI_PerfEntityMetric_Alloc(virConnectPtr conn,
|
||||
esxVI_PerfEntityMetric **perfEntityMetric);
|
||||
int esxVI_PerfEntityMetric_Alloc(esxVI_PerfEntityMetric **perfEntityMetric);
|
||||
void esxVI_PerfEntityMetric_Free
|
||||
(esxVI_PerfEntityMetric **perfEntityMetric);
|
||||
int esxVI_PerfEntityMetric_Deserialize
|
||||
(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_PerfEntityMetric **perfEntityMetric);
|
||||
(xmlNodePtr node, esxVI_PerfEntityMetric **perfEntityMetric);
|
||||
int esxVI_PerfEntityMetric_DeserializeList
|
||||
(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_PerfEntityMetric **perfEntityMetricList);
|
||||
(xmlNodePtr node, esxVI_PerfEntityMetric **perfEntityMetricList);
|
||||
|
||||
|
||||
|
||||
@ -1368,14 +1262,12 @@ struct _esxVI_TaskInfo {
|
||||
esxVI_Int *eventChainId; /* required */
|
||||
};
|
||||
|
||||
int esxVI_TaskInfo_Alloc(virConnectPtr conn, esxVI_TaskInfo **taskInfo);
|
||||
int esxVI_TaskInfo_Alloc(esxVI_TaskInfo **taskInfo);
|
||||
void esxVI_TaskInfo_Free(esxVI_TaskInfo **taskInfoList);
|
||||
int esxVI_TaskInfo_CastFromAnyType(virConnectPtr conn, esxVI_AnyType *anyType,
|
||||
int esxVI_TaskInfo_CastFromAnyType(esxVI_AnyType *anyType,
|
||||
esxVI_TaskInfo **taskInfo);
|
||||
int esxVI_TaskInfo_AppendToList(virConnectPtr conn,
|
||||
esxVI_TaskInfo **taskInfoList,
|
||||
int esxVI_TaskInfo_AppendToList(esxVI_TaskInfo **taskInfoList,
|
||||
esxVI_TaskInfo *taskInfo);
|
||||
int esxVI_TaskInfo_Deserialize(virConnectPtr conn, xmlNodePtr node,
|
||||
esxVI_TaskInfo **taskInfo);
|
||||
int esxVI_TaskInfo_Deserialize(xmlNodePtr node, esxVI_TaskInfo **taskInfo);
|
||||
|
||||
#endif /* __ESX_VI_TYPES_H__ */
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -29,24 +29,20 @@
|
||||
#include "esx_vi.h"
|
||||
|
||||
int
|
||||
esxVMX_SCSIDiskNameToControllerAndID(virConnectPtr conn, const char *name,
|
||||
int *controller, int *id);
|
||||
esxVMX_SCSIDiskNameToControllerAndID(const char *name, int *controller, int *id);
|
||||
|
||||
int
|
||||
esxVMX_IDEDiskNameToControllerAndID(virConnectPtr conn, const char *name,
|
||||
int *controller, int *id);
|
||||
esxVMX_IDEDiskNameToControllerAndID(const char *name, int *controller, int *id);
|
||||
|
||||
int
|
||||
esxVMX_FloppyDiskNameToController(virConnectPtr conn, const char *name,
|
||||
int *controller);
|
||||
esxVMX_FloppyDiskNameToController(const char *name, int *controller);
|
||||
|
||||
int
|
||||
esxVMX_GatherSCSIControllers(virConnectPtr conn, virDomainDefPtr conf,
|
||||
char *virtualDev[4], int present[4]);
|
||||
esxVMX_GatherSCSIControllers(virDomainDefPtr conf, char *virtualDev[4],
|
||||
int present[4]);
|
||||
|
||||
char *
|
||||
esxVMX_AbsolutePathToDatastoreRelatedPath(virConnectPtr conn,
|
||||
esxVI_Context *ctx,
|
||||
esxVMX_AbsolutePathToDatastoreRelatedPath(esxVI_Context *ctx,
|
||||
const char *absolutePath);
|
||||
|
||||
|
||||
@ -56,40 +52,38 @@ esxVMX_AbsolutePathToDatastoreRelatedPath(virConnectPtr conn,
|
||||
*/
|
||||
|
||||
char *
|
||||
esxVMX_ParseFileName(virConnectPtr conn, esxVI_Context *ctx,
|
||||
const char *fileName, const char *datastoreName,
|
||||
const char *directoryName);
|
||||
esxVMX_ParseFileName(esxVI_Context *ctx, const char *fileName,
|
||||
const char *datastoreName, const char *directoryName);
|
||||
|
||||
virDomainDefPtr
|
||||
esxVMX_ParseConfig(virConnectPtr conn, esxVI_Context *ctx, const char *vmx,
|
||||
esxVMX_ParseConfig(esxVI_Context *ctx, const char *vmx,
|
||||
const char *datastoreName, const char *directoryName,
|
||||
esxVI_APIVersion apiVersion);
|
||||
|
||||
int
|
||||
esxVMX_ParseVNC(virConnectPtr conn, virConfPtr conf, virDomainGraphicsDefPtr *def);
|
||||
esxVMX_ParseVNC(virConfPtr conf, virDomainGraphicsDefPtr *def);
|
||||
|
||||
int
|
||||
esxVMX_ParseSCSIController(virConnectPtr conn, virConfPtr conf,
|
||||
int controller, int *present, char **virtualDev);
|
||||
esxVMX_ParseSCSIController(virConfPtr conf, int controller, int *present,
|
||||
char **virtualDev);
|
||||
|
||||
int
|
||||
esxVMX_ParseDisk(virConnectPtr conn, esxVI_Context *ctx, virConfPtr conf,
|
||||
int device, int bus, int controller, int id,
|
||||
const char *virtualDev, const char *datastoreName,
|
||||
const char *directoryName, virDomainDiskDefPtr *def);
|
||||
esxVMX_ParseDisk(esxVI_Context *ctx, virConfPtr conf, int device, int bus,
|
||||
int controller, int id, const char *virtualDev,
|
||||
const char *datastoreName, const char *directoryName,
|
||||
virDomainDiskDefPtr *def);
|
||||
int
|
||||
esxVMX_ParseEthernet(virConnectPtr conn, virConfPtr conf, int controller,
|
||||
virDomainNetDefPtr *def);
|
||||
esxVMX_ParseEthernet(virConfPtr conf, int controller, virDomainNetDefPtr *def);
|
||||
|
||||
int
|
||||
esxVMX_ParseSerial(virConnectPtr conn, esxVI_Context *ctx, virConfPtr conf,
|
||||
int port, const char *datastoreName,
|
||||
const char *directoryName, virDomainChrDefPtr *def);
|
||||
esxVMX_ParseSerial(esxVI_Context *ctx, virConfPtr conf, int port,
|
||||
const char *datastoreName, const char *directoryName,
|
||||
virDomainChrDefPtr *def);
|
||||
|
||||
int
|
||||
esxVMX_ParseParallel(virConnectPtr conn, esxVI_Context *ctx, virConfPtr conf,
|
||||
int port, const char *datastoreName,
|
||||
const char *directoryName, virDomainChrDefPtr *def);
|
||||
esxVMX_ParseParallel(esxVI_Context *ctx, virConfPtr conf, int port,
|
||||
const char *datastoreName, const char *directoryName,
|
||||
virDomainChrDefPtr *def);
|
||||
|
||||
|
||||
|
||||
@ -98,37 +92,37 @@ esxVMX_ParseParallel(virConnectPtr conn, esxVI_Context *ctx, virConfPtr conf,
|
||||
*/
|
||||
|
||||
char *
|
||||
esxVMX_FormatFileName(virConnectPtr conn, esxVI_Context *ctx, const char *src);
|
||||
esxVMX_FormatFileName(esxVI_Context *ctx, const char *src);
|
||||
|
||||
char *
|
||||
esxVMX_FormatConfig(virConnectPtr conn, esxVI_Context *ctx,
|
||||
virDomainDefPtr def, esxVI_APIVersion apiVersion);
|
||||
esxVMX_FormatConfig(esxVI_Context *ctx, virDomainDefPtr def,
|
||||
esxVI_APIVersion apiVersion);
|
||||
|
||||
int
|
||||
esxVMX_FormatVNC(virConnectPtr conn, virDomainGraphicsDefPtr def, virBufferPtr buffer);
|
||||
esxVMX_FormatVNC(virDomainGraphicsDefPtr def, virBufferPtr buffer);
|
||||
|
||||
int
|
||||
esxVMX_FormatHardDisk(virConnectPtr conn, esxVI_Context *ctx,
|
||||
virDomainDiskDefPtr def, virBufferPtr buffer);
|
||||
esxVMX_FormatHardDisk(esxVI_Context *ctx, virDomainDiskDefPtr def,
|
||||
virBufferPtr buffer);
|
||||
|
||||
int
|
||||
esxVMX_FormatCDROM(virConnectPtr conn, esxVI_Context *ctx,
|
||||
virDomainDiskDefPtr def, virBufferPtr buffer);
|
||||
esxVMX_FormatCDROM(esxVI_Context *ctx, virDomainDiskDefPtr def,
|
||||
virBufferPtr buffer);
|
||||
|
||||
int
|
||||
esxVMX_FormatFloppy(virConnectPtr conn, esxVI_Context *ctx,
|
||||
virDomainDiskDefPtr def, virBufferPtr buffer);
|
||||
esxVMX_FormatFloppy(esxVI_Context *ctx, virDomainDiskDefPtr def,
|
||||
virBufferPtr buffer);
|
||||
|
||||
int
|
||||
esxVMX_FormatEthernet(virConnectPtr conn, virDomainNetDefPtr def,
|
||||
int controller, virBufferPtr buffer);
|
||||
esxVMX_FormatEthernet(virDomainNetDefPtr def, int controller,
|
||||
virBufferPtr buffer);
|
||||
|
||||
int
|
||||
esxVMX_FormatSerial(virConnectPtr conn, esxVI_Context *ctx,
|
||||
virDomainChrDefPtr def, virBufferPtr buffer);
|
||||
esxVMX_FormatSerial(esxVI_Context *ctx, virDomainChrDefPtr def,
|
||||
virBufferPtr buffer);
|
||||
|
||||
int
|
||||
esxVMX_FormatParallel(virConnectPtr conn, esxVI_Context *ctx,
|
||||
virDomainChrDefPtr def, virBufferPtr buffer);
|
||||
esxVMX_FormatParallel(esxVI_Context *ctx, virDomainChrDefPtr def,
|
||||
virBufferPtr buffer);
|
||||
|
||||
#endif /* __ESX_VMX_H__ */
|
||||
|
@ -122,8 +122,7 @@ testParseDatastoreRelatedPath(const void *data ATTRIBUTE_UNUSED)
|
||||
VIR_FREE(directoryName);
|
||||
VIR_FREE(fileName);
|
||||
|
||||
if (esxUtil_ParseDatastoreRelatedPath(NULL,
|
||||
paths[i].datastoreRelatedPath,
|
||||
if (esxUtil_ParseDatastoreRelatedPath(paths[i].datastoreRelatedPath,
|
||||
&datastoreName, &directoryName,
|
||||
&fileName) != paths[i].result) {
|
||||
goto failure;
|
||||
|
@ -35,7 +35,7 @@ testCompareFiles(const char *vmx, const char *xml, esxVI_APIVersion apiVersion)
|
||||
goto failure;
|
||||
}
|
||||
|
||||
def = esxVMX_ParseConfig(NULL, NULL, vmxData, "datastore", "directory",
|
||||
def = esxVMX_ParseConfig(NULL, vmxData, "datastore", "directory",
|
||||
apiVersion);
|
||||
|
||||
if (def == NULL) {
|
||||
|
@ -89,7 +89,7 @@ testCompareFiles(const char *xml, const char *vmx, esxVI_APIVersion apiVersion)
|
||||
goto failure;
|
||||
}
|
||||
|
||||
formatted = esxVMX_FormatConfig(NULL, NULL, def, apiVersion);
|
||||
formatted = esxVMX_FormatConfig(NULL, def, apiVersion);
|
||||
|
||||
if (formatted == NULL) {
|
||||
goto failure;
|
||||
|
Loading…
x
Reference in New Issue
Block a user