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;
|
virQEMUCaps *qemuCaps = priv->qemuCaps;
|
||||||
|
|
||||||
/* Only add -no-reboot option if each event destroys domain */
|
|
||||||
if (priv->allowReboot == VIR_TRISTATE_BOOL_NO)
|
if (priv->allowReboot == VIR_TRISTATE_BOOL_NO)
|
||||||
virCommandAddArg(cmd, "-no-reboot");
|
virCommandAddArg(cmd, "-no-reboot");
|
||||||
|
else
|
||||||
if (qemuDomainIsUsingNoShutdown(priv))
|
|
||||||
virCommandAddArg(cmd, "-no-shutdown");
|
virCommandAddArg(cmd, "-no-shutdown");
|
||||||
|
|
||||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NO_ACPI)) {
|
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
|
bool
|
||||||
qemuDomainDiskIsMissingLocalOptional(virDomainDiskDef *disk)
|
qemuDomainDiskIsMissingLocalOptional(virDomainDiskDef *disk)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1001,9 +1001,6 @@ void qemuDomainStorageIdReset(qemuDomainObjPrivate *priv);
|
||||||
virDomainEventResumedDetailType
|
virDomainEventResumedDetailType
|
||||||
qemuDomainRunningReasonToResumeEvent(virDomainRunningReason reason);
|
qemuDomainRunningReasonToResumeEvent(virDomainRunningReason reason);
|
||||||
|
|
||||||
bool
|
|
||||||
qemuDomainIsUsingNoShutdown(qemuDomainObjPrivate *priv);
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
qemuDomainDiskIsMissingLocalOptional(virDomainDiskDef *disk);
|
qemuDomainDiskIsMissingLocalOptional(virDomainDiskDef *disk);
|
||||||
|
|
||||||
|
|
|
@ -8751,8 +8751,7 @@ qemuProcessReconnect(void *opaque)
|
||||||
* domain crashed; otherwise, if the monitor was started,
|
* domain crashed; otherwise, if the monitor was started,
|
||||||
* then we can blame ourselves, else we failed before the
|
* then we can blame ourselves, else we failed before the
|
||||||
* monitor started so we don't really know. */
|
* monitor started so we don't really know. */
|
||||||
if (!priv->mon && tryMonReconn &&
|
if (!priv->mon && tryMonReconn && priv->allowReboot == VIR_TRISTATE_BOOL_YES)
|
||||||
qemuDomainIsUsingNoShutdown(priv))
|
|
||||||
state = VIR_DOMAIN_SHUTOFF_CRASHED;
|
state = VIR_DOMAIN_SHUTOFF_CRASHED;
|
||||||
else if (priv->mon)
|
else if (priv->mon)
|
||||||
state = VIR_DOMAIN_SHUTOFF_DAEMON;
|
state = VIR_DOMAIN_SHUTOFF_DAEMON;
|
||||||
|
|
Loading…
Reference in New Issue