diff mbox series

[v5,6/7,RFC] migration: Make -i/-b an error for hmp and qmp

Message ID 20231017115238.18309-7-quintela@redhat.com (mailing list archive)
State New, archived
Headers show
Series Migration deprecated parts | expand

Commit Message

Juan Quintela Oct. 17, 2023, 11:52 a.m. UTC
[DON'T MERGE]

Block migration is obsolete, users should use blockdev-mirror
instead.
Make it one error to set them.

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 migration/migration-hmp-cmds.c | 13 +++++++------
 migration/migration.c          | 33 ++++++---------------------------
 2 files changed, 13 insertions(+), 33 deletions(-)
diff mbox series

Patch

diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c
index bfeb1a476a..0acc866c79 100644
--- a/migration/migration-hmp-cmds.c
+++ b/migration/migration-hmp-cmds.c
@@ -746,16 +746,17 @@  void hmp_migrate(Monitor *mon, const QDict *qdict)
     Error *err = NULL;
 
     if (inc) {
-        warn_report("option '-i' is deprecated.  Use 'blockdev-mirror + NBD'"
-                    " instead.");
+        monitor_printf(mon, "option '-i' is deprecated.  Use"
+                       " 'blockdev-mirror + NBD' instead.");
+        return;
     }
 
     if (blk) {
-        warn_report("option '-b' is deprecated.  Use 'blockdev-mirror + NBD'"
-                    " instead.");
+        monitor_printf(mon, "option '-b' is deprecated.  Use"
+                       " 'blockdev-mirror + NBD' instead.");
+        return;
     }
-
-    qmp_migrate(uri, !!blk, blk, !!inc, inc,
+    qmp_migrate(uri, false, false, false, false,
                 false, false, true, resume, &err);
     if (hmp_handle_error(mon, err)) {
         return;
diff --git a/migration/migration.c b/migration/migration.c
index 4da7fcfe0f..9a695299ba 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1601,16 +1601,16 @@  bool migration_is_blocked(Error **errp)
 static bool migrate_prepare(MigrationState *s, bool blk, bool blk_inc,
                             bool resume, Error **errp)
 {
-    Error *local_err = NULL;
-
     if (blk_inc) {
-        warn_report("parameter 'inc' is deprecated.  Use blockdev-mirror with"
-                    " NBD instead");
+        error_setg(errp, "parameter 'inc' is deprecated.  Use blockdev-mirror"
+                   " with NBD instead");
+        return false;
     }
 
     if (blk) {
-        warn_report("capability 'blk is deprecated.  Use blockdev-mirror with"
-                    " NBD instead");
+        error_setg(errp, "capability 'blk is deprecated.  Use blockdev-mirror"
+                   " with NBD instead");
+        return false;
     }
 
     if (resume) {
@@ -1662,27 +1662,6 @@  static bool migrate_prepare(MigrationState *s, bool blk, bool blk_inc,
         return false;
     }
 
-    if (blk || blk_inc) {
-        if (migrate_colo()) {
-            error_setg(errp, "No disk migration is required in COLO mode");
-            return false;
-        }
-        if (migrate_block() || migrate_block_incremental()) {
-            error_setg(errp, "Command options are incompatible with "
-                       "current migration capabilities");
-            return false;
-        }
-        if (!migrate_cap_set(MIGRATION_CAPABILITY_BLOCK, true, &local_err)) {
-            error_propagate(errp, local_err);
-            return false;
-        }
-        s->must_remove_block_options = true;
-    }
-
-    if (blk_inc) {
-        migrate_set_block_incremental(true);
-    }
-
     if (migrate_init(s, errp)) {
         return false;
     }