Re: [PATCH v3 5/9] hyperv: implement domainReboot and domainReset

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

 



On 10/21/20 10:46 AM, Matt Coleman wrote:
Co-authored-by: Sri Ramanujam <sramanujam@xxxxxxxxx>
Signed-off-by: Matt Coleman <matt@xxxxxxxxx>
---
  src/hyperv/hyperv_driver.c      | 38 +++++++++++++++++++++++++++++++++
  src/hyperv/hyperv_wmi_classes.h |  1 +
  2 files changed, 39 insertions(+)

diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c
index 7387be1ab7..4bddc86273 100644
--- a/src/hyperv/hyperv_driver.c
+++ b/src/hyperv/hyperv_driver.c
@@ -286,6 +286,24 @@ hypervGetMemSDByVSSDInstanceId(hypervPrivate *priv, const char *id,
      return 0;
  }
+static int
+hypervRequestStateChange(virDomainPtr domain, int state)
+{
+    int result = -1;
+    hypervPrivate *priv = domain->conn->privateData;
+    Msvm_ComputerSystem *computerSystem = NULL;
+
+    if (hypervMsvmComputerSystemFromDomain(domain, &computerSystem) < 0)
+        goto cleanup;
+

Should we also check if the domain is running? That is, the same check as hypervDomainSuspend() does with @computerSystem? I can copy the check locally, before pushing.

+    result = hypervInvokeMsvmComputerSystemRequestStateChange(domain, state);
+
+ cleanup:
+    hypervFreeObject(priv, (hypervObject *)computerSystem);
+
+    return result;
+}
+

Michal




[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