* wrapper functions for commonly-accessed WMI objects and interfaces.
*/
-/**
- * hypervGetWmiClass:
- * @type: the type of the class being retrieved from WMI
- * @class: double pointer where the class data will be stored
- *
- * Retrieve one or more classes from WMI.
- *
- * The following variables must exist in the caller:
- * 1. hypervPrivate *priv
- * 2. virBuffer query
- */
-#define hypervGetWmiClass(type, class) \
- hypervGetWmiClassList(priv, type ## _WmiInfo, &query, (hypervObject **)class)
-
static int
hypervGetProcessorsByName(hypervPrivate *priv, const char *name,
Win32_Processor **processorList)
MSVM_CONCRETEJOB_WQL_SELECT
"WHERE InstanceID = '%s'", instanceID);
- if (hypervGetWmiClassList(priv, Msvm_ConcreteJob_WmiInfo, &query,
- (hypervObject **)&job) < 0 || job == NULL)
+ if (hypervGetWmiClass(Msvm_ConcreteJob, &job) < 0 || !job)
goto cleanup;
jobState = job->data.common->JobState;
MSVM_CONCRETEJOB_WQL_SELECT
"WHERE InstanceID = '%s'", instanceID);
- if (hypervGetWmiClassList(priv, Msvm_ConcreteJob_WmiInfo, &query,
- (hypervObject **)&concreteJob) < 0)
+ if (hypervGetWmiClass(Msvm_ConcreteJob, &concreteJob) < 0)
goto cleanup;
if (concreteJob == NULL) {
"WHERE " MSVM_COMPUTERSYSTEM_WQL_VIRTUAL
"AND Name = '%s'", uuid);
- if (hypervGetWmiClassList(priv, Msvm_ComputerSystem_WmiInfo, &query,
- (hypervObject **)computerSystem) < 0)
+ if (hypervGetWmiClass(Msvm_ComputerSystem, computerSystem) < 0)
return -1;
if (!*computerSystem) {
"ResultClass = Msvm_VirtualSystemSettingData",
uuid_string);
- if (hypervGetWmiClassList(priv, Msvm_VirtualSystemSettingData_WmiInfo, &query,
- (hypervObject **)list) < 0 || *list == NULL)
+ if (hypervGetWmiClass(Msvm_VirtualSystemSettingData, list) < 0 || !*list)
return -1;
return 0;
"ResultClass = Msvm_MemorySettingData",
vssd_instanceid);
- if (hypervGetWmiClassList(priv, Msvm_MemorySettingData_WmiInfo, &query,
- (hypervObject **)list) < 0 || *list == NULL)
+ if (hypervGetWmiClass(Msvm_MemorySettingData, list) < 0 || !*list)
return -1;
return 0;
hypervWmiClassInfoListPtr wmiInfo, virBufferPtr query,
hypervObject **wmiClass);
+/**
+ * hypervGetWmiClass:
+ * @type: the type of the class being retrieved from WMI
+ * @class: double pointer where the class data will be stored
+ *
+ * Retrieve one or more classes from WMI.
+ *
+ * The following variables must exist in the caller:
+ * 1. hypervPrivate *priv
+ * 2. virBuffer query
+ */
+#define hypervGetWmiClass(type, class) \
+ hypervGetWmiClassList(priv, type ## _WmiInfo, &query, (hypervObject **)class)
+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Msvm_ComputerSystem
*/