mirror of https://gitee.com/openkylin/libvirt.git
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:
parent
6997cf6f5d
commit
fa11852433
|
@ -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)) {
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -1001,9 +1001,6 @@ void qemuDomainStorageIdReset(qemuDomainObjPrivate *priv);
|
|||
virDomainEventResumedDetailType
|
||||
qemuDomainRunningReasonToResumeEvent(virDomainRunningReason reason);
|
||||
|
||||
bool
|
||||
qemuDomainIsUsingNoShutdown(qemuDomainObjPrivate *priv);
|
||||
|
||||
bool
|
||||
qemuDomainDiskIsMissingLocalOptional(virDomainDiskDef *disk);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue