migration: forbid snapshots under Xen

The snapshot RAM-saving path does not support Xen's memory mappings.
Refuse 'savevm' and 'loadvm' when running as a Xen device model, the
same way they are refused for CPR migration modes.

Suggested-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Acked-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20261012-up-vsock-vhost-v5-v16-4-36c38bd15ffc@virtuozzo.com>
This commit is contained in:
Andrey Drobyshev
2026-10-12 13:28:12 +03:00
committed by Michael S. Tsirkin
parent e9b0d4a0f4
commit b8bd334225

View File

@@ -37,6 +37,7 @@
#include "ram.h"
#include "options.h"
#include "system/kvm.h"
#include "system/xen.h"
/* Maximum migrate downtime set to 2000 seconds */
#define MAX_MIGRATE_DOWNTIME_SECONDS 2000
@@ -563,6 +564,11 @@ bool migrate_can_snapshot(Error **errp)
MigMode mode = migrate_mode();
int i;
if (xen_enabled()) {
error_setg(errp, "Snapshots are not compatible with Xen");
return false;
}
if (mode != MIG_MODE_NORMAL) {
error_setg(errp, "Snapshots are not compatible with migration mode %s",
MigMode_str(mode));