libvirt/src/qemu
Maxim Nestratov ea42cc69cc qemu: disarm fake reboot flag on reset
This is a quite an old (created at 2016) patch fixing an issue for at
that time contemporary Fedora 23. virsh reboot returns success (yet
after hanging for a while), VM is rebooted sucessfully too but then
shutdown from inside guest causes reboot and not shutdown.

VM has agent installed. So virsh reboot first tries to reboot VM thru
the agent. The agent calls 'shutdown -r' command. Typically it returns
instantly but on this distro for some reason it takes time. I did not
investigate the cause but the command waits in dbus client code,
probably waits for reply. The libvirt waits 60s for agent command to
execute and then errors out. Next reboot API falls back to ACPI shutdown
which returns successfully thus the reboot command return success too.

Yet shutdown command in guest eventually successfull and guest is truly
rebooted. So libvirt does not receive SHUTDOWN event and fake reboot
flag which is armed on fallback path stays armed. Thus next shutdown
from guest leads to reboot.

The issue has 100% repro on Fedora 23. On modern distros I can't
reproduce it at all. Shutdown command is asynchronous and returns
immediately even if I start some service that ignores TERM signal and
thus shutdown procedure waits for 90s (if I not mistaken) before sending
KILL.

Yet I guess it is nice to have this patch to be more robust.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Nikolay Shirokovskiy <nikolay.shirokovskiy@openvz.org>
2022-04-21 16:25:29 +01:00
..
EVENTHANDLERS.txt
MIGRATION.txt move jobs enums QEMU_X into hypervisor as VIR_X 2022-03-25 13:40:56 +01:00
THREADS.txt move jobs enums QEMU_X into hypervisor as VIR_X 2022-03-25 13:40:56 +01:00
libvirt_qemu_probes.d meson: src: build libvirt_driver_qemu_impl.a static library 2020-08-03 09:27:04 +02:00
libvirtd_qemu.aug qemu: conf: Add 'deprecation_behavior' setting to qemu.conf 2021-04-06 17:07:05 +02:00
meson.build qemu: Use real defaults for user and group in qemu.conf 2022-04-01 15:32:48 +02:00
postcopy-migration.sysctl qemu: Ignore missing vm.unprivileged_userfaultfd sysctl 2022-02-09 13:03:33 +01:00
qemu.conf.in qemu: Use real defaults for user and group in qemu.conf 2022-04-01 15:32:48 +02:00
qemu_agent.c qemu_agent: Use automatic mutex management 2022-04-05 15:59:08 +02:00
qemu_agent.h qemu_agent: Drop destroy callback 2021-11-12 14:11:43 +01:00
qemu_alias.c qemu_alias: change return type to void if possible 2021-11-25 09:19:59 +01:00
qemu_alias.h qemu_alias: change return type to void if possible 2021-11-25 09:19:59 +01:00
qemu_backup.c qemu: move macros QEMU_X into hypervisor as VIR_X 2022-03-25 13:41:01 +01:00
qemu_backup.h qemu: use generalized virDomainJobData instead of qemuDomainJobInfo 2022-02-15 12:20:45 +01:00
qemu_block.c move jobs enums QEMU_X into hypervisor as VIR_X 2022-03-25 13:40:56 +01:00
qemu_block.h move jobs enums QEMU_X into hypervisor as VIR_X 2022-03-25 13:40:56 +01:00
qemu_blockjob.c move jobs enums QEMU_X into hypervisor as VIR_X 2022-03-25 13:40:56 +01:00
qemu_blockjob.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
qemu_capabilities.c qemu: Retire QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT 2022-04-19 15:43:17 +02:00
qemu_capabilities.h qemu: Retire QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT 2022-04-19 15:43:17 +02:00
qemu_capspriv.h qemu: Invalidate capabilities cache on host cpuid mismatch 2021-11-05 17:12:25 +01:00
qemu_cgroup.c qemu_cgroup: Don't deny devices from cgroupDeviceACL 2022-03-16 13:22:17 +01:00
qemu_cgroup.h qemu, hypervisor: refactor some cgroup mgmt methods 2022-01-28 17:04:50 +01:00
qemu_checkpoint.c move jobs enums QEMU_X into hypervisor as VIR_X 2022-03-25 13:40:56 +01:00
qemu_checkpoint.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
qemu_command.c qemu: Assume QEMU_CAPS_MACHINE_PSERIES_MAX_CPU_COMPAT 2022-04-19 15:43:17 +02:00
qemu_command.h qemu: Always assume QEMU_CAPS_STORAGE_WERROR 2022-04-04 12:26:59 +02:00
qemu_conf.c qemu_conf: Use automatic memory management 2022-03-17 17:16:23 +01:00
qemu_conf.h qemu: remove sharedDevices hash table 2022-01-19 13:57:59 +01:00
qemu_dbus.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
qemu_dbus.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
qemu_domain.c qemu: Check usage count of qemu:override node 2022-04-21 11:09:54 +02:00
qemu_domain.h qemu: drop needless acquiring job removing domain 2022-04-13 17:46:02 +03:00
qemu_domain_address.c qemu: Assign PCI address to virtio-iommu 2022-04-01 19:30:59 +02:00
qemu_domain_address.h qemuDomainEnsurePCIAddress: Don't pass virQEMUDriver explicitly 2021-11-19 12:38:34 +01:00
qemu_domainjob.c qemu: fix one more race on undefining and create 2022-04-13 17:48:46 +03:00
qemu_domainjob.h qemu: Rename virDomainAsyncJobPhase{From,To}String 2022-04-01 12:33:03 +02:00
qemu_driver.c qemu: drop needless acquiring job removing domain 2022-04-13 17:46:02 +03:00
qemu_driver.h src/qemu: use #pragma once in headers 2019-06-19 17:12:30 +02:00
qemu_extdevice.c qemu: Revert "qemuExtDevicesStart: pass logManager" 2021-10-12 14:12:11 +02:00
qemu_extdevice.h qemu: Revert "qemuExtDevicesStart: pass logManager" 2021-10-12 14:12:11 +02:00
qemu_fd.c qemu: Introduce helper functions for passing FDs to qemu 2022-02-14 13:13:59 +01:00
qemu_fd.h qemu: Introduce helper functions for passing FDs to qemu 2022-02-14 13:13:59 +01:00
qemu_firmware.c qemu: support firmware descriptor flash 'mode' for optional NVRAM 2022-02-23 18:11:08 +00:00
qemu_firmware.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
qemu_hostdev.c conf: Convert virDomainHostdevDefParseXMLSubsys() to virXMLProp*() 2022-01-21 16:42:14 +01:00
qemu_hostdev.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
qemu_hotplug.c qemu: Always assume QEMU_CAPS_STORAGE_WERROR 2022-04-04 12:26:59 +02:00
qemu_hotplug.h move jobs enums QEMU_X into hypervisor as VIR_X 2022-03-25 13:40:56 +01:00
qemu_interface.c lib: Use virReportSystemError() more 2022-04-07 12:11:22 +02:00
qemu_interface.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
qemu_interop_config.c meson: Introduce qemu_datadir option 2021-11-18 15:48:59 +01:00
qemu_interop_config.h qemu: generalize qemuFetchConfigs 2019-09-24 12:17:10 -04:00
qemu_migration.c qemu: drop needless acquiring job removing domain 2022-04-13 17:46:02 +03:00
qemu_migration.h move jobs enums QEMU_X into hypervisor as VIR_X 2022-03-25 13:40:56 +01:00
qemu_migration_cookie.c qemu: use qemuDomainSaveStatus() and remove qemuDomainObjSaveStatus() 2022-03-18 13:15:02 +01:00
qemu_migration_cookie.h qemu: use generalized virDomainJobData instead of qemuDomainJobInfo 2022-02-15 12:20:45 +01:00
qemu_migration_params.c move jobs enums QEMU_X into hypervisor as VIR_X 2022-03-25 13:40:56 +01:00
qemu_migration_params.h qemu: migration: Use 'VIR_MIGRATE_PARAM_TLS_DESTINATION' for the NBD connection 2022-03-11 15:17:06 +01:00
qemu_migration_paramspriv.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
qemu_monitor.c qemu: Implement qemuDomainQemuMonitorCommandWithFiles 2022-03-01 13:29:49 +01:00
qemu_monitor.h qemu: Implement qemuDomainQemuMonitorCommandWithFiles 2022-03-01 13:29:49 +01:00
qemu_monitor_json.c qemu: Fetch info on NVDIMM-s too when updating memory devices 2022-04-19 13:31:53 +02:00
qemu_monitor_json.h qemu: Implement qemuDomainQemuMonitorCommandWithFiles 2022-03-01 13:29:49 +01:00
qemu_monitor_priv.h qemuhotplugmock: Mock fd passing to qemu via 'SCM_RIGHTS' 2022-02-15 09:32:23 +01:00
qemu_monitor_text.c qemu: Implement qemuDomainQemuMonitorCommandWithFiles 2022-03-01 13:29:49 +01:00
qemu_monitor_text.h qemu_monitor: remove unused load snapshot code 2021-11-23 16:03:07 +01:00
qemu_namespace.c qemu_namespace: Be less aggressive in removing /dev nodes from namespace 2022-03-15 17:03:07 +01:00
qemu_namespace.h qemu: Do not erase duplicate devices from namespace if error occurs 2021-07-15 12:00:24 +02:00
qemu_process.c qemu: disarm fake reboot flag on reset 2022-04-21 16:25:29 +01:00
qemu_process.h qemu: Simplify qemuProcessIncomingDef 2022-04-08 10:27:02 +02:00
qemu_processpriv.h qemu_processpriv: Fix #error message 2022-04-20 14:55:00 +02:00
qemu_qapi.c virQEMUQAPISchemaTraverseEnum: Allow query of enume type features 2021-11-01 17:37:15 +01:00
qemu_qapi.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
qemu_saveimage.c move jobs enums QEMU_X into hypervisor as VIR_X 2022-03-25 13:40:56 +01:00
qemu_saveimage.h move jobs enums QEMU_X into hypervisor as VIR_X 2022-03-25 13:40:56 +01:00
qemu_security.c qemu: Set label on vhostuser net device when hotplugging 2021-08-26 16:06:45 -06:00
qemu_security.h qemu: Set label on vhostuser net device when hotplugging 2021-08-26 16:06:45 -06:00
qemu_shim.c virt-qemu-run: Improve usage information 2021-12-10 18:39:35 +01:00
qemu_slirp.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
qemu_slirp.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
qemu_snapshot.c qemu: move macros QEMU_X into hypervisor as VIR_X 2022-03-25 13:41:01 +01:00
qemu_snapshot.h move jobs enums QEMU_X into hypervisor as VIR_X 2022-03-25 13:40:56 +01:00
qemu_tpm.c qemu_tpm: Do async IO when starting swtpm emulator 2022-03-28 10:00:18 +02:00
qemu_tpm.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
qemu_validate.c qemu: Assume QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT 2022-04-19 15:43:17 +02:00
qemu_validate.h qemu: Reject 'rename-restart' action for 'on_reboot'/'on_poweroff'/'on_crash' 2021-08-25 15:32:44 +02:00
qemu_vhost_user.c qemu_vhost_user: don't raise error for unknown features 2021-07-26 10:01:59 -04:00
qemu_vhost_user.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
qemu_vhost_user_gpu.c qemu: gpu: Get pid without binary validation 2022-02-04 10:27:43 +01:00
qemu_vhost_user_gpu.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
qemu_virtiofs.c qemu: virtiofs: check whether the supplied binary exists 2022-02-03 14:15:04 +01:00
qemu_virtiofs.h qemu: virtiofs: open a separate connection to virtlogd 2021-10-12 14:12:11 +02:00
test_libvirtd_qemu.aug.in qemu: Use real defaults for user and group in qemu.conf 2022-04-01 15:32:48 +02:00
virtqemud.init.in configure: Provide OpenRC scripts for sub-daemons 2019-12-16 10:11:22 +01:00
virtqemud.service.in systemd: Use correct man page name in modular daemon service files 2022-02-01 13:20:11 +01:00