qemu-block
[Top][All Lists]
Advanced

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

[PATCH v2 5/7] qemu: Block migration when transient disk option is enabl


From: Masayoshi Mizuma
Subject: [PATCH v2 5/7] qemu: Block migration when transient disk option is enabled
Date: Fri, 28 Aug 2020 10:08:35 -0400

From: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>

Block migration when transient disk option is enabled because migration
requires some blockjobs.

Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
---
 src/qemu/qemu_migration.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 0f2f92b211..6fcf5a3a07 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -2949,6 +2949,22 @@ qemuMigrationDstPrepareDirect(virQEMUDriverPtr driver,
 }
 
 
+static bool
+qemuMigrationTransientDiskExists(virDomainDefPtr def)
+{
+    size_t i;
+
+    for (i = 0; i < def->ndisks; i++) {
+       virDomainDiskDefPtr disk = def->disks[i];
+
+       if (disk->transient)
+            return true;
+    }
+
+    return false;
+}
+
+
 virDomainDefPtr
 qemuMigrationAnyPrepareDef(virQEMUDriverPtr driver,
                            virQEMUCapsPtr qemuCaps,
@@ -2971,6 +2987,12 @@ qemuMigrationAnyPrepareDef(virQEMUDriverPtr driver,
                                         VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
         goto cleanup;
 
+    /*
+     * transient disk option is a blocker for migration
+     */
+    if (qemuMigrationTransientDiskExists(def))
+       goto cleanup;
+
     if (dname) {
         name = def->name;
         def->name = g_strdup(dname);
-- 
2.27.0




reply via email to

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