Signed-off-by: Matt Coleman <matt(a)datto.com>
---
src/hyperv/hyperv_wmi.c | 37 +++++++++++++++++++++++++++++++++++++
src/hyperv/hyperv_wmi.h | 8 ++++++++
2 files changed, 45 insertions(+)
diff --git a/src/hyperv/hyperv_wmi.c b/src/hyperv/hyperv_wmi.c
index 72a68c0591..866b347bc2 100644
--- a/src/hyperv/hyperv_wmi.c
+++ b/src/hyperv/hyperv_wmi.c
@@ -1542,3 +1542,40 @@ hypervGetMemorySD(hypervPrivate *priv,
return 0;
}
+
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Msvm_VirtualSystemManagementService
+ */
+
+int
+hypervMsvmVSMSModifyResourceSettings(hypervPrivate *priv,
+ GHashTable **resourceSettingsPtr,
+ hypervWmiClassInfoPtr wmiInfo)
+{
+ int result = -1;
+ GHashTable *resourceSettings = *resourceSettingsPtr;
+ g_autoptr(hypervInvokeParamsList) params = NULL;
+
+ params = hypervCreateInvokeParamsList("ModifyResourceSettings",
+ MSVM_VIRTUALSYSTEMMANAGEMENTSERVICE_SELECTOR,
+ Msvm_VirtualSystemManagementService_WmiInfo);
+
+ if (!params)
+ goto cleanup;
+
+ if (hypervAddEmbeddedParam(params, "ResourceSettings",
&resourceSettings, wmiInfo) < 0) {
+ hypervFreeEmbeddedParam(resourceSettings);
+ goto cleanup;
+ }
+
+ if (hypervInvokeMethod(priv, ¶ms, NULL) < 0)
+ goto cleanup;
+
+ result = 0;
+
+ cleanup:
+ *resourceSettingsPtr = NULL;
+
+ return result;
+}
diff --git a/src/hyperv/hyperv_wmi.h b/src/hyperv/hyperv_wmi.h
index eb273ba7cf..34334a0153 100644
--- a/src/hyperv/hyperv_wmi.h
+++ b/src/hyperv/hyperv_wmi.h
@@ -243,3 +243,11 @@ int hypervGetProcessorSD(hypervPrivate *priv,
int hypervGetMemorySD(hypervPrivate *priv,
const char *vssd_instanceid,
Msvm_MemorySettingData **list);
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Msvm_VirtualSystemManagementService
+ */
+
+int hypervMsvmVSMSModifyResourceSettings(hypervPrivate *priv,
+ GHashTable **resourceSettingsPtr,
+ hypervWmiClassInfoPtr wmiInfo);
--
2.27.0