From fa2756b71b73e8cd94f7d8964ad5e2aca4d2691c Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Mon, 14 Nov 2011 15:09:43 -0600 Subject: migrate: add migration blockers This lets different subsystems register an Error that is thrown whenever migration is attempted. This works nicely because it gracefully supports things like hotplug. Right now, if multiple errors are registered, only one of them is reported. I expect that for 1.1, we'll extend query-migrate to return all of the reasons why migration is disabled at any given point in time. Signed-off-by: Anthony Liguori Signed-off-by: Anthony Liguori --- migration.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'migration.h') diff --git a/migration.h b/migration.h index 1b8ee58530..0682179bde 100644 --- a/migration.h +++ b/migration.h @@ -17,6 +17,7 @@ #include "qdict.h" #include "qemu-common.h" #include "notify.h" +#include "error.h" typedef struct MigrationState MigrationState; @@ -89,4 +90,18 @@ int ram_load(QEMUFile *f, void *opaque, int version_id); extern int incoming_expected; +/** + * @migrate_add_blocker - prevent migration from proceeding + * + * @reason - an error to be returned whenever migration is attempted + */ +void migrate_add_blocker(Error *reason); + +/** + * @migrate_del_blocker - remove a blocking error from migration + * + * @reason - the error blocking migration + */ +void migrate_del_blocker(Error *reason); + #endif -- cgit v1.2.3