[PATCH 04/11] hyperv: add hypervMsvmVSMSAddResourceSettings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Matt Coleman <matt@xxxxxxxxx>
---
 src/hyperv/hyperv_wmi.c | 52 +++++++++++++++++++++++++++++++++++++++++
 src/hyperv/hyperv_wmi.h |  5 ++++
 2 files changed, 57 insertions(+)

diff --git a/src/hyperv/hyperv_wmi.c b/src/hyperv/hyperv_wmi.c
index 466296fe2a..4bace10874 100644
--- a/src/hyperv/hyperv_wmi.c
+++ b/src/hyperv/hyperv_wmi.c
@@ -1585,6 +1585,58 @@ hypervGetStorageAllocationSD(hypervPrivate *priv,
  * Msvm_VirtualSystemManagementService
  */
 
+int
+hypervMsvmVSMSAddResourceSettings(virDomainPtr domain,
+                                  GHashTable **resourceSettingsPtr,
+                                  hypervWmiClassInfoPtr wmiInfo,
+                                  WsXmlDocH *response)
+{
+    int result = -1;
+    hypervPrivate *priv = domain->conn->privateData;
+    char uuid_string[VIR_UUID_STRING_BUFLEN];
+    Msvm_VirtualSystemSettingData *vssd = NULL;
+    GHashTable *resourceSettings = *resourceSettingsPtr;
+    g_autoptr(hypervInvokeParamsList) params = NULL;
+    g_auto(virBuffer) eprQuery = VIR_BUFFER_INITIALIZER;
+
+    virUUIDFormat(domain->uuid, uuid_string);
+
+    if (hypervGetMsvmVirtualSystemSettingDataFromUUID(priv, uuid_string, &vssd) < 0)
+        goto cleanup;
+
+    virBufferEscapeSQL(&eprQuery,
+                       MSVM_VIRTUALSYSTEMSETTINGDATA_WQL_SELECT "WHERE InstanceID='%s'",
+                       vssd->data->InstanceID);
+
+    params = hypervCreateInvokeParamsList("AddResourceSettings",
+                                          MSVM_VIRTUALSYSTEMMANAGEMENTSERVICE_SELECTOR,
+                                          Msvm_VirtualSystemManagementService_WmiInfo);
+
+    if (!params)
+        goto cleanup;
+
+    if (hypervAddEprParam(params, "AffectedConfiguration",
+                          &eprQuery, Msvm_VirtualSystemSettingData_WmiInfo) < 0)
+        goto cleanup;
+
+    if (hypervAddEmbeddedParam(params, "ResourceSettings", &resourceSettings, wmiInfo) < 0) {
+        hypervFreeEmbeddedParam(resourceSettings);
+        goto cleanup;
+    }
+
+    if (hypervInvokeMethod(priv, &params, response) < 0)
+        goto cleanup;
+
+    result = 0;
+
+ cleanup:
+    hypervFreeObject(priv, (hypervObject *)vssd);
+    *resourceSettingsPtr = NULL;
+
+    return result;
+}
+
+
 int
 hypervMsvmVSMSModifyResourceSettings(hypervPrivate *priv,
                                      GHashTable **resourceSettingsPtr,
diff --git a/src/hyperv/hyperv_wmi.h b/src/hyperv/hyperv_wmi.h
index 31f7e2e3ba..ff96b8063d 100644
--- a/src/hyperv/hyperv_wmi.h
+++ b/src/hyperv/hyperv_wmi.h
@@ -256,6 +256,11 @@ int hypervGetStorageAllocationSD(hypervPrivate *priv,
  * Msvm_VirtualSystemManagementService
  */
 
+int hypervMsvmVSMSAddResourceSettings(virDomainPtr domain,
+                                      GHashTable **resourceSettingsPtr,
+                                      hypervWmiClassInfoPtr wmiInfo,
+                                      WsXmlDocH *response);
+
 int hypervMsvmVSMSModifyResourceSettings(hypervPrivate *priv,
                                          GHashTable **resourceSettingsPtr,
                                          hypervWmiClassInfoPtr wmiInfo);
-- 
2.27.0





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux