[PATCH v1 1/2] qemu_process: set fakereboot flags false after processing fakereboot over

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

 



During the vm rebooting, the vm could be shut down if the libvirtd is
restarted for some reason, which is not expected. We move set
fakereboot flags false after processing fakereboot over, so we can
ensure that fakereboot process have been executed.

Signed-off-by: Bihong Yu <yubihong@xxxxxxxxxx>
---
 src/qemu/qemu_process.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 6027b30405..832ce164fb 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -523,6 +523,7 @@ qemuProcessFakeReboot(void *opaque)
 
  cleanup:
     priv->pausedShutdown = false;
+    qemuDomainSetFakeReboot(driver, vm, false);
     if (ret == -1)
         ignore_value(qemuProcessKill(vm, VIR_QEMU_PROCESS_KILL_FORCE));
     virDomainObjEndAPI(&vm);
@@ -540,7 +541,6 @@ qemuProcessShutdownOrReboot(virQEMUDriver *driver,
         g_autofree char *name = g_strdup_printf("reboot-%s", vm->def->name);
         virThread th;
 
-        qemuDomainSetFakeReboot(driver, vm, false);
         virObjectRef(vm);
         if (virThreadCreateFull(&th,
                                 false,
@@ -551,6 +551,7 @@ qemuProcessShutdownOrReboot(virQEMUDriver *driver,
             VIR_ERROR(_("Failed to create reboot thread, killing domain"));
             ignore_value(qemuProcessKill(vm, VIR_QEMU_PROCESS_KILL_NOWAIT));
             priv->pausedShutdown = false;
+            qemuDomainSetFakeReboot(driver, vm, false);
             virObjectUnref(vm);
         }
     } else {
-- 
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