Register the known cpr blockers. Signed-off-by: Steve Sistare <steven.sist...@oracle.com> --- accel/xen/xen-all.c | 3 +++ backends/hostmem-epc.c | 6 ++++++ migration/migration.c | 6 ++++++ replay/replay.c | 4 ++++ 4 files changed, 19 insertions(+)
diff --git a/accel/xen/xen-all.c b/accel/xen/xen-all.c index 69aa7d0..9dd0dc6 100644 --- a/accel/xen/xen-all.c +++ b/accel/xen/xen-all.c @@ -21,6 +21,7 @@ #include "sysemu/runstate.h" #include "migration/misc.h" #include "migration/global_state.h" +#include "migration/cpr.h" #include "hw/boards.h" //#define DEBUG_XEN @@ -181,6 +182,8 @@ static int xen_init(MachineState *ms) * opt out of system RAM being allocated by generic code */ mc->default_ram_id = NULL; + + cpr_add_blocker_str("xen does not support cpr", &error_fatal, CPR_MODE_ALL); return 0; } diff --git a/backends/hostmem-epc.c b/backends/hostmem-epc.c index cb06255..094fed9 100644 --- a/backends/hostmem-epc.c +++ b/backends/hostmem-epc.c @@ -16,6 +16,7 @@ #include "qapi/error.h" #include "sysemu/hostmem.h" #include "hw/i386/hostmem-epc.h" +#include "migration/cpr.h" static void sgx_epc_backend_memory_alloc(HostMemoryBackend *backend, Error **errp) @@ -23,6 +24,7 @@ sgx_epc_backend_memory_alloc(HostMemoryBackend *backend, Error **errp) uint32_t ram_flags; char *name; int fd; + Error *blocker = NULL; if (!backend->size) { error_setg(errp, "can't create backend with size 0"); @@ -41,6 +43,10 @@ sgx_epc_backend_memory_alloc(HostMemoryBackend *backend, Error **errp) memory_region_init_ram_from_fd(&backend->mr, OBJECT(backend), name, backend->size, ram_flags, fd, 0, errp); + + error_setg(&blocker, "RAM_PROTECTED block %s does not support cpr", name); + cpr_add_blocker(&blocker, errp, CPR_MODE_ALL); + g_free(name); } diff --git a/migration/migration.c b/migration/migration.c index 31739b2..1451bae 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -32,6 +32,7 @@ #include "savevm.h" #include "qemu-file-channel.h" #include "qemu-file.h" +#include "migration/cpr.h" #include "migration/vmstate.h" #include "block/block.h" #include "qapi/error.h" @@ -1283,6 +1284,11 @@ static bool migrate_caps_check(bool *cap_list, return false; } + if (cap_list[MIGRATION_CAPABILITY_X_COLO]) { + return cpr_add_blocker_str("x-colo is not compatible with cpr", + errp, CPR_MODE_ALL); + } + return true; } diff --git a/replay/replay.c b/replay/replay.c index 4c396bb..eb5456f 100644 --- a/replay/replay.c +++ b/replay/replay.c @@ -19,6 +19,7 @@ #include "qemu/option.h" #include "sysemu/cpus.h" #include "qemu/error-report.h" +#include "migration/cpr.h" /* Current version of the replay mechanism. Increase it when file format changes. */ @@ -232,6 +233,9 @@ static void replay_enable(const char *fname, int mode) const char *fmode = NULL; assert(!replay_file); + cpr_add_blocker_str("replay is not compatible with cpr", + &error_fatal, CPR_MODE_ALL); + switch (mode) { case REPLAY_MODE_RECORD: fmode = "wb"; -- 1.8.3.1