As advertised in the previous commit, migration from -numa
memdev= to -numa mem= is not supported and results in error.
Fortunately, we can check whether the destination has used the
style we told it to, or if the corresponding flag in the
migration cookie is missing then we know we are talking to older
daemon which would have used the old approach. Anyway, let's deny
migration then.

Signed-off-by: Michal Privoznik <mpriv...@redhat.com>
---
 src/qemu/qemu_migration.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 423713e00b..dde491b720 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -2424,7 +2424,8 @@ qemuMigrationDstPrepareAny(virQEMUDriverPtr driver,
         cookieFlags = 0;
     } else {
         cookieFlags = QEMU_MIGRATION_COOKIE_GRAPHICS |
-                      QEMU_MIGRATION_COOKIE_CAPS;
+                      QEMU_MIGRATION_COOKIE_CAPS |
+                      QEMU_MIGRATION_COOKIE_PRIVATE;
     }
 
     if (flags & VIR_MIGRATE_POSTCOPY &&
@@ -3549,10 +3550,18 @@ qemuMigrationSrcRun(virQEMUDriverPtr driver,
                                  cookiein, cookieinlen,
                                  cookieFlags |
                                  QEMU_MIGRATION_COOKIE_GRAPHICS |
-                                 QEMU_MIGRATION_COOKIE_CAPS);
+                                 QEMU_MIGRATION_COOKIE_CAPS |
+                                 QEMU_MIGRATION_COOKIE_PRIVATE);
     if (!mig)
         goto error;
 
+    if (priv->forceNewNuma == VIR_TRISTATE_BOOL_YES &&
+        !(mig->priv && mig->priv->forceNewNuma == VIR_TRISTATE_BOOL_YES)) {
+        virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
+                       _("Migration to older numa unsupported"));
+        goto error;
+    }
+
     if (qemuMigrationSrcGraphicsRelocate(driver, vm, mig, graphicsuri) < 0)
         VIR_WARN("unable to provide data for graphics client relocation");
 
-- 
2.26.2

Reply via email to