public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH v2 0/7] Handle guest shutdown during backups
@ 2020-10-19 12:18 Stefan Reiter
  2020-10-19 12:18 ` [pve-devel] [PATCH v2 qemu-server 1/7] qmeventd: add handling for -no-shutdown QEMU instances Stefan Reiter
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Stefan Reiter @ 2020-10-19 12:18 UTC (permalink / raw)
  To: pve-devel; +Cc: d.csapak, w.bumiller

Use QEMU's -no-shutdown argument so the QEMU instance stays alive even if the
guest shuts down. This allows running backups to continue.

To handle cleanup of QEMU processes, this series extends the qmeventd to handle
SHUTDOWN events not just for detecting guest triggered shutdowns, but also to
clean the QEMU process via SIGTERM (which quits it even with -no-shutdown
enabled).

A VZDump instance can then signal qmeventd (via the /var/run/qmeventd.sock) to
keep alive certain VM processes if they're backing up, and once the backup is
done, they close their connection to the socket, and qmeventd knows that it can
now safely kill the VM (as long as the guest hasn't booted again, which is
possible with some changes to the vm_start code also done in this series).

This series requires a lot of testing, since there can be quite a few edge cases
lounging around. So far it's been doing well for me, aside from the VNC GUI
looking a bit confused when you do the 'shutdown during backup' motion (i.e. the
last image from the framebuffer stays in the VNC window, looks more like the
guest has crashed than shut down) - but I haven't found a solution for that.


v2:
* use a pidfd (see `man pidfd_open`, though the manpage does not seem to be
  available on Debian atm - I suppose since they don't support kernel 5.3 yet?),
  fall back to regular racy kill() included, for people running older kernels
* initialize client->type with CLIENT_NONE instead of client->state
* rebase on latest master


qemu-server: Stefan Reiter (6):
  qmeventd: add handling for -no-shutdown QEMU instances
  qmeventd: add last-ditch effort SIGKILL cleanup
  vzdump: connect to qmeventd for duration of backup
  vzdump: use dirty bitmap for not running VMs too
  config_to_command: use -no-shutdown option
  fix vm_resume and allow vm_start with QMP status 'shutdown'

 PVE/QemuServer.pm                             |  25 +-
 PVE/VZDump/QemuServer.pm                      |  40 +-
 debian/control                                |   1 +
 qmeventd/Makefile                             |   4 +-
 qmeventd/qmeventd.c                           | 364 ++++++++++++++++--
 qmeventd/qmeventd.h                           |  67 +++-
 test/cfg2cmd/bootorder-empty.conf.cmd         |   1 +
 test/cfg2cmd/bootorder-legacy.conf.cmd        |   1 +
 test/cfg2cmd/bootorder.conf.cmd               |   1 +
 .../custom-cpu-model-defaults.conf.cmd        |   1 +
 .../custom-cpu-model-host-phys-bits.conf.cmd  |   1 +
 test/cfg2cmd/custom-cpu-model.conf.cmd        |   1 +
 test/cfg2cmd/efi-raw-old.conf.cmd             |   1 +
 test/cfg2cmd/efi-raw.conf.cmd                 |   1 +
 test/cfg2cmd/i440fx-win10-hostpci.conf.cmd    |   1 +
 test/cfg2cmd/minimal-defaults.conf.cmd        |   1 +
 test/cfg2cmd/netdev.conf.cmd                  |   1 +
 test/cfg2cmd/pinned-version.conf.cmd          |   1 +
 .../q35-linux-hostpci-multifunction.conf.cmd  |   1 +
 test/cfg2cmd/q35-linux-hostpci.conf.cmd       |   1 +
 test/cfg2cmd/q35-win10-hostpci.conf.cmd       |   1 +
 test/cfg2cmd/simple-virtio-blk.conf.cmd       |   1 +
 test/cfg2cmd/simple1.conf.cmd                 |   1 +
 test/cfg2cmd/spice-enhancments.conf.cmd       |   1 +
 test/cfg2cmd/spice-linux-4.1.conf.cmd         |   1 +
 test/cfg2cmd/spice-usb3.conf.cmd              |   1 +
 test/cfg2cmd/spice-win.conf.cmd               |   1 +
 27 files changed, 472 insertions(+), 50 deletions(-)

manager: Stefan Reiter (1):
  ui: qemu: set correct disabled state for start button

 www/manager6/qemu/Config.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

-- 
2.20.1




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-11-05 12:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-19 12:18 [pve-devel] [PATCH v2 0/7] Handle guest shutdown during backups Stefan Reiter
2020-10-19 12:18 ` [pve-devel] [PATCH v2 qemu-server 1/7] qmeventd: add handling for -no-shutdown QEMU instances Stefan Reiter
2020-10-19 12:18 ` [pve-devel] [PATCH v2 qemu-server 2/7] qmeventd: add last-ditch effort SIGKILL cleanup Stefan Reiter
2020-10-19 12:18 ` [pve-devel] [PATCH v2 qemu-server 3/7] vzdump: connect to qmeventd for duration of backup Stefan Reiter
2020-10-19 12:18 ` [pve-devel] [PATCH v2 qemu-server 4/7] vzdump: use dirty bitmap for not running VMs too Stefan Reiter
2020-10-19 12:18 ` [pve-devel] [PATCH v2 qemu-server 5/7] config_to_command: use -no-shutdown option Stefan Reiter
2020-10-19 12:18 ` [pve-devel] [PATCH v2 qemu-server 6/7] fix vm_resume and allow vm_start with QMP status 'shutdown' Stefan Reiter
2020-10-19 12:18 ` [pve-devel] [PATCH v2 manager 7/7] ui: qemu: set correct disabled state for start button Stefan Reiter
2020-11-05 12:35 ` [pve-devel] applied-series: [PATCH v2 0/7] Handle guest shutdown during backups Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal