[PATCH 26/36] qemu: domain: Introduce qemuDomainStartupCleanup

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

 



The new helper qemuDomainStartupCleanup is used to perform cleanup after
a startup of a VM (successful or not). The initial implementation just
calls qemuDomainSecretDestroy, which can be un-exported.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_domain.c  | 15 ++++++++++++++-
 src/qemu/qemu_domain.h  |  3 +--
 src/qemu/qemu_process.c |  2 +-
 3 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 33a9145cc9..1f288fa0cf 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1552,7 +1552,7 @@ qemuDomainSecretGraphicsPrepare(virQEMUDriverConfig *cfg,
  *
  * Removes all unnecessary data which was needed to generate 'secret' objects.
  */
-void
+static void
 qemuDomainSecretDestroy(virDomainObj *vm)
 {
     size_t i;
@@ -12279,3 +12279,16 @@ qemuDomainSchedCoreStop(qemuDomainObjPrivate *priv)
         priv->schedCoreChildPID = -1;
     }
 }
+
+
+/**
+ * qemuDomainStartupCleanup:
+ *
+ * Performs a cleanup of data which is not required after a startup of a VM
+ * (successful or not).
+ */
+void
+qemuDomainStartupCleanup(virDomainObj *vm)
+{
+    qemuDomainSecretDestroy(vm);
+}
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 1cba3fa394..057de1e974 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -932,8 +932,7 @@ int qemuDomainSecretChardevPrepare(virQEMUDriverConfig *cfg,
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
     ATTRIBUTE_NONNULL(4);

-void qemuDomainSecretDestroy(virDomainObj *vm)
-    ATTRIBUTE_NONNULL(1);
+void qemuDomainStartupCleanup(virDomainObj *vm);

 int qemuDomainSecretPrepare(virQEMUDriver *driver,
                             virDomainObj *vm)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index fc4e58f95b..8591a026cc 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -7921,7 +7921,7 @@ qemuProcessLaunch(virConnectPtr conn,

  cleanup:
     qemuDomainSchedCoreStop(priv);
-    qemuDomainSecretDestroy(vm);
+    qemuDomainStartupCleanup(vm);
     return ret;
 }

-- 
2.38.1




[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