[PATCH 2/3] qemu: remove excessive check in qemuSnapshotCreateActiveInternal

Nikolay Shirokovskiy nikolay.shirokovskiy at openvz.org
Mon Mar 21 15:16:50 UTC 2022


After [1] it is not possible to get inactive state for domain while
communicating with QEMU (see also [2]).

Also even if it were possible the qemuProcessStopCPUs would return error
and the check would not be reached.

[1] commit 81f50cb92d16643bcd749e3ab5b404b8b7cec643
Author: Jiri Denemark <jdenemar at redhat.com>
Date:   Thu Feb 11 11:20:28 2016 +0100

    qemu: Avoid calling qemuProcessStop without a job

[2] commit f1ea5bd506b6e00aa8bf55940b147d3c0fe7f124
Author: Ján Tomko <jtomko at redhat.com>
Date:   Wed Nov 24 13:41:09 2021 +0100

    qemu: turn qemuDomainObjExitMonitor into void

Signed-off-by: Nikolay Shirokovskiy <nikolay.shirokovskiy at openvz.org>
---
 src/qemu/qemu_snapshot.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
index a41c782c7f..8c050cbd75 100644
--- a/src/qemu/qemu_snapshot.c
+++ b/src/qemu/qemu_snapshot.c
@@ -298,17 +298,10 @@ qemuSnapshotCreateActiveInternal(virQEMUDriver *driver,
     if (!qemuMigrationSrcIsAllowed(driver, vm, false, 0))
         goto cleanup;
 
-    if (halt) {
-        if (qemuProcessStopCPUs(driver, vm, VIR_DOMAIN_PAUSED_SAVE,
-                                QEMU_ASYNC_JOB_SNAPSHOT) < 0)
-            goto cleanup;
-
-        if (!virDomainObjIsActive(vm)) {
-            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                           _("guest unexpectedly quit"));
-            goto cleanup;
-        }
-    }
+    if (halt &&
+        qemuProcessStopCPUs(driver, vm, VIR_DOMAIN_PAUSED_SAVE,
+                            QEMU_ASYNC_JOB_SNAPSHOT) < 0)
+        goto cleanup;
 
     if (qemuDomainObjEnterMonitorAsync(driver, vm,
                                        QEMU_ASYNC_JOB_SNAPSHOT) < 0)
-- 
2.35.1



More information about the libvir-list mailing list