[libvirt] [PATCH 2/9] qemu: snapshot revert: reuse common cleanup code

Nikolay Shirokovskiy posted 9 patches 5 years, 11 months ago
[libvirt] [PATCH 2/9] qemu: snapshot revert: reuse common cleanup code
Posted by Nikolay Shirokovskiy 5 years, 11 months ago
Commit [1] changed cleanup code to first remove inactive domain
and then release job so we can reuse common cleanup code.

[1] 9115dcd83 qemu: Introduce and use qemuDomainRemoveInactiveJob

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
---
 src/qemu/qemu_driver.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 3242a60..f7c1d6f 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -16533,8 +16533,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
 
         if (qemuDomainSnapshotRevertInactive(driver, vm, snap) < 0) {
             qemuDomainRemoveInactive(driver, vm);
-            qemuProcessEndJob(driver, vm);
-            goto cleanup;
+            goto endjob;
         }
         if (config)
             virDomainObjAssignDef(vm, config, false, NULL);
@@ -16554,8 +16553,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
             virDomainAuditStart(vm, "from-snapshot", rc >= 0);
             if (rc < 0) {
                 qemuDomainRemoveInactive(driver, vm);
-                qemuProcessEndJob(driver, vm);
-                goto cleanup;
+                goto endjob;
             }
             detail = VIR_DOMAIN_EVENT_STARTED_FROM_SNAPSHOT;
             event = virDomainEventLifecycleNewFromObj(vm,
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 2/9] qemu: snapshot revert: reuse common cleanup code
Posted by John Ferlan 5 years, 11 months ago

On 12/13/18 3:03 AM, Nikolay Shirokovskiy wrote:
> Commit [1] changed cleanup code to first remove inactive domain
> and then release job so we can reuse common cleanup code.
> 
> [1] 9115dcd83 qemu: Introduce and use qemuDomainRemoveInactiveJob
> 
> Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
> ---
>  src/qemu/qemu_driver.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 

Reviewed-by: John Ferlan <jferlan@redhat.com>

John

Similarly separable patch that could be pushed now.

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