qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v5 4/4] migration: Fail migration blocker for --only


From: Ashijeet Acharya
Subject: [Qemu-devel] [PATCH v5 4/4] migration: Fail migration blocker for --only-migratable
Date: Thu, 12 Jan 2017 21:22:34 +0530

migrate_add_blocker should rightly fail if the '--only-migratable'
option was specified and the device in use should not be able to
perform the action which results in an unmigratable VM.

Make migrate_add_blocker return -EACCES in this case.

Signed-off-by: Ashijeet Acharya <address@hidden>
---
 migration/migration.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/migration/migration.c b/migration/migration.c
index cca820e..054048d 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1113,6 +1113,14 @@ static GSList *migration_blockers;
 
 int migrate_add_blocker(Error *reason, Error **errp)
 {
+    if (only_migratable) {
+        error_propagate(errp, reason);
+        error_prepend(errp, "disallowing migration blocker "
+                          "(--only_migratable) for: ");
+        error_free(reason);
+        return -EACCES;
+    }
+
     if (migration_is_idle(NULL)) {
         migration_blockers = g_slist_prepend(migration_blockers, reason);
         return 0;
-- 
2.6.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]