From 74cdb07a1d68a371659aa2dbff26422f0d901348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Mass=C3=A9?= Date: Sun, 30 Aug 2026 02:26:57 +0000 Subject: [PATCH] Backport packages from upstream --- ...device-info-to-virDomainGetGuestInfo.patch | 134 + ...-running-when-panic-notifier-is-used.patch | 306 +++ ...r-pci_bus-in-virDomainIOMMUDefEquals.patch | 33 + ...onPoweroff-onCrash-and-onLockFailure.patch | 137 + ...-Allow-.-in-schema-for-CPU-flag-name.patch | 38 + ...on-t-pass-panic-action-via-parameter.patch | 69 + ...ort-for-HW-accelerated-nested-SMMUv3.patch | 371 +++ ...ume-support-for-QEMU_CAPS_SET_ACTION.patch | 239 ++ ...roper-ordering-of-virtlockd-shutdown.patch | 50 + ...e-info-for-virDomainGetGuestInfo-API.patch | 155 ++ ...ibvirt-qemu-Remove-allowReboot-field.patch | 313 +++ ...move-unused-qemuProcessRebootAllowed.patch | 63 + ...bilities-Retire-QEMU_CAPS_SET_ACTION.patch | 539 ++++ ...introduce-QEMU_CAPS_ARM_SMMUV3_ACCEL.patch | 81 + ...ce-QEMU_CAPS_ARM_SMMUV3_SMMU_PER_BUS.patch | 2225 +++++++++++++++++ ...ntroduce-QEMU_CAPS_DEVICE_ARM_SMMUV3.patch | 152 ++ ...move-support-for-watchdog-set-action.patch | 112 + ...matParams-to-hypervisor-qemu_agent.c.patch | 434 ++++ ...dual-steps-under-separate-conditions.patch | 127 + ...Live-Prepare-to-handle-other-actions.patch | 103 + ...nfoFormatMsg-Directly-return-message.patch | 88 + ...PanicEventInfo-Fold-into-only-caller.patch | 62 + ...ions-Prepare-to-handle-other-actions.patch | 62 + ...mu_agent-Introduce-guest-get-devices.patch | 211 ++ ...troduce-GetGuestDeviceInfo-test-case.patch | 164 ++ ...tyschemadata-Add-a-real-test-example.patch | 1063 ++++++++ ...accel-smmuv3-sample-XML-and-CLI-args.patch | 395 +++ ...bvirt-tools-virsh-fix-crash-on-error.patch | 50 + ...ileChownFiles-do-not-follow-symlinks.patch | 71 + ...rt-for-VIR_DOMAIN_GUEST_INFO_DEVICES.patch | 88 + centos-10/SPECS/libvirt.spec | 70 +- ...device-info-to-virDomainGetGuestInfo.patch | 134 + ...-running-when-panic-notifier-is-used.patch | 306 +++ ...onPoweroff-onCrash-and-onLockFailure.patch | 137 + ...-Allow-.-in-schema-for-CPU-flag-name.patch | 38 + ...on-t-pass-panic-action-via-parameter.patch | 69 + ...ume-support-for-QEMU_CAPS_SET_ACTION.patch | 239 ++ ...roper-ordering-of-virtlockd-shutdown.patch | 50 + ...e-info-for-virDomainGetGuestInfo-API.patch | 149 ++ ...ibvirt-qemu-Remove-allowReboot-field.patch | 313 +++ ...move-unused-qemuProcessRebootAllowed.patch | 63 + ...bilities-Retire-QEMU_CAPS_SET_ACTION.patch | 531 ++++ ...move-support-for-watchdog-set-action.patch | 112 + ...dual-steps-under-separate-conditions.patch | 127 + ...Live-Prepare-to-handle-other-actions.patch | 103 + ...nfoFormatMsg-Directly-return-message.patch | 88 + ...PanicEventInfo-Fold-into-only-caller.patch | 62 + ...ions-Prepare-to-handle-other-actions.patch | 62 + ...mu_agent-Introduce-guest-get-devices.patch | 198 ++ ...troduce-GetGuestDeviceInfo-test-case.patch | 164 ++ ...tyschemadata-Add-a-real-test-example.patch | 1063 ++++++++ ...ileChownFiles-do-not-follow-symlinks.patch | 71 + ...rt-for-VIR_DOMAIN_GUEST_INFO_DEVICES.patch | 88 + centos-9/SPECS/libvirt.spec | 50 +- 54 files changed, 12220 insertions(+), 2 deletions(-) create mode 100644 centos-10/SOURCES/libvirt-Add-guest-device-info-to-virDomainGetGuestInfo.patch create mode 100644 centos-10/SOURCES/libvirt-Add-support-for-keeping-VM-running-when-panic-notifier-is-used.patch create mode 100644 centos-10/SOURCES/libvirt-conf-Include-check-for-pci_bus-in-virDomainIOMMUDefEquals.patch create mode 100644 centos-10/SOURCES/libvirt-conf-Use-proper-enum-types-for-onReboot-onPoweroff-onCrash-and-onLockFailure.patch create mode 100644 centos-10/SOURCES/libvirt-conf-schemas-Allow-.-in-schema-for-CPU-flag-name.patch create mode 100644 centos-10/SOURCES/libvirt-processGuestPanicEvent-Don-t-pass-panic-action-via-parameter.patch create mode 100644 centos-10/SOURCES/libvirt-qemu-Add-support-for-HW-accelerated-nested-SMMUv3.patch create mode 100644 centos-10/SOURCES/libvirt-qemu-Always-assume-support-for-QEMU_CAPS_SET_ACTION.patch create mode 100644 centos-10/SOURCES/libvirt-qemu-Fix-proper-ordering-of-virtlockd-shutdown.patch create mode 100644 centos-10/SOURCES/libvirt-qemu-Implement-device-info-for-virDomainGetGuestInfo-API.patch create mode 100644 centos-10/SOURCES/libvirt-qemu-Remove-allowReboot-field.patch create mode 100644 centos-10/SOURCES/libvirt-qemu-Remove-unused-qemuProcessRebootAllowed.patch create mode 100644 centos-10/SOURCES/libvirt-qemu-capabilities-Retire-QEMU_CAPS_SET_ACTION.patch create mode 100644 centos-10/SOURCES/libvirt-qemu-introduce-QEMU_CAPS_ARM_SMMUV3_ACCEL.patch create mode 100644 centos-10/SOURCES/libvirt-qemu-introduce-QEMU_CAPS_ARM_SMMUV3_SMMU_PER_BUS.patch create mode 100644 centos-10/SOURCES/libvirt-qemu-introduce-QEMU_CAPS_DEVICE_ARM_SMMUV3.patch create mode 100644 centos-10/SOURCES/libvirt-qemu-monitor-Remove-support-for-watchdog-set-action.patch create mode 100644 centos-10/SOURCES/libvirt-qemu-move-qemuAgent-InfoFormatParams-to-hypervisor-qemu_agent.c.patch create mode 100644 centos-10/SOURCES/libvirt-qemu-processGuestPanicEvent-Split-individual-steps-under-separate-conditions.patch create mode 100644 centos-10/SOURCES/libvirt-qemuDomainModifyLifecycleActionLive-Prepare-to-handle-other-actions.patch create mode 100644 centos-10/SOURCES/libvirt-qemuMonitorGuestPanicEventInfoFormatMsg-Directly-return-message.patch create mode 100644 centos-10/SOURCES/libvirt-qemuProcessGuestPanicEventInfo-Fold-into-only-caller.patch create mode 100644 centos-10/SOURCES/libvirt-qemuProcessSetupLifecycleActions-Prepare-to-handle-other-actions.patch create mode 100644 centos-10/SOURCES/libvirt-qemu_agent-Introduce-guest-get-devices.patch create mode 100644 centos-10/SOURCES/libvirt-qemuagenttest-Introduce-GetGuestDeviceInfo-test-case.patch create mode 100644 centos-10/SOURCES/libvirt-tests-capabilityschemadata-Add-a-real-test-example.patch create mode 100644 centos-10/SOURCES/libvirt-tests-qemuxmlconfdata-provide-HW-accel-smmuv3-sample-XML-and-CLI-args.patch create mode 100644 centos-10/SOURCES/libvirt-tools-virsh-fix-crash-on-error.patch create mode 100644 centos-10/SOURCES/libvirt-util-virFileChownFiles-do-not-follow-symlinks.patch create mode 100644 centos-10/SOURCES/libvirt-virsh-Add-support-for-VIR_DOMAIN_GUEST_INFO_DEVICES.patch create mode 100644 centos-9/SOURCES/libvirt-Add-guest-device-info-to-virDomainGetGuestInfo.patch create mode 100644 centos-9/SOURCES/libvirt-Add-support-for-keeping-VM-running-when-panic-notifier-is-used.patch create mode 100644 centos-9/SOURCES/libvirt-conf-Use-proper-enum-types-for-onReboot-onPoweroff-onCrash-and-onLockFailure.patch create mode 100644 centos-9/SOURCES/libvirt-conf-schemas-Allow-.-in-schema-for-CPU-flag-name.patch create mode 100644 centos-9/SOURCES/libvirt-processGuestPanicEvent-Don-t-pass-panic-action-via-parameter.patch create mode 100644 centos-9/SOURCES/libvirt-qemu-Always-assume-support-for-QEMU_CAPS_SET_ACTION.patch create mode 100644 centos-9/SOURCES/libvirt-qemu-Fix-proper-ordering-of-virtlockd-shutdown.patch create mode 100644 centos-9/SOURCES/libvirt-qemu-Implement-device-info-for-virDomainGetGuestInfo-API.patch create mode 100644 centos-9/SOURCES/libvirt-qemu-Remove-allowReboot-field.patch create mode 100644 centos-9/SOURCES/libvirt-qemu-Remove-unused-qemuProcessRebootAllowed.patch create mode 100644 centos-9/SOURCES/libvirt-qemu-capabilities-Retire-QEMU_CAPS_SET_ACTION.patch create mode 100644 centos-9/SOURCES/libvirt-qemu-monitor-Remove-support-for-watchdog-set-action.patch create mode 100644 centos-9/SOURCES/libvirt-qemu-processGuestPanicEvent-Split-individual-steps-under-separate-conditions.patch create mode 100644 centos-9/SOURCES/libvirt-qemuDomainModifyLifecycleActionLive-Prepare-to-handle-other-actions.patch create mode 100644 centos-9/SOURCES/libvirt-qemuMonitorGuestPanicEventInfoFormatMsg-Directly-return-message.patch create mode 100644 centos-9/SOURCES/libvirt-qemuProcessGuestPanicEventInfo-Fold-into-only-caller.patch create mode 100644 centos-9/SOURCES/libvirt-qemuProcessSetupLifecycleActions-Prepare-to-handle-other-actions.patch create mode 100644 centos-9/SOURCES/libvirt-qemu_agent-Introduce-guest-get-devices.patch create mode 100644 centos-9/SOURCES/libvirt-qemuagenttest-Introduce-GetGuestDeviceInfo-test-case.patch create mode 100644 centos-9/SOURCES/libvirt-tests-capabilityschemadata-Add-a-real-test-example.patch create mode 100644 centos-9/SOURCES/libvirt-util-virFileChownFiles-do-not-follow-symlinks.patch create mode 100644 centos-9/SOURCES/libvirt-virsh-Add-support-for-VIR_DOMAIN_GUEST_INFO_DEVICES.patch diff --git a/centos-10/SOURCES/libvirt-Add-guest-device-info-to-virDomainGetGuestInfo.patch b/centos-10/SOURCES/libvirt-Add-guest-device-info-to-virDomainGetGuestInfo.patch new file mode 100644 index 0000000..123f898 --- /dev/null +++ b/centos-10/SOURCES/libvirt-Add-guest-device-info-to-virDomainGetGuestInfo.patch @@ -0,0 +1,134 @@ +From fa8e0a8220b8b29c97a77a9d564e68e6a2ddaee1 Mon Sep 17 00:00:00 2001 +Message-ID: +From: Michal Privoznik +Date: Wed, 12 Aug 2026 15:11:12 +0200 +Subject: [PATCH] Add guest device info to virDomainGetGuestInfo + +QEMU guest agent has 'guest-get-devices` command, which returns +information on guest devices (driver name, version, release date, +and so on). In this commit the public API part is introduced. + +Signed-off-by: Michal Privoznik +Reviewed-by: Peter Krempa +(cherry picked from commit 3033dae6989083fde1d06427ee2840242cfd8dca) +Resolves: https://redhat.atlassian.net/browse/RHEL-235731 +Signed-off-by: Michal Privoznik +--- + include/libvirt/libvirt-domain.h | 78 ++++++++++++++++++++++++++++++++ + src/libvirt-domain.c | 5 ++ + 2 files changed, 83 insertions(+) + +diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h +index f4dfe9fb1a..f9cc06b6e9 100644 +--- a/include/libvirt/libvirt-domain.h ++++ b/include/libvirt/libvirt-domain.h +@@ -8867,6 +8867,83 @@ int virDomainSetLaunchSecurityState(virDomainPtr domain, + */ + # define VIR_DOMAIN_GUEST_INFO_LOAD_15M "load.15m" + ++/** ++ * VIR_DOMAIN_GUEST_INFO_DEVICE_COUNT: ++ * ++ * The number of guest devices that detailed information is fetched for as ++ * unsigned int. ++ * ++ * Since: 12.7.0 ++ */ ++# define VIR_DOMAIN_GUEST_INFO_DEVICE_COUNT "device.count" ++ ++/** ++ * VIR_DOMAIN_GUEST_INFO_DEVICE_PREFIX: ++ * ++ * The parameter name prefix to access each device entry. Concatenate the ++ * prefix, the entry number formatted as an unsigned integer and one of the ++ * device suffix parameters to form a complete parameter name. ++ * ++ * Since: 12.7.0 ++ */ ++# define VIR_DOMAIN_GUEST_INFO_DEVICE_PREFIX "device." ++ ++/** ++ * VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_DRIVER_NAME: ++ * ++ * Name of the device driver (e.g. ``VirtIO Balloon Driver``) as a string. ++ * ++ * Since: 12.7.0 ++ */ ++# define VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_DRIVER_NAME ".driverName" ++ ++/** ++ * VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_DRIVER_DATE: ++ * ++ * Driver release date in seconds since the epoch (e.g. 1736726400) as long long. ++ * ++ * Since: 12.7.0 ++ */ ++# define VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_DRIVER_DATE ".driverDate" ++ ++/** ++ * VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_DRIVER_VERSION: ++ * ++ * Driver version (e.g. ``100.100.104.27100``) as a string. ++ * ++ * Since: 12.7.0 ++ */ ++# define VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_DRIVER_VERSION ".driverVersion" ++ ++/** ++ * VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_ID_TYPE: ++ * ++ * Device identification (e.g. ``pci``) as a string. ++ * ++ * Since: 12.7.0 ++ */ ++# define VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_ID_TYPE ".idType" ++ ++/** ++ * VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_PCI_VENDOR: ++ * ++ * PCI device (a device with VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_ID_TYPE equal ++ * to ``pci``) vendor id (e.g. 6900) as a unsigned int. ++ * ++ * Since: 12.7.0 ++ */ ++# define VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_PCI_VENDOR ".pciVendor" ++ ++/** ++ * VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_PCI_DEVICE: ++ * ++ * PCI device (a device with VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_ID_TYPE equal ++ * to ``pci``) device id (e.g. 4165) as a unsigned int. ++ * ++ * Since: 12.7.0 ++ */ ++# define VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_PCI_DEVICE ".pciDevice" ++ + /** + * virDomainGuestInfoTypes: + * +@@ -8881,6 +8958,7 @@ typedef enum { + VIR_DOMAIN_GUEST_INFO_DISKS = (1 << 5), /* return disks information (Since: 7.0.0) */ + VIR_DOMAIN_GUEST_INFO_INTERFACES = (1 << 6), /* return interfaces information (Since: 7.10.0) */ + VIR_DOMAIN_GUEST_INFO_LOAD = (1 << 7), /* return load averages (Since: 11.2.0) */ ++ VIR_DOMAIN_GUEST_INFO_DEVICES = (1 << 8), /* return devices information (Since: 12.7.0) */ + } virDomainGuestInfoTypes; + + int virDomainGetGuestInfo(virDomainPtr domain, +diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c +index 4cf1d996b8..396d3727bd 100644 +--- a/src/libvirt-domain.c ++++ b/src/libvirt-domain.c +@@ -13260,6 +13260,11 @@ virDomainSetVcpu(virDomainPtr domain, + * The VIR_DOMAIN_GUEST_INFO_LOAD_* constants define the known typed parameter + * keys. + * ++ * VIR_DOMAIN_GUEST_INFO_DEVICES: ++ * Returns information on guest devices. ++ * The VIR_DOMAIN_GUEST_INFO_DEVICE_* constants define the known typed ++ * parameter keys. ++ * + * Using 0 for @types returns all information groups supported by the given + * hypervisor. + * +-- +2.55.0 diff --git a/centos-10/SOURCES/libvirt-Add-support-for-keeping-VM-running-when-panic-notifier-is-used.patch b/centos-10/SOURCES/libvirt-Add-support-for-keeping-VM-running-when-panic-notifier-is-used.patch new file mode 100644 index 0000000..8d5eff1 --- /dev/null +++ b/centos-10/SOURCES/libvirt-Add-support-for-keeping-VM-running-when-panic-notifier-is-used.patch @@ -0,0 +1,306 @@ +From f43463c7010e0b92c48d510be217abf191655754 Mon Sep 17 00:00:00 2001 +Message-ID: +From: Peter Krempa +Date: Wed, 22 Jul 2026 17:13:15 +0200 +Subject: [PATCH] Add support for keeping VM running when panic notifier is + used +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Some guest OSes (e.g. windows) can do an internal crash dump and reboot +after a crash. They unfortunately notify the OS before doing the crash +dump though so we need a new possibility for the action to +keep the VM as is. + +This patch introduces 'preserve-running' mode for on_crash and wires it +up into the qemu driver. + +Signed-off-by: Peter Krempa +Reviewed-by: Ján Tomko +(cherry picked from commit cdea89dd87a10cd94deb3b067bae483d98c558ed) + +https://redhat.atlassian.net/browse/RHEL-242545 +--- + docs/formatdomain.rst | 3 ++ + include/libvirt/libvirt-domain.h | 1 + + src/conf/domain_conf.c | 2 ++ + src/conf/schemas/domaincommon.rng | 2 ++ + src/libxl/libxl_conf.c | 1 + + src/libxl/libxl_domain.c | 3 ++ + src/qemu/qemu_driver.c | 34 ++++++++++++++++++- + src/qemu/qemu_process.c | 18 ++++++++++ + .../async-teardown.x86_64-latest.xml | 2 +- + tests/qemuxmlconfdata/async-teardown.xml | 2 +- + tests/qemuxmlconftest.c | 1 + + tools/virsh-domain.c | 3 +- + 12 files changed, 68 insertions(+), 4 deletions(-) + +diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst +index 1e8c81c3a5..89665f8ab8 100644 +--- a/docs/formatdomain.rst ++++ b/docs/formatdomain.rst +@@ -2044,6 +2044,9 @@ The ``on_crash`` event supports these additional actions :since:`since 0.8.4`. + ``coredump-restart`` + The crashed domain's core will be dumped, and then the domain will be + restarted with the same configuration ++``preserve-running`` ++ The crashed domain will continue to run. This is useful if the guest OS can ++ do an internal crash dump and reboot itself. :since:`Since 12.6.0` + + :since:`Since 3.9.0`, the lifecycle events can be configured via the + `virDomainSetLifecycleAction `__ +diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h +index 5b67f8f897..f4dfe9fb1a 100644 +--- a/include/libvirt/libvirt-domain.h ++++ b/include/libvirt/libvirt-domain.h +@@ -8228,6 +8228,7 @@ typedef enum { + VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE = 3, /* (Since: 3.9.0) */ + VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_DESTROY = 4, /* (Since: 3.9.0) */ + VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_RESTART = 5, /* (Since: 3.9.0) */ ++ VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE_RUNNING = 6, /* (Since: 12.6.0) */ + + # ifdef VIR_ENUM_SENTINELS + VIR_DOMAIN_LIFECYCLE_ACTION_LAST /* (Since: 3.9.0) */ +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index d43b8bdd5b..9880339e42 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -303,6 +303,7 @@ VIR_ENUM_IMPL(virDomainLifecycleAction, + "preserve", + "coredump-destroy", + "coredump-restart", ++ "preserve-running", + ); + + VIR_ENUM_IMPL(virDomainLockFailure, +@@ -5538,6 +5539,7 @@ virDomainDefLifecycleActionAllowed(virDomainLifecycle type, + return true; + case VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_DESTROY: + case VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_RESTART: ++ case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE_RUNNING: + break; + } + break; +diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng +index c7d7ebc876..c8f1fe5547 100644 +--- a/src/conf/schemas/domaincommon.rng ++++ b/src/conf/schemas/domaincommon.rng +@@ -5035,6 +5035,7 @@ + destroy: The domain is cleaned up + restart: A new domain is started in place of the old one + preserve: The domain will remain in memory until it is destroyed manually ++ preserve-running: Keep the domain as is, let the guest handle the crash. + rename-restart: a variant of the previous one but where the old domain is + renamed before being saved to allow a restart + coredump-destroy: The crashed domain's core will be dumped, and then the +@@ -5051,6 +5052,7 @@ + rename-restart + coredump-destroy + coredump-restart ++ preserve-running + + +