[PATCH 0/6] runstate: fix race between guest shutdown and SIGTERM

Vladimir Sementsov-Ogievskiy posted 6 patches 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260904205749.510493-1-vsementsov@yandex-team.ru
Maintainers: Stefano Stabellini <sstabellini@kernel.org>, Anthony PERARD <anthony@xenproject.org>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Paolo Bonzini <pbonzini@redhat.com>, Markus Armbruster <armbru@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>, Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>, "Marc-André Lureau" <marcandre.lureau@redhat.com>
MAINTAINERS                      |   1 -
hw/xen/xen-hvm-common.c          |   2 +-
include/system/runstate-action.h |  19 ------
include/system/runstate.h        |   2 +-
monitor/qmp-cmds.c               |   2 -
system/meson.build               |   1 -
system/runstate-action.c         |  46 --------------
system/runstate.c                | 103 +++++++++++++++++++++----------
system/vl.c                      |   2 +-
ui/cocoa.m                       |   2 -
ui/sdl2.c                        |   3 -
11 files changed, 75 insertions(+), 108 deletions(-)
delete mode 100644 include/system/runstate-action.h
delete mode 100644 system/runstate-action.c
[PATCH 0/6] runstate: fix race between guest shutdown and SIGTERM
Posted by Vladimir Sementsov-Ogievskiy 3 weeks ago
Hi all.

This series fixes a race between guest shutdown and SIGTERM handling.
With -no-shutdown, a SIGTERM arriving while QEMU is processing a guest
shutdown request can make QEMU exit after sending SHUTDOWN with guest=true,
without sending a host SHUTDOWN event. This is unexpected for management
software relying on -no-shutdown.

Patch 5 contains the fix and a detailed description of the race. The
preceding patches prepare for it, and patch 6 makes the runstate action
variables private.

Vladimir Sementsov-Ogievskiy (6):
  runstate: introduce qemu_system_shutdown_request_safe() helper
  runstate: treat SHUTDOWN_CAUSE_HOST_UI as force_shutdown
  runstate: inline qemu_shutdown_requested()
  runstate: simplify qemu_shutdown_requested_get()
  runstate: separate forced and regular shutdown requests
  runstate: make runstate actions private

 MAINTAINERS                      |   1 -
 hw/xen/xen-hvm-common.c          |   2 +-
 include/system/runstate-action.h |  19 ------
 include/system/runstate.h        |   2 +-
 monitor/qmp-cmds.c               |   2 -
 system/meson.build               |   1 -
 system/runstate-action.c         |  46 --------------
 system/runstate.c                | 103 +++++++++++++++++++++----------
 system/vl.c                      |   2 +-
 ui/cocoa.m                       |   2 -
 ui/sdl2.c                        |   3 -
 11 files changed, 75 insertions(+), 108 deletions(-)
 delete mode 100644 include/system/runstate-action.h
 delete mode 100644 system/runstate-action.c

-- 
2.43.0