[PATCH] Revert hack for autodestroy in qemuProcessStop

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

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

This reverts the hack done in

commit 568a6cda277f04ab9baaeb97490e548b7b608aa6
Author: Jiri Denemark <jdenemar@xxxxxxxxxx>
Date:   Fri Feb 15 15:11:47 2013 +0100

    qemu: Avoid deadlock in autodestroy

since we now have a fix which avoids the deadlock scenario
entirely
---
 src/qemu/qemu_conf.h    | 4 ----
 src/qemu/qemu_domain.h  | 1 -
 src/qemu/qemu_process.c | 8 +-------
 3 files changed, 1 insertion(+), 12 deletions(-)

diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index d547d97..6bb3dee 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -254,10 +254,6 @@ struct qemuDomainDiskInfo {
     int io_status;
 };
 
-/*
- * To avoid a certain deadlock this callback must never call any
- * virQEMUCloseCallbacks* API.
- */
 typedef virDomainObjPtr (*virQEMUCloseCallback)(virQEMUDriverPtr driver,
                                                 virDomainObjPtr vm,
                                                 virConnectPtr conn);
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 30e6b97..dacbb54 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -138,7 +138,6 @@ struct _qemuDomainObjPrivate {
 
     bool gotShutdown;
     bool beingDestroyed;
-    bool autoDestroyed;
     char *pidfile;
 
     int nvcpupids;
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 1b9eede..9f1507a 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -4232,8 +4232,7 @@ void qemuProcessStop(virQEMUDriverPtr driver,
     qemuDomainCleanupRun(driver, vm);
 
     /* Stop autodestroy in case guest is restarted */
-    if (!priv->autoDestroyed)
-        qemuProcessAutoDestroyRemove(driver, vm);
+    qemuProcessAutoDestroyRemove(driver, vm);
 
     /* now that we know it's stopped call the hook if present */
     if (virHookPresent(VIR_HOOK_DRIVER_QEMU)) {
@@ -4614,13 +4613,8 @@ qemuProcessAutoDestroy(virQEMUDriverPtr driver,
 
     VIR_DEBUG("Killing domain");
 
-    /* We need to prevent qemuProcessStop from removing this function from
-     * closeCallbacks since that would cause a deadlock.
-     */
-    priv->autoDestroyed = true;
     qemuProcessStop(driver, dom, VIR_DOMAIN_SHUTOFF_DESTROYED,
                     VIR_QEMU_PROCESS_STOP_MIGRATED);
-    priv->autoDestroyed = false;
 
     virDomainAuditStop(dom, "destroyed");
     event = virDomainEventNewFromObj(dom,
-- 
1.7.11.7

--
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]