qapi: Inline and remove QERR_MIGRATION_ACTIVE definition
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 12 Mar 2024 14:13:42 +0000 (15:13 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Wed, 24 Apr 2024 07:50:58 +0000 (09:50 +0200)
Address the comment added in commit 4629ed1e98
("qerror: Finally unused, clean up"), from 2015:

  /*
   * These macros will go away, please don't use
   * in new code, and do not add new ones!
   */

Mechanical transformation using sed, manually
removing the definition in include/qapi/qmp/qerror.h.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20240312141343.3168265-10-armbru@redhat.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
[Straightforward conflict with commit aeaafb1e59f (migration: export
migration_is_running) resolved]

include/qapi/qmp/qerror.h
migration/migration.c
migration/options.c
migration/savevm.c

index b723830eff644ed5816bbfb1802076099b9a08bb..385a4876d6d48b0cd6fee8dc1c341780d4ec7c26 100644 (file)
@@ -23,9 +23,6 @@
 #define QERR_IO_ERROR \
     "An IO error has occurred"
 
-#define QERR_MIGRATION_ACTIVE \
-    "There's a migration process in progress"
-
 #define QERR_MISSING_PARAMETER \
     "Parameter '%s' is missing"
 
index 86bf76e92585792d7f32e5a94ded95d6cad44975..32cd89e13d994d3a0b82f13033ff3a9d4acee47c 100644 (file)
@@ -1956,7 +1956,7 @@ static bool migrate_prepare(MigrationState *s, bool blk, bool blk_inc,
     }
 
     if (migration_is_running()) {
-        error_setg(errp, QERR_MIGRATION_ACTIVE);
+        error_setg(errp, "There's a migration process in progress");
         return false;
     }
 
index d7a773aea8a96757f44329e0b2613e4797ce6a43..239f5ecfb4cf588fc8be9e415aa5f0ec76238566 100644 (file)
@@ -685,7 +685,7 @@ bool migrate_cap_set(int cap, bool value, Error **errp)
     bool new_caps[MIGRATION_CAPABILITY__MAX];
 
     if (migration_is_running()) {
-        error_setg(errp, QERR_MIGRATION_ACTIVE);
+        error_setg(errp, "There's a migration process in progress");
         return false;
     }
 
@@ -729,7 +729,7 @@ void qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params,
     bool new_caps[MIGRATION_CAPABILITY__MAX];
 
     if (migration_is_running() || migration_in_colo_state()) {
-        error_setg(errp, QERR_MIGRATION_ACTIVE);
+        error_setg(errp, "There's a migration process in progress");
         return;
     }
 
index e7c1215671d2fed2736f7aa273bb9f89adb1b8ef..3fae9f155f4e72c93055051dedb0471a4f99c568 100644 (file)
@@ -1707,7 +1707,7 @@ static int qemu_savevm_state(QEMUFile *f, Error **errp)
     MigrationStatus status;
 
     if (migration_is_running()) {
-        error_setg(errp, QERR_MIGRATION_ACTIVE);
+        error_setg(errp, "There's a migration process in progress");
         return -EINVAL;
     }