[PATCH 15/22] qemu: domain: Remove qemuDomainIsUsingNoShutdown

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

 



Directly use 'priv->allowReboot' as we now document what the behaiour is
to avoid another lookup.

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

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 2756f46b51..5b743dd1ad 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -6165,11 +6165,9 @@ qemuBuildPMCommandLine(virCommand *cmd,
 {
     virQEMUCaps *qemuCaps = priv->qemuCaps;

-    /* Only add -no-reboot option if each event destroys domain */
     if (priv->allowReboot == VIR_TRISTATE_BOOL_NO)
         virCommandAddArg(cmd, "-no-reboot");
-
-    if (qemuDomainIsUsingNoShutdown(priv))
+    else
         virCommandAddArg(cmd, "-no-shutdown");

     if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NO_ACPI)) {
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 9baa4b5d90..ce355d37a0 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -11149,22 +11149,6 @@ qemuDomainRunningReasonToResumeEvent(virDomainRunningReason reason)
 }


-/* qemuDomainIsUsingNoShutdown:
- * @priv: Domain private data
- *
- * We can receive an event when QEMU stops. If we use no-shutdown, then
- * we can watch for this event and do a soft/warm reboot.
- *
- * Returns: @true when -no-shutdown either should be or was added to the
- * command line.
- */
-bool
-qemuDomainIsUsingNoShutdown(qemuDomainObjPrivate *priv)
-{
-    return priv->allowReboot == VIR_TRISTATE_BOOL_YES;
-}
-
-
 bool
 qemuDomainDiskIsMissingLocalOptional(virDomainDiskDef *disk)
 {
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index f3c6bb3390..cb1cd968d5 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -1001,9 +1001,6 @@ void qemuDomainStorageIdReset(qemuDomainObjPrivate *priv);
 virDomainEventResumedDetailType
 qemuDomainRunningReasonToResumeEvent(virDomainRunningReason reason);

-bool
-qemuDomainIsUsingNoShutdown(qemuDomainObjPrivate *priv);
-
 bool
 qemuDomainDiskIsMissingLocalOptional(virDomainDiskDef *disk);

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 5958a48182..c9cdff4e82 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -8751,8 +8751,7 @@ qemuProcessReconnect(void *opaque)
          * domain crashed; otherwise, if the monitor was started,
          * then we can blame ourselves, else we failed before the
          * monitor started so we don't really know. */
-        if (!priv->mon && tryMonReconn &&
-            qemuDomainIsUsingNoShutdown(priv))
+        if (!priv->mon && tryMonReconn && priv->allowReboot == VIR_TRISTATE_BOOL_YES)
             state = VIR_DOMAIN_SHUTOFF_CRASHED;
         else if (priv->mon)
             state = VIR_DOMAIN_SHUTOFF_DAEMON;
-- 
2.31.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