]> xenbits.xensource.com Git - libvirt.git/commitdiff
hyperv: add hypervMsvmVSMSModifyResourceSettings
authorMatt Coleman <mcoleman@datto.com>
Wed, 11 Nov 2020 06:48:31 +0000 (01:48 -0500)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 12 Nov 2020 08:43:52 +0000 (09:43 +0100)
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/hyperv/hyperv_wmi.c
src/hyperv/hyperv_wmi.h

index 72a68c0591fbe944c7d32352a0ad667a194292d4..866b347bc27823c238daa5081f334d224aaa5839 100644 (file)
@@ -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, &params, NULL) < 0)
+        goto cleanup;
+
+    result = 0;
+
+ cleanup:
+    *resourceSettingsPtr = NULL;
+
+    return result;
+}
index eb273ba7cfd6b17c8b4b4b673063aa6b8a1ef1c4..34334a0153aad5d69f1b8c492cf4fa6f9b46b23e 100644 (file)
@@ -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);