[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH V8 09/39] cpr: register blockers
From: |
Steve Sistare |
Subject: |
[PATCH V8 09/39] cpr: register blockers |
Date: |
Wed, 15 Jun 2022 07:51:56 -0700 |
Register the known cpr blockers.
Signed-off-by: Steve Sistare <steven.sistare@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
- Re: [PATCH V8 03/39] migration: simplify savevm, (continued)
- [PATCH V8 06/39] cpr: reboot mode, Steve Sistare, 2022/06/15
- [PATCH V8 02/39] migration: qemu file wrappers, Steve Sistare, 2022/06/15
- [PATCH V8 08/39] cpr: blockers, Steve Sistare, 2022/06/15
- [PATCH V8 10/39] cpr: cpr-enable option, Steve Sistare, 2022/06/15
- [PATCH V8 12/39] memory: flat section iterator, Steve Sistare, 2022/06/15
- [PATCH V8 09/39] cpr: register blockers,
Steve Sistare <=
- [PATCH V8 11/39] cpr: save ram blocks, Steve Sistare, 2022/06/15
- [PATCH V8 13/39] oslib: qemu_clear_cloexec, Steve Sistare, 2022/06/15
- [PATCH V8 25/39] cpr: notifiers, Steve Sistare, 2022/06/15
- [PATCH V8 20/39] cpr: restart mode, Steve Sistare, 2022/06/15
- [PATCH V8 29/39] vfio-pci: cpr part 3 (intx), Steve Sistare, 2022/06/15
- [PATCH V8 17/39] qapi: strList unit tests, Steve Sistare, 2022/06/15