Re: [PATCH 3/3] libxl: initialize domain state with real data

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

 



On 08/05/2018 05:01 PM, Marek Marczykowski-Górecki wrote:
When libvirtd is started, initialize domain objects state with its real
state, not only RUNNING/SHUTOFF.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
---
  src/libxl/libxl_driver.c | 11 +++++++++++
  1 file changed, 11 insertions(+)

diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 10c7aab..16b3146 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -412,6 +412,17 @@ libxlReconnectDomain(virDomainObjPtr vm,
                                              vm->def, hostdev_flags) < 0)
          goto error;
+ if (d_info.shutdown &&
+            d_info.shutdown_reason == LIBXL_SHUTDOWN_REASON_SUSPEND)
+        virDomainObjSetState(vm, VIR_DOMAIN_PMSUSPENDED,
+                             VIR_DOMAIN_PMSUSPENDED_UNKNOWN);
+    else if (d_info.paused)
+        virDomainObjSetState(vm, VIR_DOMAIN_PAUSED,
+                             VIR_DOMAIN_PAUSED_UNKNOWN);
+    else
+        virDomainObjSetState(vm, VIR_DOMAIN_RUNNING,
+                             VIR_DOMAIN_RUNNING_UNKNOWN);
+
      if (virAtomicIntInc(&driver->nactive) == 1 && driver->inhibitCallback)
          driver->inhibitCallback(true, driver->inhibitOpaque);

Reviewed-by: Jim Fehlig <jfehlig@xxxxxxxx>

Regards,
Jim

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[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