- qemu: Always assume support for 'QEMU_CAPS_SET_ACTION' (RHEL-242546) - qemu: Remove unused 'qemuProcessRebootAllowed' (RHEL-242546) - qemu: monitor: Remove support for 'watchdog-set-action' (RHEL-242546) - qemu: Remove 'allowReboot' field (RHEL-242546) - qemu: capabilities: Retire QEMU_CAPS_SET_ACTION (RHEL-242546) - qemuProcessSetupLifecycleActions: Prepare to handle other actions (RHEL-242546) - qemuDomainModifyLifecycleActionLive: Prepare to handle other actions (RHEL-242546) - processGuestPanicEvent: Don't pass panic action via parameter (RHEL-242546) - conf: Use proper enum types for 'onReboot', 'onPoweroff', 'onCrash', and 'onLockFailure' (RHEL-242546) - qemuMonitorGuestPanicEventInfoFormatMsg: Directly return message (RHEL-242546) - qemuProcessGuestPanicEventInfo: Fold into only caller (RHEL-242546) - qemu: processGuestPanicEvent: Split individual steps under separate conditions (RHEL-242546) - Add support for keeping VM running when panic notifier is used (RHEL-242546) - qemu: Fix proper ordering of 'virtlockd' shutdown (RHEL-180876) - Add guest device info to virDomainGetGuestInfo (RHEL-243300) - qemu_agent: Introduce guest-get-devices (RHEL-243300) - qemuagenttest: Introduce GetGuestDeviceInfo test case (RHEL-243300) - qemu: Implement device info for virDomainGetGuestInfo() API (RHEL-243300) - virsh: Add support for VIR_DOMAIN_GUEST_INFO_DEVICES (RHEL-243300) Resolves: RHEL-180876, RHEL-242546, RHEL-243300
63 lines
2.5 KiB
Diff
63 lines
2.5 KiB
Diff
From 35539a28975b44f5321d204dc20e28c25fc6abae Mon Sep 17 00:00:00 2001
|
|
Message-ID: <35539a28975b44f5321d204dc20e28c25fc6abae.1787144643.git.jdenemar@redhat.com>
|
|
From: Peter Krempa <pkrempa@redhat.com>
|
|
Date: Mon, 20 Jul 2026 13:48:51 +0200
|
|
Subject: [PATCH] qemuProcessSetupLifecycleActions: Prepare to handle other
|
|
actions
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
Rework the code so that it'll be possible to easily extend it to set
|
|
other lifecycle actions in qemu.
|
|
|
|
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
|
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
(cherry picked from commit 30a548c894dc2f5787d7004d68b266caa404f6af)
|
|
|
|
https://redhat.atlassian.net/browse/RHEL-242546
|
|
---
|
|
src/qemu/qemu_process.c | 18 ++++++++++++------
|
|
1 file changed, 12 insertions(+), 6 deletions(-)
|
|
|
|
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
|
|
index 369dbab579..6955e8152c 100644
|
|
--- a/src/qemu/qemu_process.c
|
|
+++ b/src/qemu/qemu_process.c
|
|
@@ -8090,21 +8090,27 @@ qemuProcessSetupLifecycleActions(virDomainObj *vm,
|
|
virDomainAsyncJob asyncJob)
|
|
{
|
|
qemuDomainObjPrivate *priv = vm->privateData;
|
|
+ qemuMonitorActionShutdown shutdown = QEMU_MONITOR_ACTION_SHUTDOWN_KEEP;
|
|
+ qemuMonitorActionReboot reboot = QEMU_MONITOR_ACTION_REBOOT_KEEP;
|
|
+ qemuMonitorActionWatchdog watchdog = QEMU_MONITOR_ACTION_WATCHDOG_KEEP;
|
|
+ qemuMonitorActionPanic panic = QEMU_MONITOR_ACTION_PANIC_KEEP;
|
|
int rc;
|
|
|
|
/* for now we handle only onReboot->destroy here as an alternative to
|
|
* '-no-reboot' on the commandline */
|
|
- if (vm->def->onReboot != VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY)
|
|
+ if (vm->def->onReboot == VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY)
|
|
+ reboot = QEMU_MONITOR_ACTION_REBOOT_SHUTDOWN;
|
|
+
|
|
+ if (shutdown == QEMU_MONITOR_ACTION_SHUTDOWN_KEEP &&
|
|
+ reboot == QEMU_MONITOR_ACTION_REBOOT_KEEP &&
|
|
+ watchdog == QEMU_MONITOR_ACTION_WATCHDOG_KEEP &&
|
|
+ panic == QEMU_MONITOR_ACTION_PANIC_KEEP)
|
|
return 0;
|
|
|
|
if (qemuDomainObjEnterMonitorAsync(vm, asyncJob) < 0)
|
|
return -1;
|
|
|
|
- rc = qemuMonitorSetAction(priv->mon,
|
|
- QEMU_MONITOR_ACTION_SHUTDOWN_KEEP,
|
|
- QEMU_MONITOR_ACTION_REBOOT_SHUTDOWN,
|
|
- QEMU_MONITOR_ACTION_WATCHDOG_KEEP,
|
|
- QEMU_MONITOR_ACTION_PANIC_KEEP);
|
|
+ rc = qemuMonitorSetAction(priv->mon, shutdown, reboot, watchdog, panic);
|
|
|
|
qemuDomainObjExitMonitor(vm);
|
|
if (rc < 0)
|
|
--
|
|
2.55.0
|