qemu: domain: Remove qemuDomainIsUsingNoShutdown

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

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Peter Krempa 2021-08-23 15:01:43 +02:00
parent 6997cf6f5d
commit fa11852433
4 changed files with 2 additions and 24 deletions

View File

@ -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)) {

View File

@ -11139,22 +11139,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)
{

View File

@ -1001,9 +1001,6 @@ void qemuDomainStorageIdReset(qemuDomainObjPrivate *priv);
virDomainEventResumedDetailType
qemuDomainRunningReasonToResumeEvent(virDomainRunningReason reason);
bool
qemuDomainIsUsingNoShutdown(qemuDomainObjPrivate *priv);
bool
qemuDomainDiskIsMissingLocalOptional(virDomainDiskDef *disk);

View File

@ -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;