mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
hyperv: remove hypervWmiClassInfoList, hypervWmiClassInfoListPtr, and _hypervWmiClassInfoList
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Matt Coleman <matt@datto.com>
This commit is contained in:
parent
0e43ccb838
commit
8a9eb5de0c
@ -57,7 +57,7 @@ class WmiClass:
|
|||||||
header += "#define %s_WQL_SELECT \\\n" % name_upper
|
header += "#define %s_WQL_SELECT \\\n" % name_upper
|
||||||
header += " \"SELECT * FROM %s \"\n" % self.name
|
header += " \"SELECT * FROM %s \"\n" % self.name
|
||||||
header += "\n"
|
header += "\n"
|
||||||
header += "extern hypervWmiClassInfoListPtr %s_WmiInfo;\n\n" % self.name
|
header += "extern hypervWmiClassInfoPtr %s_WmiInfo;\n\n" % self.name
|
||||||
|
|
||||||
header += self._declare_data_structs()
|
header += self._declare_data_structs()
|
||||||
header += self._declare_hypervObject_struct()
|
header += self._declare_hypervObject_struct()
|
||||||
@ -143,19 +143,12 @@ class WmiClass:
|
|||||||
This struct holds info with meta-data needed to make wsman requests for the WMI class.
|
This struct holds info with meta-data needed to make wsman requests for the WMI class.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
source = "hypervWmiClassInfoListPtr %s_WmiInfo = &(hypervWmiClassInfoList) {\n" % self.name
|
source = "hypervWmiClassInfoPtr %s_WmiInfo = &(hypervWmiClassInfo) {\n" % self.name
|
||||||
source += " .count = 1,\n"
|
|
||||||
source += " .objs = (hypervWmiClassInfoPtr []) {\n"
|
|
||||||
|
|
||||||
source += " &(hypervWmiClassInfo) {\n"
|
|
||||||
source += " .name = %s_CLASSNAME,\n" % self.name.upper()
|
source += " .name = %s_CLASSNAME,\n" % self.name.upper()
|
||||||
source += " .rootUri = %s,\n" % self.uri_info.rootUri
|
source += " .rootUri = %s,\n" % self.uri_info.rootUri
|
||||||
source += " .resourceUri = %s_RESOURCE_URI,\n" % self.name.upper()
|
source += " .resourceUri = %s_RESOURCE_URI,\n" % self.name.upper()
|
||||||
source += " .serializerInfo = %s_Data_TypeInfo,\n" % self.name
|
source += " .serializerInfo = %s_Data_TypeInfo,\n" % self.name
|
||||||
source += " .propertyInfo = %s_Typemap\n" % self.name
|
source += " .propertyInfo = %s_Typemap\n" % self.name
|
||||||
source += " },\n"
|
|
||||||
|
|
||||||
source += " }\n"
|
|
||||||
source += "};\n"
|
source += "};\n"
|
||||||
|
|
||||||
return source
|
return source
|
||||||
|
@ -47,16 +47,8 @@
|
|||||||
|
|
||||||
VIR_LOG_INIT("hyperv.hyperv_wmi");
|
VIR_LOG_INIT("hyperv.hyperv_wmi");
|
||||||
|
|
||||||
static int
|
|
||||||
hypervGetWmiClassInfo(hypervWmiClassInfoListPtr list, hypervWmiClassInfoPtr *info)
|
|
||||||
{
|
|
||||||
*info = list->objs[0];
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
hypervGetWmiClassList(hypervPrivate *priv, hypervWmiClassInfoListPtr wmiInfo,
|
hypervGetWmiClassList(hypervPrivate *priv, hypervWmiClassInfoPtr wmiInfo,
|
||||||
virBufferPtr query, hypervObject **wmiClass)
|
virBufferPtr query, hypervObject **wmiClass)
|
||||||
{
|
{
|
||||||
hypervWqlQuery wqlQuery = HYPERV_WQL_QUERY_INITIALIZER;
|
hypervWqlQuery wqlQuery = HYPERV_WQL_QUERY_INITIALIZER;
|
||||||
@ -141,13 +133,9 @@ hypervVerifyResponse(WsManClient *client, WsXmlDocH response,
|
|||||||
hypervInvokeParamsListPtr
|
hypervInvokeParamsListPtr
|
||||||
hypervCreateInvokeParamsList(const char *method,
|
hypervCreateInvokeParamsList(const char *method,
|
||||||
const char *selector,
|
const char *selector,
|
||||||
hypervWmiClassInfoListPtr obj)
|
hypervWmiClassInfoPtr info)
|
||||||
{
|
{
|
||||||
hypervInvokeParamsListPtr params = NULL;
|
hypervInvokeParamsListPtr params = NULL;
|
||||||
hypervWmiClassInfoPtr info = NULL;
|
|
||||||
|
|
||||||
if (hypervGetWmiClassInfo(obj, &info) < 0)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
params = g_new0(hypervInvokeParamsList, 1);
|
params = g_new0(hypervInvokeParamsList, 1);
|
||||||
|
|
||||||
@ -259,13 +247,11 @@ int
|
|||||||
hypervAddEprParam(hypervInvokeParamsListPtr params,
|
hypervAddEprParam(hypervInvokeParamsListPtr params,
|
||||||
const char *name,
|
const char *name,
|
||||||
virBufferPtr query,
|
virBufferPtr query,
|
||||||
hypervWmiClassInfoListPtr eprInfo)
|
hypervWmiClassInfoPtr classInfo)
|
||||||
{
|
{
|
||||||
hypervParamPtr p = NULL;
|
hypervParamPtr p = NULL;
|
||||||
hypervWmiClassInfoPtr classInfo = NULL;
|
|
||||||
|
|
||||||
if (hypervGetWmiClassInfo(eprInfo, &classInfo) < 0 ||
|
if (hypervCheckParams(params) < 0)
|
||||||
hypervCheckParams(params) < 0)
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
p = ¶ms->params[params->nbParams];
|
p = ¶ms->params[params->nbParams];
|
||||||
@ -290,17 +276,12 @@ hypervAddEprParam(hypervInvokeParamsListPtr params,
|
|||||||
* Returns a pointer to the GHashTable on success, otherwise NULL.
|
* Returns a pointer to the GHashTable on success, otherwise NULL.
|
||||||
*/
|
*/
|
||||||
GHashTable *
|
GHashTable *
|
||||||
hypervCreateEmbeddedParam(hypervWmiClassInfoListPtr info)
|
hypervCreateEmbeddedParam(hypervWmiClassInfoPtr classInfo)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
size_t count;
|
size_t count;
|
||||||
g_autoptr(GHashTable) table = NULL;
|
g_autoptr(GHashTable) table = NULL;
|
||||||
XmlSerializerInfo *typeinfo = NULL;
|
XmlSerializerInfo *typeinfo = NULL;
|
||||||
hypervWmiClassInfoPtr classInfo = NULL;
|
|
||||||
|
|
||||||
/* Get the typeinfo out of the class info list */
|
|
||||||
if (hypervGetWmiClassInfo(info, &classInfo) < 0)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
typeinfo = classInfo->serializerInfo;
|
typeinfo = classInfo->serializerInfo;
|
||||||
|
|
||||||
@ -363,18 +344,13 @@ int
|
|||||||
hypervAddEmbeddedParam(hypervInvokeParamsListPtr params,
|
hypervAddEmbeddedParam(hypervInvokeParamsListPtr params,
|
||||||
const char *name,
|
const char *name,
|
||||||
GHashTable **table,
|
GHashTable **table,
|
||||||
hypervWmiClassInfoListPtr info)
|
hypervWmiClassInfoPtr classInfo)
|
||||||
{
|
{
|
||||||
hypervParamPtr p = NULL;
|
hypervParamPtr p = NULL;
|
||||||
hypervWmiClassInfoPtr classInfo = NULL;
|
|
||||||
|
|
||||||
if (hypervCheckParams(params) < 0)
|
if (hypervCheckParams(params) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* Get the typeinfo out of the class info list */
|
|
||||||
if (hypervGetWmiClassInfo(info, &classInfo) < 0)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
p = ¶ms->params[params->nbParams];
|
p = ¶ms->params[params->nbParams];
|
||||||
p->type = HYPERV_EMBEDDED_PARAM;
|
p->type = HYPERV_EMBEDDED_PARAM;
|
||||||
p->embedded.name = name;
|
p->embedded.name = name;
|
||||||
@ -959,7 +935,7 @@ hypervEnumAndPull(hypervPrivate *priv, hypervWqlQueryPtr wqlQuery,
|
|||||||
WsSerializerContextH serializerContext;
|
WsSerializerContextH serializerContext;
|
||||||
client_opt_t *options = NULL;
|
client_opt_t *options = NULL;
|
||||||
char *query_string = NULL;
|
char *query_string = NULL;
|
||||||
hypervWmiClassInfoPtr wmiInfo = NULL;
|
hypervWmiClassInfoPtr wmiInfo = wqlQuery->info;
|
||||||
filter_t *filter = NULL;
|
filter_t *filter = NULL;
|
||||||
WsXmlDocH response = NULL;
|
WsXmlDocH response = NULL;
|
||||||
char *enumContext = NULL;
|
char *enumContext = NULL;
|
||||||
@ -977,9 +953,6 @@ hypervEnumAndPull(hypervPrivate *priv, hypervWqlQueryPtr wqlQuery,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hypervGetWmiClassInfo(wqlQuery->info, &wmiInfo) < 0)
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
serializerContext = wsmc_get_serialization_context(priv->client);
|
serializerContext = wsmc_get_serialization_context(priv->client);
|
||||||
|
|
||||||
options = wsmc_options_init();
|
options = wsmc_options_init();
|
||||||
|
@ -56,7 +56,7 @@ typedef struct _hypervWqlQuery hypervWqlQuery;
|
|||||||
typedef hypervWqlQuery *hypervWqlQueryPtr;
|
typedef hypervWqlQuery *hypervWqlQueryPtr;
|
||||||
struct _hypervWqlQuery {
|
struct _hypervWqlQuery {
|
||||||
virBufferPtr query;
|
virBufferPtr query;
|
||||||
hypervWmiClassInfoListPtr info;
|
hypervWmiClassInfoPtr info;
|
||||||
};
|
};
|
||||||
|
|
||||||
int hypervEnumAndPull(hypervPrivate *priv, hypervWqlQueryPtr wqlQuery,
|
int hypervEnumAndPull(hypervPrivate *priv, hypervWqlQueryPtr wqlQuery,
|
||||||
@ -121,7 +121,7 @@ typedef hypervInvokeParamsList *hypervInvokeParamsListPtr;
|
|||||||
|
|
||||||
hypervInvokeParamsListPtr hypervCreateInvokeParamsList(const char *method,
|
hypervInvokeParamsListPtr hypervCreateInvokeParamsList(const char *method,
|
||||||
const char *selector,
|
const char *selector,
|
||||||
hypervWmiClassInfoListPtr obj);
|
hypervWmiClassInfoPtr obj);
|
||||||
|
|
||||||
void hypervFreeInvokeParams(hypervInvokeParamsListPtr params);
|
void hypervFreeInvokeParams(hypervInvokeParamsListPtr params);
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(hypervInvokeParamsList, hypervFreeInvokeParams);
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(hypervInvokeParamsList, hypervFreeInvokeParams);
|
||||||
@ -132,9 +132,9 @@ int hypervAddSimpleParam(hypervInvokeParamsListPtr params, const char *name,
|
|||||||
int hypervAddEprParam(hypervInvokeParamsListPtr params,
|
int hypervAddEprParam(hypervInvokeParamsListPtr params,
|
||||||
const char *name,
|
const char *name,
|
||||||
virBufferPtr query,
|
virBufferPtr query,
|
||||||
hypervWmiClassInfoListPtr eprInfo);
|
hypervWmiClassInfoPtr eprInfo);
|
||||||
|
|
||||||
GHashTable *hypervCreateEmbeddedParam(hypervWmiClassInfoListPtr info);
|
GHashTable *hypervCreateEmbeddedParam(hypervWmiClassInfoPtr info);
|
||||||
|
|
||||||
int hypervSetEmbeddedProperty(GHashTable *table,
|
int hypervSetEmbeddedProperty(GHashTable *table,
|
||||||
const char *name,
|
const char *name,
|
||||||
@ -143,7 +143,7 @@ int hypervSetEmbeddedProperty(GHashTable *table,
|
|||||||
int hypervAddEmbeddedParam(hypervInvokeParamsListPtr params,
|
int hypervAddEmbeddedParam(hypervInvokeParamsListPtr params,
|
||||||
const char *name,
|
const char *name,
|
||||||
GHashTable **table,
|
GHashTable **table,
|
||||||
hypervWmiClassInfoListPtr info);
|
hypervWmiClassInfoPtr info);
|
||||||
|
|
||||||
void hypervFreeEmbeddedParam(GHashTable *p);
|
void hypervFreeEmbeddedParam(GHashTable *p);
|
||||||
|
|
||||||
@ -188,7 +188,8 @@ const char *hypervReturnCodeToString(int returnCode);
|
|||||||
|
|
||||||
|
|
||||||
int hypervGetWmiClassList(hypervPrivate *priv,
|
int hypervGetWmiClassList(hypervPrivate *priv,
|
||||||
hypervWmiClassInfoListPtr wmiInfo, virBufferPtr query,
|
hypervWmiClassInfoPtr wmiInfo,
|
||||||
|
virBufferPtr query,
|
||||||
hypervObject **wmiClass);
|
hypervObject **wmiClass);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -128,12 +128,4 @@ struct _hypervWmiClassInfo {
|
|||||||
hypervCimTypePtr propertyInfo;
|
hypervCimTypePtr propertyInfo;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef struct _hypervWmiClassInfoList hypervWmiClassInfoList;
|
|
||||||
typedef hypervWmiClassInfoList *hypervWmiClassInfoListPtr;
|
|
||||||
struct _hypervWmiClassInfoList {
|
|
||||||
size_t count;
|
|
||||||
hypervWmiClassInfoPtr *objs;
|
|
||||||
};
|
|
||||||
|
|
||||||
#include "hyperv_wmi_classes.generated.h"
|
#include "hyperv_wmi_classes.generated.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user