]> git.proxmox.com Git - qemu-server.git/commit - PVE/QemuConfig.pm
snapshot: set migration caps before savevm-start
authorStefan Reiter <s.reiter@proxmox.com>
Tue, 16 Mar 2021 16:30:23 +0000 (17:30 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 16 Mar 2021 19:44:51 +0000 (20:44 +0100)
commit27a5be53760e74514dbd10e642112ba90362b468
tree75baad5884156ba17de12b501cd0efbf470c3425
parentc89642784d80b3b75cecd3046a4dd3e2f19af37c
snapshot: set migration caps before savevm-start

A "savevm" call (both our async variant and the upstream sync one) use
migration code internally. As such, they both expect migration
capabilities to be set.

This is usually not a problem, as the default set of capabilities is ok,
however, it leads to differing snapshot settings if one does a snapshot
after a machine has been live-migrated (as the capabilities will persist
from that), which could potentially lead to discrepencies in snapshots
(currently it seems to be fine, but it still makes sense to set them to
safeguard against future changes).

Note that we do set the "dirty-bitmaps" capability now (if
query-proxmox-support reports true), which has three effects:

1) PBS dirty-bitmaps are preserved in snapshots, enabling
   fast-incremental backups to work after rollback (as long as no newer
   backups exist), including for hibernate/resume
2) snapshots taken from now on, with a QEMU version supporting bitmap
   migration, *might* lead to incompatibility of these snapshots with
   QEMU versions that don't know about bitmaps at all (i.e. < 5.0 IIRC?)
   - forward compatibility is still given, and all other capabilities we
   set go back to very old versions
3) since we now explicitly disable bitmap saving if the version doesn't
   report support, we avoid crashes even with not-updated QEMU versions

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
PVE/QemuConfig.pm
PVE/QemuServer.pm
test/snapshot-test.pm